aboutsummarylogtreecommitdiffstats
path: root/p__icons__context-menus.patch
blob: 33f2c74a22276854be1c7d0a5fa2e59b99b24261 (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
diff -U 10 -r -Z -B ./org/gtk/deprecated/gtkimagemenuitem.c ./mod/gtk/deprecated/gtkimagemenuitem.c
--- ./org/gtk/deprecated/gtkimagemenuitem.c	2017-06-20 21:16:19.000000000 +0200
+++ ./mod/gtk/deprecated/gtkimagemenuitem.c	2017-07-02 23:02:26.387051500 +0200
@@ -484,20 +484,33 @@
     (gtk_image_menu_item_parent_class)->set_label (GTK_MENU_ITEM (image_menu_item), resolved_label);
 
 }
 
 static void
 gtk_image_menu_item_set_label (GtkMenuItem      *menu_item,
                                const gchar      *label)
 {
   GtkImageMenuItemPrivate *priv = GTK_IMAGE_MENU_ITEM (menu_item)->priv;
 
+  if (!gtk_image_menu_item_get_image(GTK_IMAGE_MENU_ITEM(menu_item))) {
+    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)
+      g_object_set(menu_item, "image", gtk_image_new_from_icon_name(use_this_icon,GTK_ICON_SIZE_MENU), NULL);
+  }
+
   if (priv->label != label)
     {
       g_free (priv->label);
       priv->label = g_strdup (label);
 
       gtk_image_menu_item_recalculate (GTK_IMAGE_MENU_ITEM (menu_item));
 
       g_object_notify (G_OBJECT (menu_item), "label");
 
     }
diff -U 10 -r -Z -B ./org/gtk/gtkentry.c ./mod/gtk/gtkentry.c
--- ./org/gtk/gtkentry.c	2017-06-20 21:16:19.000000000 +0200
+++ ./mod/gtk/gtkentry.c	2017-07-02 23:01:01.360380621 +0200
@@ -9442,21 +9442,21 @@
     }
 }
 
 static void
 append_action_signal (GtkEntry     *entry,
 		      GtkWidget    *menu,
 		      const gchar  *label,
 		      const gchar  *signal,
                       gboolean      sensitive)
 {
-  GtkWidget *menuitem = gtk_menu_item_new_with_mnemonic (label);
+  GtkWidget *menuitem = gtk_image_menu_item_new_with_mnemonic (label);
 
   g_object_set_qdata (G_OBJECT (menuitem), quark_gtk_signal, (char *)signal);
   g_signal_connect (menuitem, "activate",
 		    G_CALLBACK (activate_cb), entry);
 
   gtk_widget_set_sensitive (menuitem, sensitive);
   
   gtk_widget_show (menuitem);
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
 }
@@ -9509,32 +9509,32 @@
                             info_entry_priv->editable && mode == DISPLAY_NORMAL &&
                             info_entry_priv->current_pos != info_entry_priv->selection_bound);
 
       append_action_signal (entry, menu, _("_Copy"), "copy-clipboard",
                             mode == DISPLAY_NORMAL &&
                             info_entry_priv->current_pos != info_entry_priv->selection_bound);
 
       append_action_signal (entry, menu, _("_Paste"), "paste-clipboard",
                             info_entry_priv->editable && clipboard_contains_text);
 
-      menuitem = gtk_menu_item_new_with_mnemonic (_("_Delete"));
+      menuitem = gtk_image_menu_item_new_with_mnemonic (_("_Delete"));
       gtk_widget_set_sensitive (menuitem, info_entry_priv->editable && info_entry_priv->current_pos != info_entry_priv->selection_bound);
       g_signal_connect_swapped (menuitem, "activate",
                                 G_CALLBACK (gtk_entry_delete_cb), entry);
       gtk_widget_show (menuitem);
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
 
       menuitem = gtk_separator_menu_item_new ();
       gtk_widget_show (menuitem);
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
 
-      menuitem = gtk_menu_item_new_with_mnemonic (_("Select _All"));
+      menuitem = gtk_image_menu_item_new_with_mnemonic (_("Select _All"));
       gtk_widget_set_sensitive (menuitem, gtk_entry_buffer_get_length (info_entry_priv->buffer) > 0);
       g_signal_connect_swapped (menuitem, "activate",
                                 G_CALLBACK (gtk_entry_select_all), entry);
       gtk_widget_show (menuitem);
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
 
       g_signal_emit (entry, signals[POPULATE_POPUP], 0, menu);
 
       if (info->trigger_event && gdk_event_triggers_context_menu (info->trigger_event))
         gtk_menu_popup_at_pointer (GTK_MENU (menu), info->trigger_event);
diff -U 10 -r -Z -B ./org/gtk/gtklabel.c ./mod/gtk/gtklabel.c
--- ./org/gtk/gtklabel.c	2017-06-20 21:16:19.000000000 +0200
+++ ./mod/gtk/gtklabel.c	2017-07-02 23:01:43.213716028 +0200
@@ -6542,21 +6542,21 @@
   g_signal_emit_by_name (label, signal);
 }
 
 static void
 append_action_signal (GtkLabel     *label,
 		      GtkWidget    *menu,
 		      const gchar  *text,
 		      const gchar  *signal,
                       gboolean      sensitive)
 {
-  GtkWidget *menuitem = gtk_menu_item_new_with_mnemonic (text);
+  GtkWidget *menuitem = gtk_image_menu_item_new_with_mnemonic (text);
 
   g_object_set_qdata (G_OBJECT (menuitem), quark_gtk_signal, (char *)signal);
   g_signal_connect (menuitem, "activate",
 		    G_CALLBACK (activate_cb), label);
 
   gtk_widget_set_sensitive (menuitem, sensitive);
   
   gtk_widget_show (menuitem);
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
 }
@@ -6633,53 +6633,53 @@
         link = priv->select_info->active_link;
       else
         link = NULL;
     }
   else
     link = gtk_label_get_focus_link (label);
 
   if (!have_selection && link)
     {
       /* Open Link */
-      menuitem = gtk_menu_item_new_with_mnemonic (_("_Open Link"));
+      menuitem = gtk_image_menu_item_new_with_mnemonic (_("_Open Link"));
       g_object_set_qdata (G_OBJECT (menuitem), quark_link, link);
       gtk_widget_show (menuitem);
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
 
       g_signal_connect (G_OBJECT (menuitem), "activate",
                         G_CALLBACK (open_link_activate_cb), label);
 
       /* Copy Link Address */
-      menuitem = gtk_menu_item_new_with_mnemonic (_("Copy _Link Address"));
+      menuitem = gtk_image_menu_item_new_with_mnemonic (_("Copy _Link Address"));
       g_object_set_qdata (G_OBJECT (menuitem), quark_link, link);
       gtk_widget_show (menuitem);
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
 
       g_signal_connect (G_OBJECT (menuitem), "activate",
                         G_CALLBACK (copy_link_activate_cb), label);
     }
   else
     {
       append_action_signal (label, menu, _("Cu_t"), "cut-clipboard", FALSE);
       append_action_signal (label, menu, _("_Copy"), "copy-clipboard", have_selection);
       append_action_signal (label, menu, _("_Paste"), "paste-clipboard", FALSE);
   
-      menuitem = gtk_menu_item_new_with_mnemonic (_("_Delete"));
+      menuitem = gtk_image_menu_item_new_with_mnemonic (_("_Delete"));
       gtk_widget_set_sensitive (menuitem, FALSE);
       gtk_widget_show (menuitem);
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
 
       menuitem = gtk_separator_menu_item_new ();
       gtk_widget_show (menuitem);
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
 
-      menuitem = gtk_menu_item_new_with_mnemonic (_("Select _All"));
+      menuitem = gtk_image_menu_item_new_with_mnemonic (_("Select _All"));
       g_signal_connect_swapped (menuitem, "activate",
 			        G_CALLBACK (gtk_label_select_all), label);
       gtk_widget_show (menuitem);
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
     }
 
   g_signal_emit (label, signals[POPULATE_POPUP], 0, menu);
 
   if (event && gdk_event_triggers_context_menu (event))
     gtk_menu_popup_at_pointer (GTK_MENU (menu), event);
diff -U 10 -r -Z -B ./org/gtk/gtklinkbutton.c ./mod/gtk/gtklinkbutton.c
--- ./org/gtk/gtklinkbutton.c	2017-06-20 21:16:19.000000000 +0200
+++ ./mod/gtk/gtklinkbutton.c	2017-07-02 23:01:28.883715318 +0200
@@ -360,21 +360,21 @@
 	gtk_widget_destroy (priv->popup_menu);
 
       priv->popup_menu = gtk_menu_new ();
       gtk_style_context_add_class (gtk_widget_get_style_context (priv->popup_menu),
                                    GTK_STYLE_CLASS_CONTEXT_MENU);
 
       gtk_menu_attach_to_widget (GTK_MENU (priv->popup_menu),
 		      		 GTK_WIDGET (link_button),
 				 popup_menu_detach);
 
-      menu_item = gtk_menu_item_new_with_mnemonic (_("Copy URL"));
+      menu_item = gtk_image_menu_item_new_with_mnemonic (_("Copy URL"));
       g_signal_connect (menu_item, "activate",
 		        G_CALLBACK (copy_activate_cb), link_button);
       gtk_widget_show (menu_item);
       gtk_menu_shell_append (GTK_MENU_SHELL (priv->popup_menu), menu_item);
 
       if (event && gdk_event_triggers_context_menu (event))
         gtk_menu_popup_at_pointer (GTK_MENU (priv->popup_menu), event);
       else
         {
           gtk_menu_popup_at_widget (GTK_MENU (priv->popup_menu),