aboutsummarylogtreecommitdiffstats
path: root/p__icons__buttons.patch
diff options
context:
space:
mode:
Diffstat (limited to 'p__icons__buttons.patch')
-rw-r--r--p__icons__buttons.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/p__icons__buttons.patch b/p__icons__buttons.patch
new file mode 100644
index 000000000000..bbd3a3015f5a
--- /dev/null
+++ b/p__icons__buttons.patch
@@ -0,0 +1,45 @@
+diff -U 10 -r -Z -B ./org/gtk/gtkbutton.c ./mod/gtk/gtkbutton.c
+--- ./org/gtk/gtkbutton.c 2017-05-11 21:09:33.000000000 +0200
++++ ./mod/gtk/gtkbutton.c 2017-06-18 20:08:57.103620097 +0200
+@@ -2164,20 +2164,41 @@
+ */
+ void
+ gtk_button_set_label (GtkButton *button,
+ const gchar *label)
+ {
+ GtkButtonPrivate *priv;
+ gchar *new_label;
+
+ g_return_if_fail (GTK_IS_BUTTON (button));
+
++ if (!gtk_button_get_image(GTK_BUTTON(button))) {
++ 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)
++ gtk_button_set_image(GTK_BUTTON(button), gtk_image_new_from_icon_name(use_this_icon,GTK_ICON_SIZE_BUTTON));
++ }
++
+ priv = button->priv;
+
+ new_label = g_strdup (label);
+ g_free (priv->label_text);
+ priv->label_text = new_label;
+
+ gtk_button_construct_child (button);
+
+ g_object_notify_by_pspec (G_OBJECT (button), props[PROP_LABEL]);
+ }