void panel_menu_bar_object_object_load_finish (PanelMenuBarObject *menubar, PanelWidget *panel) { menubar->priv->panel = panel; /* we didn't do this on "applet-added" since we didn't have the panel yet */ panel_menu_bar_object_change_background (menubar); panel_menu_bar_object_update_orientation (menubar); panel_menu_bar_object_update_text_gravity (menubar); g_signal_connect (menubar, "screen-changed", G_CALLBACK (panel_menu_bar_object_update_text_gravity), NULL); g_signal_connect_after (menubar, "focus-in-event", G_CALLBACK (gtk_widget_queue_draw), menubar); g_signal_connect_after (menubar, "focus-out-event", G_CALLBACK (gtk_widget_queue_draw), menubar); g_signal_connect_after (menubar, "draw", G_CALLBACK (panel_menu_bar_object_on_draw), menubar); gtk_widget_set_can_focus (GTK_WIDGET (menubar), TRUE); panel_widget_set_applet_expandable (panel, GTK_WIDGET (menubar), FALSE, TRUE); }
static void panel_menu_bar_object_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkAllocation old_allocation; GtkAllocation widget_allocation; PanelBackground *background; gtk_widget_get_allocation (widget, &widget_allocation); old_allocation.x = widget_allocation.x; old_allocation.y = widget_allocation.y; old_allocation.width = widget_allocation.width; old_allocation.height = widget_allocation.height; GTK_WIDGET_CLASS (panel_menu_bar_object_parent_class)->size_allocate (widget, allocation); if (old_allocation.x == allocation->x && old_allocation.y == allocation->y && old_allocation.width == allocation->width && old_allocation.height == allocation->height) return; background = &PANEL_MENU_BAR_OBJECT (widget)->priv->panel->background; if (background->type == PANEL_BACK_NONE || (background->type == PANEL_BACK_COLOR && !background->has_alpha)) return; panel_menu_bar_object_change_background (PANEL_MENU_BAR_OBJECT (widget)); }
void back_change (AppletInfo *info, PanelWidget *panel) { switch (info->type) { case PANEL_OBJECT_APPLET: panel_applet_frame_change_background ( PANEL_APPLET_FRAME (info->widget), panel->background.type); break; case PANEL_OBJECT_MENU_BAR: case PANEL_OBJECT_USER_MENU: panel_menu_bar_object_change_background (PANEL_MENU_BAR_OBJECT (info->widget)); break; case PANEL_OBJECT_SEPARATOR: panel_separator_change_background (PANEL_SEPARATOR (info->widget)); break; default: break; } }