Package: eog / 3.20.5-1

0001-Add-a-traditional-menu-bar.patch Patch series | download
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
From b7cf1b9c79f6c547ac8daec82d3fa851ceec839d Mon Sep 17 00:00:00 2001
From: Lars Uebernickel <lars.uebernickel@canonical.com>
Date: Fri, 25 Sep 2015 10:27:24 +0200
Subject: [PATCH 1/2] Add a traditional menu bar
Bug: https://bugzilla.gnome.org/749976
Bug-Debian: https://bugs.debian.org/793445

---
 data/eog-menubar.xml  | 205 ++++++++++++++++++++++++++++++++++++++++++++++++++
 src/eog-application.c |  39 +++++++---
 src/eog-window.c      |  44 ++++++-----
 src/eog.gresource.xml |   1 +
 4 files changed, 259 insertions(+), 30 deletions(-)
 create mode 100644 data/eog-menubar.xml

Index: b/data/eog-menubar.xml
===================================================================
--- /dev/null
+++ b/data/eog-menubar.xml
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="utf-8"?>
+<interface>
+  <menu id="menubar">
+    <submenu>
+      <attribute name="label" translatable="yes">_Image</attribute>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">_Open…</attribute>
+          <attribute name="action">win.open</attribute>
+          <attribute name="accel">&lt;Ctrl&gt;o</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">_Save</attribute>
+          <attribute name="action">win.save</attribute>
+          <attribute name="accel">&lt;Ctrl&gt;s</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">_Save As…</attribute>
+          <attribute name="action">win.save-as</attribute>
+          <attribute name="accel">&lt;Ctrl&gt;&lt;Shift&gt;s</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">Print…</attribute>
+          <attribute name="action">win.print</attribute>
+          <attribute name="accel">&lt;Ctrl&gt;p</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">Set as _Wallpaper</attribute>
+          <attribute name="action">win.set-wallpaper</attribute>
+          <attribute name="accel">&lt;Ctrl&gt;F8</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">Show Containing _Folder</attribute>
+          <attribute name="action">win.open-folder</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">Image Properties</attribute>
+          <attribute name="action">win.properties</attribute>
+          <attribute name="accel">&lt;Alt&gt;Return</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">_Close</attribute>
+          <attribute name="action">win.close</attribute>
+          <attribute name="accel">&lt;Ctrl&gt;w</attribute>
+        </item>
+      </section>
+    </submenu>
+    <submenu>
+      <attribute name="label" translatable="yes">_Edit</attribute>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">_Undo</attribute>
+          <attribute name="action">win.undo</attribute>
+          <attribute name="accel">&lt;Ctrl&gt;z</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">_Copy Image</attribute>
+          <attribute name="action">win.copy</attribute>
+          <attribute name="accel">&lt;Ctrl&gt;c</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">Flip _Horizontal</attribute>
+          <attribute name="action">win.flip-horizontal</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">Flip _Vertical</attribute>
+          <attribute name="action">win.flip-vertical</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">_Rotate Clockwise</attribute>
+          <attribute name="action">win.rotate-90</attribute>
+          <attribute name="accel">&lt;Ctrl&gt;r</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">Rotate Counter_clockwise</attribute>
+          <attribute name="action">win.rotate-270</attribute>
+          <attribute name="accel">&lt;Ctrl&gt;&lt;Shift&gt;r</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">Move to _Trash</attribute>
+          <attribute name="action">win.move-trash</attribute>
+          <attribute name="accel">Delete</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">_Delete</attribute>
+          <attribute name="action">win.delete</attribute>
+          <attribute name="accel">&lt;Shift&gt;Delete</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">_Preferences</attribute>
+          <attribute name="action">app.preferences</attribute>
+        </item>
+      </section>
+    </submenu>
+    <submenu>
+      <attribute name="label" translatable="yes">_View</attribute>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">_Statusbar</attribute>
+          <attribute name="action">win.view-statusbar</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">_Image Gallery</attribute>
+          <attribute name="action">win.view-gallery</attribute>
+          <attribute name="accel">F9</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">Side _Pane</attribute>
+          <attribute name="action">win.view-sidebar</attribute>
+          <attribute name="accel">&lt;Ctrl&gt;F9</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">Zoom _In</attribute>
+          <attribute name="action">win.zoom-in</attribute>
+          <attribute name="accel">&lt;Ctrl&gt;plus</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">Zoom _Out</attribute>
+          <attribute name="action">win.zoom-out</attribute>
+          <attribute name="accel">&lt;Ctrl&gt;minus</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">_Best Fit</attribute>
+          <attribute name="action">win.toggle-zoom-fit</attribute>
+          <attribute name="accel">F</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">_Fullscreen</attribute>
+          <attribute name="action">win.view-fullscreen</attribute>
+          <attribute name="accel">F11</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">Slide Show</attribute>
+          <attribute name="action">win.view-slideshow</attribute>
+          <attribute name="accel">F5</attribute>
+        </item>
+      </section>
+    </submenu>
+    <submenu>
+      <attribute name="label" translatable="yes">_Go</attribute>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">_Previous Image</attribute>
+          <attribute name="action">win.go-previous</attribute>
+          <attribute name="accel">Left</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">_Next Image</attribute>
+          <attribute name="action">win.go-next</attribute>
+          <attribute name="accel">Right</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">_First Image</attribute>
+          <attribute name="action">win.go-first</attribute>
+          <attribute name="accel">&lt;Alt&gt;Home</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">_Last Image</attribute>
+          <attribute name="action">win.go-last</attribute>
+          <attribute name="accel">&lt;Alt&gt;End</attribute>
+        </item>
+      </section>
+    </submenu>
+    <submenu>
+      <attribute name="label" translatable="yes">_Help</attribute>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">_Contents</attribute>
+          <attribute name="action">win.manual</attribute>
+          <attribute name="accel">F1</attribute>
+        </item>
+        <item>
+          <attribute name="action">win.show-help-overlay</attribute>
+          <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">_About</attribute>
+          <attribute name="action">app.about</attribute>
+        </item>
+      </section>
+    </submenu>
+  </menu>
+</interface>
Index: b/src/eog-window.c
===================================================================
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -4332,23 +4332,36 @@
 			   priv->zoom_scale);
 	gtk_widget_show (priv->zoom_scale);
 
-	menu_button = gtk_menu_button_new ();
-	menu_image = gtk_image_new_from_icon_name ("open-menu-symbolic",
-						   GTK_ICON_SIZE_BUTTON);
-	gtk_button_set_image (GTK_BUTTON (menu_button), menu_image);
-
-	builder = gtk_builder_new_from_resource ("/org/gnome/eog/ui/eog-gear-menu.ui");
-	builder_object = gtk_builder_get_object (builder, "gear-menu");
-	gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button),
-					G_MENU_MODEL (builder_object));
-
-	gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), menu_button);
-	gtk_widget_show (menu_button);
-
-	action = G_ACTION (g_property_action_new ("toggle-gear-menu",
-						  menu_button, "active"));
-	g_action_map_add_action (G_ACTION_MAP (window), action);
-	g_object_unref (action);
+	priv->open_with_menu = g_menu_new ();
+	priv->appinfo = g_ptr_array_new_with_free_func (g_object_unref);
+
+	if (gtk_application_prefers_app_menu (GTK_APPLICATION (EOG_APP))) {
+		menu_button = gtk_menu_button_new ();
+		menu_image = gtk_image_new_from_icon_name ("open-menu-symbolic",
+							   GTK_ICON_SIZE_BUTTON);
+		gtk_button_set_image (GTK_BUTTON (menu_button), menu_image);
+
+		builder = gtk_builder_new_from_resource ("/org/gnome/eog/ui/eog-gear-menu.ui");
+		builder_object = gtk_builder_get_object (builder, "gear-menu");
+		gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button),
+						G_MENU_MODEL (builder_object));
+
+		gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), menu_button);
+		gtk_widget_show (menu_button);
+
+		builder_object = gtk_builder_get_object (builder, "open-with-menu");
+		g_menu_append_section (G_MENU (builder_object),
+				       NULL,
+				       G_MENU_MODEL (priv->open_with_menu));
+		priv->gear_menu_builder = builder;
+		builder = NULL;
+
+		action = G_ACTION (g_property_action_new ("toggle-gear-menu",
+							  menu_button, "active"));
+		g_action_map_add_action (G_ACTION_MAP (window), action);
+		g_object_unref (action);
+
+	}
 
 	fullscreen_button = gtk_button_new_from_icon_name ("view-fullscreen-symbolic",
 							   GTK_ICON_SIZE_BUTTON);
@@ -4359,15 +4372,6 @@
 	gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), fullscreen_button);
 	gtk_widget_show (fullscreen_button);
 
-	priv->open_with_menu = g_menu_new ();
-	priv->appinfo = g_ptr_array_new_with_free_func (g_object_unref);
-	builder_object = gtk_builder_get_object (builder, "open-with-menu");
-	g_menu_append_section (G_MENU (builder_object),
-			       NULL,
-			       G_MENU_MODEL (priv->open_with_menu));
-	priv->gear_menu_builder = builder;
-	builder = NULL;
-
 	priv->cbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
 	gtk_box_pack_start (GTK_BOX (priv->box), priv->cbox, TRUE, TRUE, 0);
 	gtk_widget_show (priv->cbox);
@@ -5307,6 +5311,9 @@
 	GObject *object;
 	g_return_val_if_fail (EOG_IS_WINDOW (window), NULL);
 
+	if (window->priv->gear_menu_builder == NULL)
+		return NULL;
+
 	object = gtk_builder_get_object (window->priv->gear_menu_builder, id);
 	if (object == NULL || !G_IS_MENU (object))
 		return NULL;
Index: b/src/eog.gresource.xml
===================================================================
--- a/src/eog.gresource.xml
+++ b/src/eog.gresource.xml
@@ -13,6 +13,7 @@
   </gresource>
   <gresource prefix="/org/gnome/eog/gtk">
     <file alias="menus.ui" compressed="true" preprocess="xml-stripblanks">eog-app-menu.xml</file>
+    <file alias="menus-traditional.ui" compressed="true" preprocess="xml-stripblanks">eog-menubar.xml</file>
     <file compressed="true" preprocess="xml-stripblanks">help-overlay.ui</file>
   </gresource>
 </gresources>
Index: b/po/POTFILES.in
===================================================================
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,7 @@
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
 [encoding: UTF-8]
+[type: gettext/glade]data/eog-menubar.xml
 [type: gettext/glade]data/eog-app-menu.xml
 data/eog.appdata.xml.in
 data/eog.desktop.in.in