diff --git a/.SRCINFO b/.SRCINFO index d1bb60a..8ca7034 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = gtk3-mushrooms pkgdesc = GTK3 library with my modifications (see README). pkgver = 3.22.16 - pkgrel = 2 + pkgrel = 3 url = http://www.gtk.org/ install = gtk3.install arch = i686 @@ -48,10 +48,13 @@ pkgbase = gtk3-mushrooms source = p__icons__buttons.patch source = p__icons__context-menus.patch source = p__icons__file-chooser.patch - source = p__other__menubutton-menu.patch source = p__other__mnemonics-delay.patch source = p__other__scrollbar.patch source = p__other__statusbar.patch + source = p__popovers__color-chooser.patch + source = p__popovers__file-chooser.patch + source = p__popovers__menu-button.patch + source = p__popovers__places-sidebar.patch source = p__print-dialog__appearance.patch source = p__print-dialog__previewer.patch source = smaller-adwaita.css @@ -65,13 +68,16 @@ pkgbase = gtk3-mushrooms sha256sums = 49c9847239511c2db0be46cb8f660c2c4a43a45b3deed4443eb449daf9ceaf21 sha256sums = 1eac1a085ec83e4c340cdbe97d146e902497115ca29b8278eb645e0b7fce352e sha256sums = 0439a24d7dbc1eba24fa75026f92da00c2b173cb5ccde6318629ffb191692d8d - sha256sums = ee7fd84ea670406cdf92e8710872431123a92ce93b51e9a3ea9b7898a5ba42d9 - sha256sums = 10845323e45d0a49ab47c9bfb0dc2e77320d8b06049b65f8941a4d1109eb7f83 + sha256sums = 267995c5aa0541d6d75b0e9c3190c0f63cbf0c18e533997b5ae77318584cad46 + sha256sums = e120514e4f6f3658e40dc425d4c57f4f62c8007d1210f546a96083ccab87b7d0 sha256sums = f7d4dc007352b6f04bef467420fb8b3ed43fbef3cc5928370f926ce22af93ab3 - sha256sums = f33c1fc18a02eb04a91be6218642ffd7cfa7bfc2c4c1656c413eb78d904862cf sha256sums = ccc9ecc561c56e470a4dced055bafd6ae108c6b86e2a56f965a14afe04d35f62 sha256sums = cd6967c6b46581752b2587a6e294950065187e10606987d71b8422b2370ca755 sha256sums = d7855f0122bb10f96463433bf60481e2a9d5f435e6618d72254454973872411d + sha256sums = 66ad760507ff8da2578bce5cbba933e201995b29a0bc26435b4eb63e6454ef44 + sha256sums = 4e273cf475f73f52c885ea41d2c72ddd1c0c466b323265f35e084c0038cb9a06 + sha256sums = f33c1fc18a02eb04a91be6218642ffd7cfa7bfc2c4c1656c413eb78d904862cf + sha256sums = 9a5d45d9f0b4c41d2255b042ebc8efe57d3fd096048125c14bc4d95fc83fbf24 sha256sums = 9dd136016d59b7b3fe8746c722a6adb9f30aa1dcbf5bf37f0055bb1af5e4d27c sha256sums = 65d8e125c74798d2a1d1e872ee4332b3a3f6332d8860963e9f3e4c8c6f41cb92 sha256sums = 0afbd995148ce6e03010b572d69533e4d250a2e5f60323422b16a407ff162885 diff --git a/PKGBUILD b/PKGBUILD index 8728d34..e0453fd 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -5,7 +5,7 @@ pkgname=gtk3-mushrooms pkgver=3.22.16 -pkgrel=2 +pkgrel=3 pkgdesc="GTK3 library with my modifications (see README)." url="http://www.gtk.org/" install=gtk3.install @@ -35,10 +35,13 @@ source=( "p__icons__buttons.patch" "p__icons__context-menus.patch" "p__icons__file-chooser.patch" - "p__other__menubutton-menu.patch" "p__other__mnemonics-delay.patch" "p__other__scrollbar.patch" "p__other__statusbar.patch" + "p__popovers__color-chooser.patch" + "p__popovers__file-chooser.patch" + "p__popovers__menu-button.patch" + "p__popovers__places-sidebar.patch" "p__print-dialog__appearance.patch" "p__print-dialog__previewer.patch" @@ -56,13 +59,16 @@ sha256sums=( "49c9847239511c2db0be46cb8f660c2c4a43a45b3deed4443eb449daf9ceaf21" "1eac1a085ec83e4c340cdbe97d146e902497115ca29b8278eb645e0b7fce352e" "0439a24d7dbc1eba24fa75026f92da00c2b173cb5ccde6318629ffb191692d8d" - "ee7fd84ea670406cdf92e8710872431123a92ce93b51e9a3ea9b7898a5ba42d9" - "10845323e45d0a49ab47c9bfb0dc2e77320d8b06049b65f8941a4d1109eb7f83" + "267995c5aa0541d6d75b0e9c3190c0f63cbf0c18e533997b5ae77318584cad46" + "e120514e4f6f3658e40dc425d4c57f4f62c8007d1210f546a96083ccab87b7d0" "f7d4dc007352b6f04bef467420fb8b3ed43fbef3cc5928370f926ce22af93ab3" - "f33c1fc18a02eb04a91be6218642ffd7cfa7bfc2c4c1656c413eb78d904862cf" "ccc9ecc561c56e470a4dced055bafd6ae108c6b86e2a56f965a14afe04d35f62" "cd6967c6b46581752b2587a6e294950065187e10606987d71b8422b2370ca755" "d7855f0122bb10f96463433bf60481e2a9d5f435e6618d72254454973872411d" + "66ad760507ff8da2578bce5cbba933e201995b29a0bc26435b4eb63e6454ef44" + "4e273cf475f73f52c885ea41d2c72ddd1c0c466b323265f35e084c0038cb9a06" + "f33c1fc18a02eb04a91be6218642ffd7cfa7bfc2c4c1656c413eb78d904862cf" + "9a5d45d9f0b4c41d2255b042ebc8efe57d3fd096048125c14bc4d95fc83fbf24" "9dd136016d59b7b3fe8746c722a6adb9f30aa1dcbf5bf37f0055bb1af5e4d27c" "65d8e125c74798d2a1d1e872ee4332b3a3f6332d8860963e9f3e4c8c6f41cb92" diff --git a/README.md b/README.md index 99dc8a7..9595808 100644 --- a/README.md +++ b/README.md @@ -36,13 +36,18 @@ Icons * Context menus of text fields, links and labels have restored icons too. * Colorized icons instead of symbolic icons are used in file chooser dialog. +Popovers +--- + +* File chooser dialog, places sidebar and color chooser dialog use classic menu as context menu instead of popover. +* Menus of menu buttons are displayed as classic menu instead of popover. + Others --- * Status bars are smaller regardless of used theme. * Scrollbars are always visible. Environment variable is not needed. * Delay before showing mnemonics is removed. You do not have to wait. -* Menus of menu buttons are displayed as classic menu by default instead of popover. Themes --- @@ -52,13 +57,6 @@ Themes -------- -In future ---- - -* File chooser and color chooser: use classic menu instead of popovers as context menus. -* Message dialogs: restore classic appearance like in GTK2. -* Context menus: restore icons in some places. - Credits --- diff --git a/p__icons__buttons.patch b/p__icons__buttons.patch index bbd3a30..44d617e 100644 --- a/p__icons__buttons.patch +++ b/p__icons__buttons.patch @@ -30,7 +30,7 @@ diff -U 10 -r -Z -B ./org/gtk/gtkbutton.c ./mod/gtk/gtkbutton.c + else if (g_strcmp0( label, _("_Add") ) == 0) use_this_icon = "gtk-add"; + else if (g_strcmp0( label, _("_Help") ) == 0) use_this_icon = "gtk-help"; + if (use_this_icon) -+ gtk_button_set_image(GTK_BUTTON(button), gtk_image_new_from_icon_name(use_this_icon,GTK_ICON_SIZE_BUTTON)); ++ g_object_set(button, "image", gtk_image_new_from_icon_name(use_this_icon,GTK_ICON_SIZE_BUTTON), NULL); + } + priv = button->priv; diff --git a/p__icons__context-menus.patch b/p__icons__context-menus.patch index c768e47..33f2c74 100644 --- a/p__icons__context-menus.patch +++ b/p__icons__context-menus.patch @@ -22,7 +22,7 @@ diff -U 10 -r -Z -B ./org/gtk/deprecated/gtkimagemenuitem.c ./mod/gtk/deprecated + else if (g_strcmp0( label, _("Select _All") ) == 0) use_this_icon = "gtk-select-all"; + else if (g_strcmp0( label, _("_Open Link") ) == 0) use_this_icon = "gtk-jump-to"; + if (use_this_icon) -+ gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_item), gtk_image_new_from_icon_name(use_this_icon,GTK_ICON_SIZE_MENU)); ++ g_object_set(menu_item, "image", gtk_image_new_from_icon_name(use_this_icon,GTK_ICON_SIZE_MENU), NULL); + } + if (priv->label != label) diff --git a/p__popovers__color-chooser.patch b/p__popovers__color-chooser.patch new file mode 100644 index 0000000..00da37d --- /dev/null +++ b/p__popovers__color-chooser.patch @@ -0,0 +1,34 @@ +diff -U 10 -r -Z -B ./org/gtk/gtkcolorswatch.c ./mod/gtk/gtkcolorswatch.c +--- ./org/gtk/gtkcolorswatch.c 2017-06-20 21:16:19.000000000 +0200 ++++ ./mod/gtk/gtkcolorswatch.c 2017-07-09 23:49:43.733947294 +0200 +@@ -340,20 +340,30 @@ + + static void + emit_customize (GtkColorSwatch *swatch) + { + g_signal_emit (swatch, signals[CUSTOMIZE], 0); + } + + static void + do_popup (GtkColorSwatch *swatch) + { ++ if (swatch->priv->popover == NULL) { ++ GtkWidget *item; ++ swatch->priv->popover = gtk_menu_new(); ++ item = gtk_menu_item_new_with_mnemonic(_("C_ustomize")); ++ g_signal_connect_swapped (item, "activate", G_CALLBACK (emit_customize), swatch); ++ gtk_widget_set_visible(GTK_WIDGET(item), TRUE); ++ gtk_menu_shell_append(GTK_MENU_SHELL(swatch->priv->popover), item); ++ } ++ gtk_menu_popup_at_pointer(GTK_MENU(swatch->priv->popover), NULL); ++ return; + if (swatch->priv->popover == NULL) + { + GtkWidget *box; + GtkWidget *item; + + swatch->priv->popover = gtk_popover_new (GTK_WIDGET (swatch)); + box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + gtk_container_add (GTK_CONTAINER (swatch->priv->popover), box); + g_object_set (box, "margin", 10, NULL); + item = g_object_new (GTK_TYPE_MODEL_BUTTON, diff --git a/p__popovers__file-chooser.patch b/p__popovers__file-chooser.patch new file mode 100644 index 0000000..9281d5b --- /dev/null +++ b/p__popovers__file-chooser.patch @@ -0,0 +1,148 @@ +diff -U 10 -r -Z -B ./org/gtk/gtkfilechooserwidget.c ./mod/gtk/gtkfilechooserwidget.c +--- ./org/gtk/gtkfilechooserwidget.c 2017-06-20 21:16:19.000000000 +0200 ++++ ./mod/gtk/gtkfilechooserwidget.c 2017-07-10 20:28:44.210187624 +0200 +@@ -72,20 +72,21 @@ + #include "gtkshow.h" + #include "gtkmain.h" + #include "gtkscrollable.h" + #include "gtkpopover.h" + #include "gtkrevealer.h" + #include "gtkspinner.h" + #include "gtkseparator.h" + #include "gtkmodelbutton.h" + #include "gtkgesturelongpress.h" + #include "gtkdebug.h" ++#include "deprecated/gtkimagemenuitem.h" + + #include + + #ifdef HAVE_UNISTD_H + #include + #endif + #ifdef G_OS_WIN32 + #include + #endif + +@@ -2217,20 +2218,24 @@ + impl); + gtk_widget_insert_action_group (GTK_WIDGET (impl->priv->browse_files_tree_view), "item", actions); + g_object_unref (actions); + } + + static GtkWidget * + append_separator (GtkWidget *box) + { + GtkWidget *separator; + ++ separator = gtk_separator_menu_item_new(); ++ gtk_widget_set_visible(GTK_WIDGET(separator), TRUE); ++ gtk_menu_shell_append(GTK_MENU_SHELL(box), separator); ++ return separator; + separator = g_object_new (GTK_TYPE_SEPARATOR, + "orientation", GTK_ORIENTATION_HORIZONTAL, + "visible", TRUE, + "margin-start", 12, + "margin-end", 12, + "margin-top", 6, + "margin-bottom", 6, + NULL); + gtk_container_add (GTK_CONTAINER (box), separator); + +@@ -2238,20 +2243,28 @@ + } + + /* Constructs the popup menu for the file list if needed */ + static GtkWidget * + add_button (GtkWidget *box, + const gchar *label, + const gchar *action) + { + GtkWidget *item; + ++ if (g_str_match_string("toggle", action, TRUE)) ++ item = gtk_check_menu_item_new_with_mnemonic(label); ++ else ++ item = gtk_image_menu_item_new_with_mnemonic(label); ++ g_object_set(G_OBJECT(item), "action-name", action, NULL); ++ gtk_widget_set_visible(GTK_WIDGET(item), TRUE); ++ gtk_menu_shell_append(GTK_MENU_SHELL(box), item); ++ return item; + item = g_object_new (GTK_TYPE_MODEL_BUTTON, + "visible", TRUE, + "action-name", action, + "text", label, + NULL); + gtk_container_add (GTK_CONTAINER (box), item); + + return item; + } + +@@ -2262,35 +2275,45 @@ + GtkWidget *box; + + if (priv->browse_files_popover) + return; + + priv->browse_files_popover = gtk_popover_new (priv->browse_files_tree_view); + box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + g_object_set (box, "margin", 10, NULL); + gtk_widget_show (box); + gtk_container_add (GTK_CONTAINER (priv->browse_files_popover), box); ++ priv->browse_files_popover = gtk_menu_new(); ++ gtk_menu_attach_to_widget(GTK_MENU(priv->browse_files_popover), GTK_WIDGET(priv->browse_files_tree_view), NULL); ++ box = priv->browse_files_popover; + + priv->visit_file_item = add_button (box, _("_Visit File"), "item.visit"); + priv->open_folder_item = add_button (box, _("_Open With File Manager"), "item.open"); + priv->copy_file_location_item = add_button (box, _("_Copy Location"), "item.copy-location"); + priv->add_shortcut_item = add_button (box, _("_Add to Bookmarks"), "item.add-shortcut"); + priv->rename_file_item = add_button (box, _("_Rename"), "item.rename"); + priv->delete_file_item = add_button (box, _("_Delete"), "item.delete"); + priv->trash_file_item = add_button (box, _("_Move to Trash"), "item.trash"); + + append_separator (box); + + priv->hidden_files_item = add_button (box, _("Show _Hidden Files"), "item.toggle-show-hidden"); + priv->size_column_item = add_button (box, _("Show _Size Column"), "item.toggle-show-size"); + priv->show_time_item = add_button (box, _("Show _Time"), "item.toggle-show-time"); + priv->sort_directories_item = add_button (box, _("Sort _Folders before Files"), "item.toggle-sort-dirs-first"); ++ g_object_set(priv->visit_file_item, "image", gtk_image_new_from_icon_name("gtk-jump-to",GTK_ICON_SIZE_MENU), NULL); ++ g_object_set(priv->open_folder_item, "image", gtk_image_new_from_icon_name("gtk-open",GTK_ICON_SIZE_MENU), NULL); ++ g_object_set(priv->copy_file_location_item, "image", gtk_image_new_from_icon_name("gtk-copy",GTK_ICON_SIZE_MENU), NULL); ++ g_object_set(priv->add_shortcut_item, "image", gtk_image_new_from_icon_name("bookmark-new",GTK_ICON_SIZE_MENU), NULL); ++ g_object_set(priv->rename_file_item, "image", gtk_image_new_from_icon_name("gtk-edit",GTK_ICON_SIZE_MENU), NULL); ++ g_object_set(priv->delete_file_item, "image", gtk_image_new_from_icon_name("gtk-delete",GTK_ICON_SIZE_MENU), NULL); ++ g_object_set(priv->trash_file_item, "image", gtk_image_new_from_icon_name("user-trash-full",GTK_ICON_SIZE_MENU), NULL); + } + + /* Updates the popover for the file list, creating it if necessary */ + static void + file_list_update_popover (GtkFileChooserWidget *impl) + { + GtkFileChooserWidgetPrivate *priv = impl->priv; + GActionGroup *actions; + GAction *action; + +@@ -2333,20 +2356,22 @@ + { + GtkFileChooserWidgetPrivate *priv = impl->priv; + GdkRectangle rect; + GtkTreeSelection *selection; + GtkTreeModel *model; + GList *list; + GtkTreePath *path; + + + file_list_update_popover (impl); ++ gtk_menu_popup_at_pointer(GTK_MENU(priv->browse_files_popover), NULL); ++ return; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->browse_files_tree_view)); + list = gtk_tree_selection_get_selected_rows (selection, &model); + if (list) + { + path = list->data; + gtk_tree_view_get_cell_area (GTK_TREE_VIEW (priv->browse_files_tree_view), path, NULL, &rect); + gtk_tree_view_convert_bin_window_to_widget_coords (GTK_TREE_VIEW (priv->browse_files_tree_view), + rect.x, rect.y, &rect.x, &rect.y); + diff --git a/p__other__menubutton-menu.patch b/p__popovers__menu-button.patch similarity index 100% rename from p__other__menubutton-menu.patch rename to p__popovers__menu-button.patch diff --git a/p__popovers__places-sidebar.patch b/p__popovers__places-sidebar.patch new file mode 100644 index 0000000..f376326 --- /dev/null +++ b/p__popovers__places-sidebar.patch @@ -0,0 +1,252 @@ +diff -U 10 -r -Z -B ./org/gtk/gtkplacessidebar.c ./mod/gtk/gtkplacessidebar.c +--- ./org/gtk/gtkplacessidebar.c 2017-06-20 21:16:19.000000000 +0200 ++++ ./mod/gtk/gtkplacessidebar.c 2017-07-10 21:59:25.193790547 +0200 +@@ -52,20 +52,21 @@ + #include "gtkbutton.h" + #include "gtklistbox.h" + #include "gtkselection.h" + #include "gtkdragdest.h" + #include "gtkdnd.h" + #include "gtkseparator.h" + #include "gtkentry.h" + #include "gtkgesturelongpress.h" + #include "gtkbox.h" + #include "gtkmodelbutton.h" ++#include "deprecated/gtkimagemenuitem.h" + + /** + * SECTION:gtkplacessidebar + * @Short_description: Sidebar that displays frequently-used places in the file system + * @Title: GtkPlacesSidebar + * @See_also: #GtkFileChooser + * + * #GtkPlacesSidebar is a widget that displays a list of frequently-used places in the + * file system: the user’s home directory, the user’s bookmarks, and volumes and drives. + * This widget is used as a sidebar in #GtkFileChooser and may be used by file managers +@@ -2137,46 +2138,46 @@ + + gtk_widget_set_visible (data->separator_item, show_mount || show_unmount || show_eject); + gtk_widget_set_visible (data->mount_item, show_mount); + gtk_widget_set_visible (data->unmount_item, show_unmount); + gtk_widget_set_visible (data->eject_item, show_eject); + gtk_widget_set_visible (data->rescan_item, show_rescan); + gtk_widget_set_visible (data->start_item, show_start); + gtk_widget_set_visible (data->stop_item, show_stop); + + /* Adjust start/stop items to reflect the type of the drive */ +- g_object_set (data->start_item, "text", _("_Start"), NULL); +- g_object_set (data->stop_item, "text", _("_Stop"), NULL); ++ g_object_set (data->start_item, "label", _("_Start"), "use_underline", TRUE, NULL); ++ g_object_set (data->stop_item, "label", _("_Stop"), "use_underline", TRUE, NULL); + if ((show_start || show_stop) && drive != NULL) + { + switch (g_drive_get_start_stop_type (drive)) + { + case G_DRIVE_START_STOP_TYPE_SHUTDOWN: + /* start() for type G_DRIVE_START_STOP_TYPE_SHUTDOWN is normally not used */ +- g_object_set (data->start_item, "text", _("_Power On"), NULL); +- g_object_set (data->stop_item, "text", _("_Safely Remove Drive"), NULL); ++ g_object_set (data->start_item, "label", _("_Power On"), "use_underline", TRUE, NULL); ++ g_object_set (data->stop_item, "label", _("_Safely Remove Drive"), "use_underline", TRUE, NULL); + break; + + case G_DRIVE_START_STOP_TYPE_NETWORK: +- g_object_set (data->start_item, "text", _("_Connect Drive"), NULL); +- g_object_set (data->stop_item, "text", _("_Disconnect Drive"), NULL); ++ g_object_set (data->start_item, "label", _("_Connect Drive"), "use_underline", TRUE, NULL); ++ g_object_set (data->stop_item, "label", _("_Disconnect Drive"), "use_underline", TRUE, NULL); + break; + + case G_DRIVE_START_STOP_TYPE_MULTIDISK: +- g_object_set (data->start_item, "text", _("_Start Multi-disk Device"), NULL); +- g_object_set (data->stop_item, "text", _("_Stop Multi-disk Device"), NULL); ++ g_object_set (data->start_item, "label", _("_Start Multi-disk Device"), "use_underline", TRUE, NULL); ++ g_object_set (data->stop_item, "label", _("_Stop Multi-disk Device"), "use_underline", TRUE, NULL); + break; + + case G_DRIVE_START_STOP_TYPE_PASSWORD: + /* stop() for type G_DRIVE_START_STOP_TYPE_PASSWORD is normally not used */ +- g_object_set (data->start_item, "text", _("_Unlock Device"), NULL); +- g_object_set (data->stop_item, "text", _("_Lock Device"), NULL); ++ g_object_set (data->start_item, "label", _("_Unlock Device"), "use_underline", TRUE, NULL); ++ g_object_set (data->stop_item, "label", _("_Lock Device"), "use_underline", TRUE, NULL); + break; + + default: + case G_DRIVE_START_STOP_TYPE_UNKNOWN: + /* uses defaults set above */ + break; + } + } + + if (drive) +@@ -3330,55 +3331,81 @@ + sidebar); + gtk_widget_insert_action_group (GTK_WIDGET (sidebar), "row", actions); + g_object_unref (actions); + } + + static GtkWidget * + append_separator (GtkWidget *box) + { + GtkWidget *separator; + ++ if (GTK_IS_MENU(box)) ++ { ++ separator = gtk_separator_menu_item_new(); ++ gtk_widget_set_visible(GTK_WIDGET(separator), TRUE); ++ gtk_menu_shell_append(GTK_MENU_SHELL(box), separator); ++ return separator; ++ } + separator = g_object_new (GTK_TYPE_SEPARATOR, + "orientation", GTK_ORIENTATION_HORIZONTAL, + "visible", TRUE, + "margin-top", 6, + "margin-bottom", 6, + NULL); + gtk_container_add (GTK_CONTAINER (box), separator); + + return separator; + } + + static GtkWidget * + add_button (GtkWidget *box, + const gchar *label, + const gchar *action) + { + GtkWidget *item; + ++ if (GTK_IS_MENU(box)) ++ { ++ item = gtk_image_menu_item_new_with_mnemonic(label); ++ g_object_set(G_OBJECT(item), "action-name", action, NULL); ++ gtk_widget_set_visible(GTK_WIDGET(item), TRUE); ++ gtk_menu_shell_append(GTK_MENU_SHELL(box), item); ++ return item; ++ } + item = g_object_new (GTK_TYPE_MODEL_BUTTON, + "visible", TRUE, + "action-name", action, + "text", label, + NULL); + gtk_container_add (GTK_CONTAINER (box), item); + + return item; + } + + static GtkWidget * + add_open_button (GtkWidget *box, + const gchar *label, + GtkPlacesOpenFlags flags) + { + GtkWidget *item; + ++ if (GTK_IS_MENU(box)) ++ { ++ item = gtk_image_menu_item_new_with_mnemonic(label); ++ g_object_set(G_OBJECT(item), ++ "action-name", flags == GTK_PLACES_OPEN_NORMAL ? "row.open" : "row.open-other", ++ "action-target", g_variant_new_int32 (flags), ++ NULL); ++ gtk_widget_set_visible(GTK_WIDGET(item), TRUE); ++ gtk_menu_shell_append(GTK_MENU_SHELL(box), item); ++ return item; ++ } + item = g_object_new (GTK_TYPE_MODEL_BUTTON, + "visible", TRUE, + "action-name", flags == GTK_PLACES_OPEN_NORMAL ? "row.open" : "row.open-other", + "action-target", g_variant_new_int32 (flags), + "text", label, + NULL); + gtk_container_add (GTK_CONTAINER (box), item); + + return item; + } +@@ -3401,20 +3428,27 @@ + + sidebar->popover = gtk_popover_new (GTK_WIDGET (sidebar)); + /* Clean sidebar pointer when its destroyed, most of the times due to its + * relative_to associated row being destroyed */ + g_signal_connect (sidebar->popover, "destroy", G_CALLBACK (on_row_popover_destroy), sidebar); + setup_popover_shadowing (sidebar->popover); + box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + g_object_set (box, "margin", 10, NULL); + gtk_widget_show (box); + gtk_container_add (GTK_CONTAINER (sidebar->popover), box); ++ if (!sidebar->populate_all) ++ { ++ sidebar->popover = gtk_menu_new(); ++ g_signal_connect (sidebar->popover, "destroy", G_CALLBACK (on_row_popover_destroy), sidebar); ++ gtk_menu_attach_to_widget(GTK_MENU(sidebar->popover), GTK_WIDGET(sidebar), NULL); ++ box = sidebar->popover; ++ } + + add_open_button (box, _("_Open"), GTK_PLACES_OPEN_NORMAL); + + if (sidebar->open_flags & GTK_PLACES_OPEN_NEW_TAB) + add_open_button (box, _("Open in New _Tab"), GTK_PLACES_OPEN_NEW_TAB); + + if (sidebar->open_flags & GTK_PLACES_OPEN_NEW_WINDOW) + add_open_button (box, _("Open in New _Window"), GTK_PLACES_OPEN_NEW_WINDOW); + + append_separator (box); +@@ -3424,20 +3458,31 @@ + data.rename_item = add_button (box, _("Rename…"), "row.rename"); + + data.separator_item = append_separator (box); + + data.mount_item = add_button (box, _("_Mount"), "row.mount"); + data.unmount_item = add_button (box, _("_Unmount"), "row.unmount"); + data.eject_item = add_button (box, _("_Eject"), "row.eject"); + data.rescan_item = add_button (box, _("_Detect Media"), "row.rescan"); + data.start_item = add_button (box, _("_Start"), "row.start"); + data.stop_item = add_button (box, _("_Stop"), "row.stop"); ++ if (!sidebar->populate_all) ++ { ++ g_object_set( ++ g_list_first(gtk_container_get_children(GTK_CONTAINER(box)))->data, ++ "image", gtk_image_new_from_icon_name("gtk-open",GTK_ICON_SIZE_MENU), NULL ++ ); ++ g_object_set(data.rename_item, "image", gtk_image_new_from_icon_name("gtk-edit",GTK_ICON_SIZE_MENU), NULL); ++ g_object_set(data.remove_item, "image", gtk_image_new_from_icon_name("gtk-remove",GTK_ICON_SIZE_MENU), NULL); ++ g_object_set(data.add_shortcut_item, "image", gtk_image_new_from_icon_name("bookmark-new",GTK_ICON_SIZE_MENU), NULL); ++ g_object_set(data.eject_item, "image", gtk_image_new_from_icon_name("media-eject",GTK_ICON_SIZE_MENU), NULL); ++ } + + /* Update everything! */ + check_popover_sensitivity (row, &data); + + if (sidebar->populate_all) + { + gchar *uri; + GVolume *volume; + GFile *file; + +@@ -3467,20 +3512,27 @@ + show_row_popover (GtkSidebarRow *row) + { + GtkPlacesSidebar *sidebar; + + g_object_get (row, "sidebar", &sidebar, NULL); + + if (sidebar->popover) + gtk_widget_destroy (sidebar->popover); + + create_row_popover (sidebar, row); ++ if (GTK_IS_MENU(sidebar->popover)) ++ { ++ sidebar->context_row = row; ++ gtk_menu_popup_at_pointer(GTK_MENU(sidebar->popover), NULL); ++ g_object_unref (sidebar); ++ return; ++ } + + gtk_popover_set_relative_to (GTK_POPOVER (sidebar->popover), GTK_WIDGET (row)); + + sidebar->context_row = row; + gtk_popover_popup (GTK_POPOVER (sidebar->popover)); + + g_object_unref (sidebar); + } + + static void