diff options
author | Tomasz Gąsior | 2017-07-30 21:43:53 +0200 |
---|---|---|
committer | Tomasz Gąsior | 2017-07-30 21:48:28 +0200 |
commit | cffdd3e7a3e9fc41e676ed4c8cf4d35dd6b4bcc4 (patch) | |
tree | e05e15abc999038ccfd98e6849e52e952daac3e7 /popovers__places-sidebar.patch | |
parent | a6054beb52f10ac378ca008a44624b71cfdaabc3 (diff) | |
download | aur-cffdd3e7a3e9fc41e676ed4c8cf4d35dd6b4bcc4.tar.gz |
A lot of changes.
- Added ability to enable CSDs by GTK_CSD=0 or GTK_CSD=1 environment variable.
- Changed icons of context menus in file chooser dialog to match old GTK2 file chooser and Caja places sidebar (because Caja is a fork of old Nautilus).
- Disabled integration with GNOME assistive technologies by default to avoid errors in console output.
- Structure of PKGBUILD and paches refactored.
- gtk3-widget-factory application restored.
- Files of original ArchLinux GTK3 package moved away.
Diffstat (limited to 'popovers__places-sidebar.patch')
-rw-r--r-- | popovers__places-sidebar.patch | 177 |
1 files changed, 177 insertions, 0 deletions
diff --git a/popovers__places-sidebar.patch b/popovers__places-sidebar.patch new file mode 100644 index 000000000000..7a956e1f46fa --- /dev/null +++ b/popovers__places-sidebar.patch @@ -0,0 +1,177 @@ +diff -U 5 -r -Z -B ./org/gtk/gtkplacessidebar.c ./mod/gtk/gtkplacessidebar.c +--- ./org/gtk/gtkplacessidebar.c 2017-07-19 04:55:39.000000000 +0200 ++++ ./mod/gtk/gtkplacessidebar.c 2017-07-30 18:32:50.010014344 +0200 +@@ -57,10 +57,11 @@ + #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 +@@ -2142,36 +2143,36 @@ + 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 */ +@@ -3335,10 +3336,17 @@ + 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, +@@ -3353,10 +3361,18 @@ + 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); +@@ -3370,10 +3386,21 @@ + 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, +@@ -3406,10 +3433,17 @@ + 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); +@@ -3429,10 +3463,19 @@ + 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.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("gtk-add",GTK_ICON_SIZE_MENU), NULL); ++ } + + /* Update everything! */ + check_popover_sensitivity (row, &data); + + if (sidebar->populate_all) +@@ -3472,10 +3515,17 @@ + + 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)); |