[maemo-commits] [maemo-commits] r12702 - in projects/haf/trunk/hildon-desktop: . libhildondesktop src
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Mon Jul 9 17:17:51 EEST 2007
- Previous message: [maemo-commits] r12701 - in projects/haf/trunk/hildon-desktop: . libhildondesktop
- Next message: [maemo-commits] r12703 - in projects/haf/trunk/libhildonmime: . data debian
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: lucasr Date: 2007-07-09 17:17:47 +0300 (Mon, 09 Jul 2007) New Revision: 12702 Modified: projects/haf/trunk/hildon-desktop/ChangeLog projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-popup-menu.c projects/haf/trunk/hildon-desktop/src/hd-applications-menu.c Log: 2007-07-09 Lucas Rocha <lucas.rocha at nokia.com> * libhildondesktop/hildon-desktop-popup-menu.c: (hildon_desktop_popup_menu_paint), (hildon_desktop_popup_menu_constructor): paint box in the HildonDesktopPopupMenu and its internal viewport to make it more friendly for theming. * src/hd-applications-menu.c (hd_applications_menu_create_menu): set the widgets names to enable theming on application menu. Modified: projects/haf/trunk/hildon-desktop/ChangeLog =================================================================== --- projects/haf/trunk/hildon-desktop/ChangeLog 2007-07-09 14:09:45 UTC (rev 12701) +++ projects/haf/trunk/hildon-desktop/ChangeLog 2007-07-09 14:17:47 UTC (rev 12702) @@ -1,3 +1,13 @@ +2007-07-09 Lucas Rocha <lucas.rocha at nokia.com> + + * libhildondesktop/hildon-desktop-popup-menu.c: + (hildon_desktop_popup_menu_paint), + (hildon_desktop_popup_menu_constructor): paint box in the + HildonDesktopPopupMenu and its internal viewport to make it more + friendly for theming. + * src/hd-applications-menu.c (hd_applications_menu_create_menu): set + the widgets names to enable theming on application menu. + 2007-07-09 Moises Martinez <moises.martinez at nokia.com> * libhildondesktop/hildon-desktop-panel-expandable.c: Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-popup-menu.c =================================================================== --- projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-popup-menu.c 2007-07-09 14:09:45 UTC (rev 12701) +++ projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-popup-menu.c 2007-07-09 14:17:47 UTC (rev 12702) @@ -176,6 +176,26 @@ } +static gboolean +hildon_desktop_popup_menu_paint (GtkWidget *widget, + GdkEventExpose *event, + gpointer user_data) +{ + gtk_paint_box (widget->style, + widget->window, + GTK_STATE_NORMAL, + GTK_SHADOW_NONE, + NULL, + widget, + NULL, + widget->allocation.x, + widget->allocation.y, + widget->allocation.width, + widget->allocation.height); + + return FALSE; +} + static GObject * hildon_desktop_popup_menu_constructor (GType gtype, guint n_params, @@ -236,6 +256,16 @@ gtk_widget_pop_composite_child (); + g_signal_connect (menu, + "expose_event", + G_CALLBACK (hildon_desktop_popup_menu_paint), + NULL); + + g_signal_connect (menu->priv->viewport, + "expose_event", + G_CALLBACK (hildon_desktop_popup_menu_paint), + NULL); + return object; } @@ -246,6 +276,7 @@ G_OBJECT_CLASS (hildon_desktop_popup_menu_parent_class)->finalize (object); } + static void hildon_desktop_popup_menu_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { Modified: projects/haf/trunk/hildon-desktop/src/hd-applications-menu.c =================================================================== --- projects/haf/trunk/hildon-desktop/src/hd-applications-menu.c 2007-07-09 14:09:45 UTC (rev 12701) +++ projects/haf/trunk/hildon-desktop/src/hd-applications-menu.c 2007-07-09 14:17:47 UTC (rev 12702) @@ -69,11 +69,13 @@ G_DEFINE_TYPE (HDApplicationsMenu, hd_applications_menu, TASKNAVIGATOR_TYPE_ITEM); -#define HD_APPS_MENU_POPUP_WINDOW_NAME "" -#define HD_APPS_MENU_CAT_MENU_ITEM_NAME "" +#define HD_APPS_MENU_POPUP_WINDOW_NAME "hildon-apps-menu" +#define HD_APPS_MENU_CAT_MENU_NAME "hildon-apps-menu-pane1" +#define HD_APPS_MENU_CAT_MENU_ITEM_NAME "hildon-apps-menu-pane1-item" #define HD_APPS_MENU_CAT_BUTTON_UP_NAME "" #define HD_APPS_MENU_CAT_BUTTON_DOWN_NAME "" -#define HD_APPS_MENU_APP_MENU_ITEM_NAME "" +#define HD_APPS_MENU_APP_MENU_NAME "hildon-apps-menu-pane2" +#define HD_APPS_MENU_APP_MENU_ITEM_NAME "hildon-apps-menu-pane2-item" #define HD_APPS_MENU_APP_BUTTON_UP_NAME "" #define HD_APPS_MENU_APP_BUTTON_DOWN_NAME "" @@ -787,7 +789,7 @@ { HildonDesktopPopupWindow *popup_window; const GtkWidget *button_up, *button_down; - GtkWidget *box; + GtkWidget *box, *alignment; g_return_if_fail (button); @@ -799,6 +801,10 @@ GTK_ORIENTATION_HORIZONTAL, HD_POPUP_WINDOW_DIRECTION_RIGHT_BOTTOM)); + alignment = gtk_alignment_new (0.0, 0.0, 1.0, 1.0); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 4, 4, 4, 4); + gtk_widget_show (alignment); + gtk_widget_set_name (GTK_WIDGET (popup_window), HD_APPS_MENU_POPUP_WINDOW_NAME); gtk_widget_set_size_request (GTK_WIDGET (popup_window), 650, 480); @@ -817,6 +823,9 @@ gtk_widget_show (GTK_WIDGET (button->priv->menu_categories)); + gtk_widget_set_name (GTK_WIDGET (button->priv->menu_categories), + HD_APPS_MENU_CAT_MENU_NAME); + gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET (button->priv->menu_categories), TRUE, @@ -839,6 +848,9 @@ gtk_widget_show (GTK_WIDGET (button->priv->menu_applications)); + gtk_widget_set_name (GTK_WIDGET (button->priv->menu_applications), + HD_APPS_MENU_APP_MENU_NAME); + gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET (button->priv->menu_applications), TRUE, @@ -864,9 +876,10 @@ button); gtk_widget_show (box); - - gtk_container_add (GTK_CONTAINER (popup_window), box); + gtk_container_add (GTK_CONTAINER (alignment), box); + gtk_container_add (GTK_CONTAINER (popup_window), alignment); + if (button->priv->popup_window) { /* Destroy the previous version of the menu */
- Previous message: [maemo-commits] r12701 - in projects/haf/trunk/hildon-desktop: . libhildondesktop
- Next message: [maemo-commits] r12703 - in projects/haf/trunk/libhildonmime: . data debian
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]