diff options
Diffstat (limited to 'appearance__buttons-menus-icons.patch')
-rw-r--r-- | appearance__buttons-menus-icons.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/appearance__buttons-menus-icons.patch b/appearance__buttons-menus-icons.patch new file mode 100644 index 000000000000..7d2c9b2a9998 --- /dev/null +++ b/appearance__buttons-menus-icons.patch @@ -0,0 +1,59 @@ +diff '--color=auto' -U 5 -r -Z -B ./org/gtk/gtkbutton.c ./mod/gtk/gtkbutton.c +--- ./org/gtk/gtkbutton.c 2017-08-22 12:22:29.000000000 +0200 ++++ ./mod/gtk/gtkbutton.c 2017-09-20 00:38:05.204450429 +0200 +@@ -2160,10 +2160,30 @@ + gchar *new_label; + + g_return_if_fail (GTK_IS_BUTTON (button)); + + priv = button->priv; ++ if (priv->image == NULL) { ++ gchar *use_this_icon = NULL; ++ if (g_strcmp0( label, _("_Select") ) == 0 || g_strcmp0( label, _("_OK") ) == 0) use_this_icon = "gtk-ok"; ++ else if (g_strcmp0( label, _("_Cancel") ) == 0) use_this_icon = "gtk-cancel"; ++ else if (g_strcmp0( label, _("_Close") ) == 0) use_this_icon = "gtk-close"; ++ else if (g_strcmp0( label, _("_Yes") ) == 0) use_this_icon = "gtk-yes"; ++ else if (g_strcmp0( label, _("_No") ) == 0) use_this_icon = "gtk-no"; ++ else if (g_strcmp0( label, _("_Print") ) == 0) use_this_icon = "gtk-print"; ++ else if (g_strcmp0( label, _("Pre_view") ) == 0) use_this_icon = "gtk-print-preview"; ++ else if (g_strcmp0( label, _("_Open") ) == 0) use_this_icon = "gtk-open"; ++ else if (g_strcmp0( label, _("_Save") ) == 0) use_this_icon = "gtk-save"; ++ else if (g_strcmp0( label, _("_Apply") ) == 0) use_this_icon = "gtk-apply"; ++ else if (g_strcmp0( label, _("_Stop") ) == 0) use_this_icon = "gtk-stop"; ++ else if (g_strcmp0( label, _("_Delete") ) == 0) use_this_icon = "gtk-delete"; ++ else if (g_strcmp0( label, _("_Remove") ) == 0) use_this_icon = "gtk-remove"; ++ 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) ++ g_object_set(button, "image", gtk_image_new_from_icon_name(use_this_icon, GTK_ICON_SIZE_BUTTON), NULL); ++ } + + new_label = g_strdup (label); + g_free (priv->label_text); + priv->label_text = new_label; + +diff '--color=auto' -U 5 -r -Z -B ./org/gtk/gtkmenuitem.c ./mod/gtk/gtkmenuitem.c +--- ./org/gtk/gtkmenuitem.c 2017-08-11 21:47:18.000000000 +0200 ++++ ./mod/gtk/gtkmenuitem.c 2017-09-19 20:17:55.937010353 +0200 +@@ -1006,10 +1006,21 @@ + * Returns: a new #GtkMenuItem + */ + GtkWidget* + gtk_menu_item_new_with_mnemonic (const gchar *label) + { ++ gchar *use_this_icon = NULL; ++ if (g_strcmp0( label, _("Copy _Link Address") ) == 0 || g_strcmp0( label, _("_Copy") ) == 0 ++ || g_strcmp0( label, _("Copy URL") ) == 0) use_this_icon = "gtk-copy"; ++ else if (g_strcmp0( label, _("Cu_t") ) == 0) use_this_icon = "gtk-cut"; ++ else if (g_strcmp0( label, _("_Paste") ) == 0) use_this_icon = "gtk-paste"; ++ else if (g_strcmp0( label, _("_Delete") ) == 0) use_this_icon = "gtk-delete"; ++ 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) ++ return g_object_new(GTK_TYPE_IMAGE_MENU_ITEM, "use-underline", TRUE, "label", label, ++ "image", gtk_image_new_from_icon_name(use_this_icon,GTK_ICON_SIZE_MENU), NULL); + return g_object_new (GTK_TYPE_MENU_ITEM, + "use-underline", TRUE, + "label", label, + NULL); + } |