Merge lp:~larsu/eog/menubar into lp:~ubuntu-desktop/eog/ubuntu

Proposed by Lars Karlitski
Status: Merged
Merged at revision: 168
Proposed branch: lp:~larsu/eog/menubar
Merge into: lp:~ubuntu-desktop/eog/ubuntu
Diff against target: 750 lines (+513/-180)
8 files modified
debian/changelog (+8/-2)
debian/control (+2/-1)
debian/control.in (+2/-1)
debian/patches/0001-Add-a-traditional-menu-bar.patch (+360/-0)
debian/patches/0002-Show-traditional-title-bar-in-unity.patch (+139/-0)
debian/patches/disable-appmenu-when-not-needed.patch (+0/-33)
debian/patches/series (+2/-3)
debian/patches/unity_traditional_titlebar.patch (+0/-140)
To merge this branch: bzr merge lp:~larsu/eog/menubar
Reviewer Review Type Date Requested Status
Ubuntu Desktop Pending
Review via email: mp+272724@code.launchpad.net

Commit message

* Add debian/patches/0001-Add-a-traditional-menu-bar.patch
* Update debian/patches/0002-Show-traditional-title-bar-in-unity.patch:
  update to make work with menubar patch and use GActionGroup's signals

Description of the change

* Add debian/patches/0001-Add-a-traditional-menu-bar.patch
* Update debian/patches/0002-Show-traditional-title-bar-in-unity.patch:
  update to make work with menubar patch and use GActionGroup's signals

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2015-09-21 10:57:41 +0000
+++ debian/changelog 2015-09-29 10:38:28 +0000
@@ -1,8 +1,14 @@
1eog (3.16.3-1ubuntu2) UNRELEASED; urgency=medium1eog (3.16.3-1ubuntu4) UNRELEASED; urgency=medium
22
3 [ Iain Lane ]
3 * Make the toolbar hide in fullscreen.4 * Make the toolbar hide in fullscreen.
45
5 -- Iain Lane <iain.lane@canonical.com> Mon, 21 Sep 2015 11:53:13 +01006 [ Lars Uebernickel ]
7 * Add debian/patches/0001-Add-a-traditional-menu-bar.patch
8 * Update debian/patches/0002-Show-traditional-title-bar-in-unity.patch:
9 update to make work with menubar patch and use GActionGroup's signals
10
11 -- Lars Uebernickel <lars.uebernickel@ubuntu.com> Tue, 29 Sep 2015 12:30:46 +0200
612
7eog (3.16.3-1ubuntu1) wily; urgency=low13eog (3.16.3-1ubuntu1) wily; urgency=low
814
915
=== modified file 'debian/control'
--- debian/control 2015-09-21 10:53:08 +0000
+++ debian/control 2015-09-29 10:38:28 +0000
@@ -5,7 +5,8 @@
5Source: eog5Source: eog
6Section: gnome6Section: gnome
7Priority: optional7Priority: optional
8Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>8Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
9XSBC-Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
9Uploaders: Andreas Henriksson <andreas@fatal.se>, Iain Lane <laney@debian.org>, Michael Biebl <biebl@debian.org>, Sjoerd Simons <sjoerd@debian.org>10Uploaders: Andreas Henriksson <andreas@fatal.se>, Iain Lane <laney@debian.org>, Michael Biebl <biebl@debian.org>, Sjoerd Simons <sjoerd@debian.org>
10Standards-Version: 3.9.611Standards-Version: 3.9.6
11Homepage: https://wiki.gnome.org/Apps/EyeOfGnome12Homepage: https://wiki.gnome.org/Apps/EyeOfGnome
1213
=== modified file 'debian/control.in'
--- debian/control.in 2015-05-27 16:03:38 +0000
+++ debian/control.in 2015-09-29 10:38:28 +0000
@@ -1,7 +1,8 @@
1Source: eog1Source: eog
2Section: gnome2Section: gnome
3Priority: optional3Priority: optional
4Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
5Uploaders: @GNOME_TEAM@6Uploaders: @GNOME_TEAM@
6Standards-Version: 3.9.67Standards-Version: 3.9.6
7Homepage: https://wiki.gnome.org/Apps/EyeOfGnome8Homepage: https://wiki.gnome.org/Apps/EyeOfGnome
89
=== added file 'debian/patches/0001-Add-a-traditional-menu-bar.patch'
--- debian/patches/0001-Add-a-traditional-menu-bar.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/0001-Add-a-traditional-menu-bar.patch 2015-09-29 10:38:28 +0000
@@ -0,0 +1,360 @@
1From b7cf1b9c79f6c547ac8daec82d3fa851ceec839d Mon Sep 17 00:00:00 2001
2From: Lars Uebernickel <lars.uebernickel@canonical.com>
3Date: Fri, 25 Sep 2015 10:27:24 +0200
4Subject: [PATCH 1/2] Add a traditional menu bar
5
6---
7 data/eog-menubar.xml | 205 ++++++++++++++++++++++++++++++++++++++++++++++++++
8 src/eog-application.c | 39 +++++++---
9 src/eog-window.c | 44 ++++++-----
10 src/eog.gresource.xml | 1 +
11 4 files changed, 259 insertions(+), 30 deletions(-)
12 create mode 100644 data/eog-menubar.xml
13
14diff --git a/data/eog-menubar.xml b/data/eog-menubar.xml
15new file mode 100644
16index 0000000..cc99604
17--- /dev/null
18+++ b/data/eog-menubar.xml
19@@ -0,0 +1,205 @@
20+<?xml version="1.0" encoding="utf-8"?>
21+<interface>
22+ <menu id="menubar">
23+ <submenu>
24+ <attribute name="label" translatable="yes">_Image</attribute>
25+ <section>
26+ <item>
27+ <attribute name="label" translatable="yes">_Open…</attribute>
28+ <attribute name="action">win.open</attribute>
29+ <attribute name="accel">&lt;Ctrl&gt;o</attribute>
30+ </item>
31+ </section>
32+ <section>
33+ <item>
34+ <attribute name="label" translatable="yes">_Save</attribute>
35+ <attribute name="action">win.save</attribute>
36+ <attribute name="accel">&lt;Ctrl&gt;s</attribute>
37+ </item>
38+ <item>
39+ <attribute name="label" translatable="yes">_Save As…</attribute>
40+ <attribute name="action">win.save-as</attribute>
41+ <attribute name="accel">&lt;Ctrl&gt;&lt;Shift&gt;s</attribute>
42+ </item>
43+ </section>
44+ <section>
45+ <item>
46+ <attribute name="label" translatable="yes">Print…</attribute>
47+ <attribute name="action">win.print</attribute>
48+ <attribute name="accel">&lt;Ctrl&gt;p</attribute>
49+ </item>
50+ </section>
51+ <section>
52+ <item>
53+ <attribute name="label" translatable="yes">Set as _Wallpaper</attribute>
54+ <attribute name="action">win.set-wallpaper</attribute>
55+ <attribute name="accel">&lt;Ctrl&gt;F8</attribute>
56+ </item>
57+ <item>
58+ <attribute name="label" translatable="yes">Show Containing _Folder</attribute>
59+ <attribute name="action">win.open-folder</attribute>
60+ </item>
61+ </section>
62+ <section>
63+ <item>
64+ <attribute name="label" translatable="yes">Image Properties</attribute>
65+ <attribute name="action">win.properties</attribute>
66+ <attribute name="accel">&lt;Alt&gt;Return</attribute>
67+ </item>
68+ </section>
69+ <section>
70+ <item>
71+ <attribute name="label" translatable="yes">_Close</attribute>
72+ <attribute name="action">win.close</attribute>
73+ <attribute name="accel">&lt;Ctrl&gt;w</attribute>
74+ </item>
75+ </section>
76+ </submenu>
77+ <submenu>
78+ <attribute name="label" translatable="yes">_Edit</attribute>
79+ <section>
80+ <item>
81+ <attribute name="label" translatable="yes">_Undo</attribute>
82+ <attribute name="action">win.undo</attribute>
83+ <attribute name="accel">&lt;Ctrl&gt;z</attribute>
84+ </item>
85+ </section>
86+ <section>
87+ <item>
88+ <attribute name="label" translatable="yes">_Copy Image</attribute>
89+ <attribute name="action">win.copy</attribute>
90+ <attribute name="accel">&lt;Ctrl&gt;c</attribute>
91+ </item>
92+ </section>
93+ <section>
94+ <item>
95+ <attribute name="label" translatable="yes">Flip _Horizontal</attribute>
96+ <attribute name="action">win.flip-horizontal</attribute>
97+ </item>
98+ <item>
99+ <attribute name="label" translatable="yes">Flip _Vertical</attribute>
100+ <attribute name="action">win.flip-vertical</attribute>
101+ </item>
102+ </section>
103+ <section>
104+ <item>
105+ <attribute name="label" translatable="yes">_Rotate Clockwise</attribute>
106+ <attribute name="action">win.rotate-90</attribute>
107+ <attribute name="accel">&lt;Ctrl&gt;r</attribute>
108+ </item>
109+ <item>
110+ <attribute name="label" translatable="yes">Rotate Counter_clockwise</attribute>
111+ <attribute name="action">win.rotate-270</attribute>
112+ <attribute name="accel">&lt;Ctrl&gt;&lt;Shift&gt;r</attribute>
113+ </item>
114+ </section>
115+ <section>
116+ <item>
117+ <attribute name="label" translatable="yes">Move to _Trash</attribute>
118+ <attribute name="action">win.move-trash</attribute>
119+ <attribute name="accel">Delete</attribute>
120+ </item>
121+ <item>
122+ <attribute name="label" translatable="yes">_Delete</attribute>
123+ <attribute name="action">win.delete</attribute>
124+ <attribute name="accel">&lt;Shift&gt;Delete</attribute>
125+ </item>
126+ </section>
127+ <section>
128+ <item>
129+ <attribute name="label" translatable="yes">_Preferences</attribute>
130+ <attribute name="action">app.preferences</attribute>
131+ </item>
132+ </section>
133+ </submenu>
134+ <submenu>
135+ <attribute name="label" translatable="yes">_View</attribute>
136+ <section>
137+ <item>
138+ <attribute name="label" translatable="yes">_Statusbar</attribute>
139+ <attribute name="action">win.view-statusbar</attribute>
140+ </item>
141+ <item>
142+ <attribute name="label" translatable="yes">_Image Gallery</attribute>
143+ <attribute name="action">win.view-gallery</attribute>
144+ <attribute name="accel">F9</attribute>
145+ </item>
146+ <item>
147+ <attribute name="label" translatable="yes">Side _Pane</attribute>
148+ <attribute name="action">win.view-sidebar</attribute>
149+ <attribute name="accel">&lt;Ctrl&gt;F9</attribute>
150+ </item>
151+ </section>
152+ <section>
153+ <item>
154+ <attribute name="label" translatable="yes">Zoom _In</attribute>
155+ <attribute name="action">win.zoom-in</attribute>
156+ <attribute name="accel">&lt;Ctrl&gt;plus</attribute>
157+ </item>
158+ <item>
159+ <attribute name="label" translatable="yes">Zoom _Out</attribute>
160+ <attribute name="action">win.zoom-out</attribute>
161+ <attribute name="accel">&lt;Ctrl&gt;minus</attribute>
162+ </item>
163+ <item>
164+ <attribute name="label" translatable="yes">_Best Fit</attribute>
165+ <attribute name="action">win.toggle-zoom-fit</attribute>
166+ <attribute name="accel">F</attribute>
167+ </item>
168+ </section>
169+ <section>
170+ <item>
171+ <attribute name="label" translatable="yes">_Fullscreen</attribute>
172+ <attribute name="action">win.view-fullscreen</attribute>
173+ <attribute name="accel">F11</attribute>
174+ </item>
175+ <item>
176+ <attribute name="label" translatable="yes">Slide Show</attribute>
177+ <attribute name="action">win.view-slideshow</attribute>
178+ <attribute name="accel">F5</attribute>
179+ </item>
180+ </section>
181+ </submenu>
182+ <submenu>
183+ <attribute name="label" translatable="yes">_Go</attribute>
184+ <section>
185+ <item>
186+ <attribute name="label" translatable="yes">_Previous Image</attribute>
187+ <attribute name="action">win.go-previous</attribute>
188+ <attribute name="accel">Left</attribute>
189+ </item>
190+ <item>
191+ <attribute name="label" translatable="yes">_Next Image</attribute>
192+ <attribute name="action">win.go-next</attribute>
193+ <attribute name="accel">Right</attribute>
194+ </item>
195+ </section>
196+ <section>
197+ <item>
198+ <attribute name="label" translatable="yes">_First Image</attribute>
199+ <attribute name="action">win.go-first</attribute>
200+ <attribute name="accel">&lt;Alt&gt;Home</attribute>
201+ </item>
202+ <item>
203+ <attribute name="label" translatable="yes">_Last Image</attribute>
204+ <attribute name="action">win.go-last</attribute>
205+ <attribute name="accel">&lt;Alt&gt;End</attribute>
206+ </item>
207+ </section>
208+ </submenu>
209+ <submenu>
210+ <attribute name="label" translatable="yes">_Help</attribute>
211+ <section>
212+ <item>
213+ <attribute name="label" translatable="yes">_Manual</attribute>
214+ <attribute name="action">win.manual</attribute>
215+ <attribute name="accel">&lt;Ctrl&gt;F1</attribute>
216+ </item>
217+ <item>
218+ <attribute name="label" translatable="yes">_About</attribute>
219+ <attribute name="action">app.about</attribute>
220+ </item>
221+ </section>
222+ </submenu>
223+ </menu>
224+</interface>
225diff --git a/src/eog-application.c b/src/eog-application.c
226index 785ae49..3de5265 100644
227--- a/src/eog-application.c
228+++ b/src/eog-application.c
229@@ -169,17 +169,34 @@ eog_application_init_app_menu (EogApplication *application)
230 application);
231
232 builder = gtk_builder_new ();
233- gtk_builder_add_from_resource (builder,
234- "/org/gnome/eog/ui/eog-app-menu.xml",
235- &error);
236-
237- if (error == NULL) {
238- gtk_application_set_app_menu (GTK_APPLICATION (application),
239- G_MENU_MODEL (gtk_builder_get_object (builder,
240- "app-menu")));
241- } else {
242- g_critical ("Unable to add the application menu: %s\n", error->message);
243- g_error_free (error);
244+
245+ if (gtk_application_prefers_app_menu (GTK_APPLICATION (application))) {
246+ gtk_builder_add_from_resource (builder,
247+ "/org/gnome/eog/ui/eog-app-menu.xml",
248+ &error);
249+
250+ if (error == NULL) {
251+ gtk_application_set_app_menu (GTK_APPLICATION (application),
252+ G_MENU_MODEL (gtk_builder_get_object (builder,
253+ "app-menu")));
254+ } else {
255+ g_critical ("Unable to add the application menu: %s\n", error->message);
256+ g_error_free (error);
257+ }
258+ }
259+ else {
260+ gtk_builder_add_from_resource (builder,
261+ "/org/gnome/eog/ui/eog-menubar.xml",
262+ &error);
263+
264+ if (error == NULL) {
265+ gtk_application_set_menubar (GTK_APPLICATION (application),
266+ G_MENU_MODEL (gtk_builder_get_object (builder,
267+ "menubar")));
268+ } else {
269+ g_critical ("Unable to add the application menu: %s\n", error->message);
270+ g_error_free (error);
271+ }
272 }
273
274 action = g_action_map_lookup_action (G_ACTION_MAP (application),
275diff --git a/src/eog-window.c b/src/eog-window.c
276index 738213f..ff5762c 100644
277--- a/src/eog-window.c
278+++ b/src/eog-window.c
279@@ -4266,18 +4266,30 @@ eog_window_construct_ui (EogWindow *window)
280 priv->zoom_scale);
281 gtk_widget_show (priv->zoom_scale);
282
283- menu_button = gtk_menu_button_new ();
284- menu_image = gtk_image_new_from_icon_name ("open-menu-symbolic",
285- GTK_ICON_SIZE_BUTTON);
286- gtk_button_set_image (GTK_BUTTON (menu_button), menu_image);
287+ priv->open_with_menu = g_menu_new ();
288+ priv->appinfo = g_ptr_array_new_with_free_func (g_object_unref);
289+
290+ if (gtk_application_prefers_app_menu (GTK_APPLICATION (EOG_APP))) {
291+ menu_button = gtk_menu_button_new ();
292+ menu_image = gtk_image_new_from_icon_name ("open-menu-symbolic",
293+ GTK_ICON_SIZE_BUTTON);
294+ gtk_button_set_image (GTK_BUTTON (menu_button), menu_image);
295+
296+ builder = gtk_builder_new_from_resource ("/org/gnome/eog/ui/eog-gear-menu.ui");
297+ builder_object = gtk_builder_get_object (builder, "gear-menu");
298+ gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button),
299+ G_MENU_MODEL (builder_object));
300
301- builder = gtk_builder_new_from_resource ("/org/gnome/eog/ui/eog-gear-menu.ui");
302- builder_object = gtk_builder_get_object (builder, "gear-menu");
303- gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button),
304- G_MENU_MODEL (builder_object));
305+ gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), menu_button);
306+ gtk_widget_show (menu_button);
307
308- gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), menu_button);
309- gtk_widget_show (menu_button);
310+ builder_object = gtk_builder_get_object (builder, "open-with-menu");
311+ g_menu_append_section (G_MENU (builder_object),
312+ NULL,
313+ G_MENU_MODEL (priv->open_with_menu));
314+ priv->gear_menu_builder = builder;
315+ builder = NULL;
316+ }
317
318 fullscreen_button = gtk_button_new_from_icon_name ("view-fullscreen-symbolic",
319 GTK_ICON_SIZE_BUTTON);
320@@ -4288,15 +4300,6 @@ eog_window_construct_ui (EogWindow *window)
321 gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), fullscreen_button);
322 gtk_widget_show (fullscreen_button);
323
324- priv->open_with_menu = g_menu_new ();
325- priv->appinfo = g_ptr_array_new_with_free_func (g_object_unref);
326- builder_object = gtk_builder_get_object (builder, "open-with-menu");
327- g_menu_append_section (G_MENU (builder_object),
328- NULL,
329- G_MENU_MODEL (priv->open_with_menu));
330- priv->gear_menu_builder = builder;
331- builder = NULL;
332-
333 priv->cbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
334 gtk_box_pack_start (GTK_BOX (priv->box), priv->cbox, TRUE, TRUE, 0);
335 gtk_widget_show (priv->cbox);
336@@ -5241,6 +5244,9 @@ eog_window_get_gear_menu_section (EogWindow *window, const gchar *id)
337 GObject *object;
338 g_return_val_if_fail (EOG_IS_WINDOW (window), NULL);
339
340+ if (window->priv->gear_menu_builder == NULL)
341+ return NULL;
342+
343 object = gtk_builder_get_object (window->priv->gear_menu_builder, id);
344 if (object == NULL || !G_IS_MENU (object))
345 return NULL;
346diff --git a/src/eog.gresource.xml b/src/eog.gresource.xml
347index 0f69c90..9f6bc43 100644
348--- a/src/eog.gresource.xml
349+++ b/src/eog.gresource.xml
350@@ -3,6 +3,7 @@
351 <gresource prefix="/org/gnome/eog/ui">
352 <file>eog.css</file>
353 <file compressed="true" preprocess="xml-stripblanks">eog-app-menu.xml</file>
354+ <file compressed="true" preprocess="xml-stripblanks">eog-menubar.xml</file>
355 <file compressed="true" preprocess="xml-stripblanks">eog-gear-menu.ui</file>
356 <file compressed="true" preprocess="xml-stripblanks">eog-image-properties-dialog.ui</file>
357 <file compressed="true" preprocess="xml-stripblanks">eog-multiple-save-as-dialog.ui</file>
358--
3592.5.0
360
0361
=== added file 'debian/patches/0002-Show-traditional-title-bar-in-unity.patch'
--- debian/patches/0002-Show-traditional-title-bar-in-unity.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/0002-Show-traditional-title-bar-in-unity.patch 2015-09-29 10:38:28 +0000
@@ -0,0 +1,139 @@
1From fd12d0136bfd9abc8a121f47775c2200237e535f Mon Sep 17 00:00:00 2001
2From: Lars Uebernickel <lars.uebernickel@canonical.com>
3Date: Tue, 29 Sep 2015 12:25:29 +0200
4Subject: [PATCH 2/2] Show traditional title bar in unity
5
6Based on a patch by Sebastien Bacher <seb128@ubuntu.com>
7---
8 src/eog-window.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++----------
9 1 file changed, 55 insertions(+), 11 deletions(-)
10
11diff --git a/src/eog-window.c b/src/eog-window.c
12index ff5762c..4e3c716 100644
13--- a/src/eog-window.c
14+++ b/src/eog-window.c
15@@ -134,6 +134,7 @@ struct _EogWindowPrivate {
16 GtkWidget *zoom_revealer;
17 GtkWidget *zoom_scale;
18 GtkWidget *properties_dlg;
19+ GtkWidget *headerbar;
20
21 GMenu *open_with_menu;
22 GPtrArray *appinfo;
23@@ -4196,6 +4197,43 @@ eog_window_zoom_button_toggled_cb (GtkToggleButton *button, gpointer user_data)
24 gtk_button_set_image (GTK_BUTTON (button), zoom_image);
25 }
26
27+static gboolean
28+in_desktop (const gchar *name)
29+{
30+ const gchar *desktop_name_list;
31+ gchar **names;
32+ gboolean in_list = FALSE;
33+ gint i;
34+
35+ desktop_name_list = g_getenv ("XDG_CURRENT_DESKTOP");
36+ if (!desktop_name_list)
37+ return FALSE;
38+
39+ names = g_strsplit (desktop_name_list, ":", -1);
40+ for (i = 0; names[i] && !in_list; i++)
41+ if (strcmp (names[i], name) == 0) {
42+ in_list = TRUE;
43+ break;
44+ }
45+ g_strfreev (names);
46+
47+ return in_list;
48+}
49+
50+static void
51+on_action_state_changed (GActionGroup *action_group,
52+ gchar *name,
53+ GVariant *value,
54+ gpointer user_data)
55+{
56+ EogWindow *window = user_data;
57+ EogWindowPrivate *priv = window->priv;
58+
59+ gtk_widget_set_visible (GTK_WIDGET (priv->headerbar),
60+ priv->mode != EOG_WINDOW_MODE_FULLSCREEN &&
61+ priv->mode != EOG_WINDOW_MODE_SLIDESHOW);
62+}
63+
64 static void
65 eog_window_construct_ui (EogWindow *window)
66 {
67@@ -4207,7 +4245,6 @@ eog_window_construct_ui (EogWindow *window)
68
69 GtkWidget *popup_menu;
70 GtkWidget *hpaned;
71- GtkWidget *headerbar;
72 GtkWidget *zoom_button;
73 GtkWidget *zoom_image;
74 GtkWidget *menu_button;
75@@ -4222,12 +4259,19 @@ eog_window_construct_ui (EogWindow *window)
76 gtk_container_add (GTK_CONTAINER (window), priv->box);
77 gtk_widget_show (priv->box);
78
79- headerbar = gtk_header_bar_new ();
80- gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (headerbar), TRUE);
81- gtk_header_bar_set_title (GTK_HEADER_BAR (headerbar),
82- g_get_application_name ());
83- gtk_window_set_titlebar (GTK_WINDOW (window), headerbar);
84- gtk_widget_show (headerbar);
85+ priv->headerbar = gtk_header_bar_new ();
86+ if (!in_desktop ("Unity")) {
87+ gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (priv->headerbar), TRUE);
88+ gtk_header_bar_set_title (GTK_HEADER_BAR (priv->headerbar), g_get_application_name ());
89+ gtk_window_set_titlebar (GTK_WINDOW (window), priv->headerbar);
90+ } else {
91+ gtk_container_add (GTK_CONTAINER (priv->box), priv->headerbar);
92+
93+ /* Need to hide toolbar when fullscreen (slideshow or normal fullscreen) */
94+ g_signal_connect (window, "action-state-changed",
95+ G_CALLBACK (on_action_state_changed), window);
96+ }
97+ gtk_widget_show (priv->headerbar);
98
99 zoom_button = gtk_toggle_button_new ();
100 zoom_image = gtk_image_new_from_icon_name ("zoom-in-symbolic",
101@@ -4238,7 +4282,7 @@ eog_window_construct_ui (EogWindow *window)
102 g_signal_connect (zoom_button, "toggled",
103 G_CALLBACK (eog_window_zoom_button_toggled_cb),
104 window);
105- gtk_header_bar_pack_start (GTK_HEADER_BAR (headerbar), zoom_button);
106+ gtk_header_bar_pack_start (GTK_HEADER_BAR (priv->headerbar), zoom_button);
107 /* disable zoom button if no image is loaded */
108 g_object_bind_property (g_action_map_lookup_action (G_ACTION_MAP(window),
109 "zoom-normal"),
110@@ -4249,7 +4293,7 @@ eog_window_construct_ui (EogWindow *window)
111 priv->zoom_revealer = gtk_revealer_new ();
112 gtk_revealer_set_transition_type (GTK_REVEALER (priv->zoom_revealer),
113 GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT);
114- gtk_header_bar_pack_start (GTK_HEADER_BAR (headerbar),
115+ gtk_header_bar_pack_start (GTK_HEADER_BAR (priv->headerbar),
116 priv->zoom_revealer);
117 gtk_widget_show (priv->zoom_revealer);
118
119@@ -4280,7 +4324,7 @@ eog_window_construct_ui (EogWindow *window)
120 gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button),
121 G_MENU_MODEL (builder_object));
122
123- gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), menu_button);
124+ gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->headerbar), menu_button);
125 gtk_widget_show (menu_button);
126
127 builder_object = gtk_builder_get_object (builder, "open-with-menu");
128@@ -4297,7 +4341,7 @@ eog_window_construct_ui (EogWindow *window)
129 "win.view-fullscreen");
130 gtk_widget_set_tooltip_text(fullscreen_button,
131 _("Show the current image in fullscreen mode"));
132- gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), fullscreen_button);
133+ gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->headerbar), fullscreen_button);
134 gtk_widget_show (fullscreen_button);
135
136 priv->cbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
137--
1382.5.0
139
0140
=== removed file 'debian/patches/disable-appmenu-when-not-needed.patch'
--- debian/patches/disable-appmenu-when-not-needed.patch 2015-09-21 10:53:08 +0000
+++ debian/patches/disable-appmenu-when-not-needed.patch 1970-01-01 00:00:00 +0000
@@ -1,33 +0,0 @@
1Description: Disables the application menu on platforms that show an app menu
2 and a menubar (such as unity). The menubar already contains all the actions of
3 the appmenu. Having both is redundant.
4Forwarded: doesn't make sense upstream until eog is ported to GMenuModel
5Author: Lars Uebernickel <lars.uebernickel@canonical.com>
6Index: eog-3.16.3/src/eog-application.c
7===================================================================
8--- eog-3.16.3.orig/src/eog-application.c 2015-08-20 23:52:05.472049295 +0200
9+++ eog-3.16.3/src/eog-application.c 2015-08-20 23:52:05.472049295 +0200
10@@ -291,6 +291,8 @@
11 GFile *css_file;
12 GtkSettings *settings;
13 GtkCssProvider *provider;
14+ gboolean shows_app_menu;
15+ gboolean shows_menubar;
16
17 G_APPLICATION_CLASS (eog_application_parent_class)->startup (application);
18
19@@ -330,7 +332,13 @@
20 "gtk-application-prefer-dark-theme", TRUE,
21 NULL);
22
23- eog_application_init_app_menu (app);
24+ g_object_get (gtk_settings_get_default (),
25+ "gtk-shell-shows-app-menu", &shows_app_menu,
26+ "gtk-shell-shows-menubar", &shows_menubar,
27+ NULL);
28+
29+ if (shows_app_menu && !shows_menubar)
30+ eog_application_init_app_menu (EOG_APPLICATION (application));
31 eog_application_init_accelerators (GTK_APPLICATION (app));
32
33 app->priv->extensions = peas_extension_set_new (
340
=== modified file 'debian/patches/series'
--- debian/patches/series 2015-05-27 16:03:38 +0000
+++ debian/patches/series 2015-09-29 10:38:28 +0000
@@ -1,3 +1,2 @@
1disable-appmenu-when-not-needed.patch10001-Add-a-traditional-menu-bar.patch
2unity_traditional_titlebar.patch20002-Show-traditional-title-bar-in-unity.patch
3
43
=== removed file 'debian/patches/unity_traditional_titlebar.patch'
--- debian/patches/unity_traditional_titlebar.patch 2015-09-21 10:57:41 +0000
+++ debian/patches/unity_traditional_titlebar.patch 1970-01-01 00:00:00 +0000
@@ -1,140 +0,0 @@
1# Description: Show traditional titlebar under unity
2# Upstream: https://bugzilla.gnome.org/show_bug.cgi?id=749976
3#
4Index: b/src/eog-window.c
5===================================================================
6--- a/src/eog-window.c
7+++ b/src/eog-window.c
8@@ -130,6 +130,7 @@
9 GtkWidget *thumbview;
10 GtkWidget *statusbar;
11 GtkWidget *nav;
12+ GtkWidget *headerbar;
13 GtkWidget *message_area;
14 GtkWidget *zoom_revealer;
15 GtkWidget *zoom_scale;
16@@ -4196,6 +4197,42 @@
17 gtk_button_set_image (GTK_BUTTON (button), zoom_image);
18 }
19
20+static gboolean
21+in_desktop (const gchar *name)
22+{
23+ const gchar *desktop_name_list;
24+ gchar **names;
25+ gboolean in_list = FALSE;
26+ gint i;
27+
28+ desktop_name_list = g_getenv ("XDG_CURRENT_DESKTOP");
29+ if (!desktop_name_list)
30+ return FALSE;
31+
32+ names = g_strsplit (desktop_name_list, ":", -1);
33+ for (i = 0; names[i] && !in_list; i++)
34+ if (strcmp (names[i], name) == 0) {
35+ in_list = TRUE;
36+ break;
37+ }
38+ g_strfreev (names);
39+
40+ return in_list;
41+}
42+
43+static void
44+on_action_state_changed (GObject *object G_GNUC_UNUSED,
45+ GParamSpec *pspec G_GNUC_UNUSED,
46+ gpointer user_data)
47+{
48+ EogWindow *window = EOG_WINDOW (user_data);
49+ EogWindowPrivate *priv = window->priv;
50+
51+ gtk_widget_set_visible (GTK_WIDGET (priv->headerbar),
52+ priv->mode != EOG_WINDOW_MODE_FULLSCREEN &&
53+ priv->mode != EOG_WINDOW_MODE_SLIDESHOW);
54+}
55+
56 static void
57 eog_window_construct_ui (EogWindow *window)
58 {
59@@ -4207,7 +4244,6 @@
60
61 GtkWidget *popup_menu;
62 GtkWidget *hpaned;
63- GtkWidget *headerbar;
64 GtkWidget *zoom_button;
65 GtkWidget *zoom_image;
66 GtkWidget *menu_button;
67@@ -4222,12 +4258,31 @@
68 gtk_container_add (GTK_CONTAINER (window), priv->box);
69 gtk_widget_show (priv->box);
70
71- headerbar = gtk_header_bar_new ();
72- gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (headerbar), TRUE);
73- gtk_header_bar_set_title (GTK_HEADER_BAR (headerbar),
74- g_get_application_name ());
75- gtk_window_set_titlebar (GTK_WINDOW (window), headerbar);
76- gtk_widget_show (headerbar);
77+ priv->headerbar = gtk_header_bar_new ();
78+ if (!in_desktop ("Unity")) {
79+ gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (priv->headerbar),
80+ TRUE);
81+ gtk_header_bar_set_title (GTK_HEADER_BAR (priv->headerbar),
82+ g_get_application_name ());
83+ gtk_window_set_titlebar (GTK_WINDOW (window), priv->headerbar);
84+ } else {
85+ gtk_container_add (GTK_CONTAINER (priv->box), priv->headerbar);
86+
87+ /* Need to hide toolbar when fullscreen (slideshow or normal fullscreen) */
88+ action = g_action_map_lookup_action (G_ACTION_MAP (window),
89+ "view-fullscreen");
90+ g_signal_connect (action,
91+ "notify::state",
92+ G_CALLBACK (on_action_state_changed),
93+ window);
94+ action = g_action_map_lookup_action (G_ACTION_MAP (window),
95+ "view-slideshow");
96+ g_signal_connect (action,
97+ "notify::state",
98+ G_CALLBACK (on_action_state_changed),
99+ window);
100+ }
101+ gtk_widget_show (priv->headerbar);
102
103 zoom_button = gtk_toggle_button_new ();
104 zoom_image = gtk_image_new_from_icon_name ("zoom-in-symbolic",
105@@ -4238,7 +4293,7 @@
106 g_signal_connect (zoom_button, "toggled",
107 G_CALLBACK (eog_window_zoom_button_toggled_cb),
108 window);
109- gtk_header_bar_pack_start (GTK_HEADER_BAR (headerbar), zoom_button);
110+ gtk_header_bar_pack_start (GTK_HEADER_BAR (priv->headerbar), zoom_button);
111 /* disable zoom button if no image is loaded */
112 g_object_bind_property (g_action_map_lookup_action (G_ACTION_MAP(window),
113 "zoom-normal"),
114@@ -4249,7 +4304,7 @@
115 priv->zoom_revealer = gtk_revealer_new ();
116 gtk_revealer_set_transition_type (GTK_REVEALER (priv->zoom_revealer),
117 GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT);
118- gtk_header_bar_pack_start (GTK_HEADER_BAR (headerbar),
119+ gtk_header_bar_pack_start (GTK_HEADER_BAR (priv->headerbar),
120 priv->zoom_revealer);
121 gtk_widget_show (priv->zoom_revealer);
122
123@@ -4276,7 +4331,7 @@
124 gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button),
125 G_MENU_MODEL (builder_object));
126
127- gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), menu_button);
128+ gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->headerbar), menu_button);
129 gtk_widget_show (menu_button);
130
131 fullscreen_button = gtk_button_new_from_icon_name ("view-fullscreen-symbolic",
132@@ -4285,7 +4340,7 @@
133 "win.view-fullscreen");
134 gtk_widget_set_tooltip_text(fullscreen_button,
135 _("Show the current image in fullscreen mode"));
136- gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), fullscreen_button);
137+ gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->headerbar), fullscreen_button);
138 gtk_widget_show (fullscreen_button);
139
140 priv->open_with_menu = g_menu_new ();

Subscribers

People subscribed via source and target branches

to all changes: