static void panel_menu_bar_init(PanelMenuBar* menubar) { GtkWidget* image; menubar->priv = PANEL_MENU_BAR_GET_PRIVATE(menubar); menubar->priv->info = NULL; menubar->priv->applications_menu = create_applications_menu("mate-applications.menu", NULL, TRUE); menubar->priv->applications_item = panel_image_menu_item_new(); gtk_menu_item_set_label(GTK_MENU_ITEM(menubar->priv->applications_item), _("Applications")); image = gtk_image_new_from_icon_name(PANEL_ICON_MAIN_MENU, panel_menu_bar_icon_get_size()); gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menubar->priv->applications_item), image); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menubar->priv->applications_item), menubar->priv->applications_menu); gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menubar->priv->applications_item); menubar->priv->places_item = panel_place_menu_item_new(FALSE); gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menubar->priv->places_item); menubar->priv->desktop_item = panel_desktop_menu_item_new(FALSE, TRUE); gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menubar->priv->desktop_item); panel_menu_bar_setup_tooltip(menubar); panel_menu_bar_update_text_gravity(menubar); g_signal_connect(menubar, "screen-changed", G_CALLBACK(panel_menu_bar_update_text_gravity), NULL); }
static void main_menu_append (GtkWidget *main_menu, gpointer data) { PanelWidget *panel; GtkWidget *item; gboolean add_separator; GList *children; GList *last; panel = PANEL_WIDGET (data); add_separator = FALSE; children = gtk_container_get_children (GTK_CONTAINER (main_menu)); last = g_list_last (children); if (last != NULL) { add_separator = !GTK_IS_SEPARATOR (GTK_WIDGET (last->data)); } g_list_free (children); if (add_separator) add_menu_separator (main_menu); item = panel_place_menu_item_new (TRUE); panel_place_menu_item_set_panel (item, panel); gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item); gtk_widget_show (item); item = panel_desktop_menu_item_new (TRUE, FALSE); panel_desktop_menu_item_set_panel (item, panel); gtk_menu_shell_append (GTK_MENU_SHELL (main_menu), item); gtk_widget_show (item); panel_menu_items_append_lock_logout (main_menu); }
static void panel_user_menu_init (PanelUserMenu *usermenu) { usermenu->priv = PANEL_USER_MENU_GET_PRIVATE (usermenu); usermenu->priv->info = NULL; usermenu->priv->desktop_item = panel_desktop_menu_item_new (TRUE, TRUE, TRUE); gtk_menu_shell_append (GTK_MENU_SHELL (usermenu), usermenu->priv->desktop_item); gtk_widget_show (usermenu->priv->desktop_item); }
static void panel_menu_bar_init(PanelMenuBar* menubar) { #if GTK_CHECK_VERSION (3, 0, 0) GtkCssProvider *provider; #endif menubar->priv = PANEL_MENU_BAR_GET_PRIVATE(menubar); #if GTK_CHECK_VERSION (3, 0, 0) provider = gtk_css_provider_new (); gtk_css_provider_load_from_data (provider, "PanelMenuBar {\n" " border-width: 0px;\n" "}", -1, NULL); gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (menubar)), GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); g_object_unref (provider); #endif menubar->priv->info = NULL; menubar->priv->settings = g_settings_new (PANEL_MENU_BAR_SCHEMA); menubar->priv->applications_menu = create_applications_menu("mate-applications.menu", NULL, TRUE); menubar->priv->applications_item = panel_image_menu_item_new(); gtk_menu_item_set_label(GTK_MENU_ITEM(menubar->priv->applications_item), _("Applications")); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menubar->priv->applications_item), menubar->priv->applications_menu); gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menubar->priv->applications_item); menubar->priv->places_item = panel_place_menu_item_new(FALSE); gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menubar->priv->places_item); menubar->priv->desktop_item = panel_desktop_menu_item_new(FALSE, TRUE); gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menubar->priv->desktop_item); panel_menu_bar_setup_tooltip(menubar); panel_menu_bar_update_visibility(menubar->priv->settings, NULL, menubar); g_signal_connect(menubar->priv->settings, "changed", G_CALLBACK (panel_menu_bar_update_visibility), menubar); panel_menu_bar_update_text_gravity(menubar); g_signal_connect(menubar, "screen-changed", G_CALLBACK(panel_menu_bar_update_text_gravity), NULL); }