-
Notifications
You must be signed in to change notification settings - Fork 24
/
appearance__buttons-menus-icons.patch
57 lines (55 loc) · 3.13 KB
/
appearance__buttons-menus-icons.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Index: b/gtk/gtkbutton.c
===================================================================
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -2164,6 +2164,27 @@ gtk_button_set_label (GtkButton *butto
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 = "document-print";
+ else if (g_strcmp0 (label, _("Pre_view")) == 0) use_this_icon = "document-print-preview";
+ else if (g_strcmp0 (label, _("_Open")) == 0) use_this_icon = "document-open";
+ else if (g_strcmp0 (label, _("_Save")) == 0) use_this_icon = "document-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 = "edit-delete";
+ else if (g_strcmp0 (label, _("_Remove")) == 0) use_this_icon = "list-remove";
+ else if (g_strcmp0 (label, _("_Add")) == 0) use_this_icon = "list-add";
+ else if (g_strcmp0 (label, _("_Help")) == 0) use_this_icon = "help-contents";
+ 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);
Index: b/gtk/gtkmenuitem.c
===================================================================
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -1010,6 +1010,20 @@ gtk_menu_item_new_with_label (const gcha
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 = "edit-copy";
+ else if (g_strcmp0 (label, _("Cu_t")) == 0) use_this_icon = "edit-cut";
+ else if (g_strcmp0 (label, _("_Paste")) == 0) use_this_icon = "edit-paste";
+ else if (g_strcmp0 (label, _("_Delete")) == 0) use_this_icon = "edit-delete";
+ else if (g_strcmp0 (label, _("Select _All")) == 0) use_this_icon = "edit-select-all";
+ else if (g_strcmp0 (label, _("_Open Link")) == 0) use_this_icon = "go-jump";
+ 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,