Merge lp:~larsu/eog/menubar into lp:~ubuntu-desktop/eog/ubuntu
- menubar
- Merge into ubuntu
Proposed by
Lars Karlitski
on 2015-09-29
| 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 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Ubuntu Desktop | 2015-09-29 | Pending | |
|
Review via email:
|
|||
Commit Message
* Add debian/
* Update debian/
update to make work with menubar patch and use GActionGroup's signals
Description of the Change
* Add debian/
* Update debian/
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
| 1 | === modified file 'debian/changelog' |
| 2 | --- debian/changelog 2015-09-21 10:57:41 +0000 |
| 3 | +++ debian/changelog 2015-09-29 10:38:28 +0000 |
| 4 | @@ -1,8 +1,14 @@ |
| 5 | -eog (3.16.3-1ubuntu2) UNRELEASED; urgency=medium |
| 6 | +eog (3.16.3-1ubuntu4) UNRELEASED; urgency=medium |
| 7 | |
| 8 | + [ Iain Lane ] |
| 9 | * Make the toolbar hide in fullscreen. |
| 10 | |
| 11 | - -- Iain Lane <iain.lane@canonical.com> Mon, 21 Sep 2015 11:53:13 +0100 |
| 12 | + [ Lars Uebernickel ] |
| 13 | + * Add debian/patches/0001-Add-a-traditional-menu-bar.patch |
| 14 | + * Update debian/patches/0002-Show-traditional-title-bar-in-unity.patch: |
| 15 | + update to make work with menubar patch and use GActionGroup's signals |
| 16 | + |
| 17 | + -- Lars Uebernickel <lars.uebernickel@ubuntu.com> Tue, 29 Sep 2015 12:30:46 +0200 |
| 18 | |
| 19 | eog (3.16.3-1ubuntu1) wily; urgency=low |
| 20 | |
| 21 | |
| 22 | === modified file 'debian/control' |
| 23 | --- debian/control 2015-09-21 10:53:08 +0000 |
| 24 | +++ debian/control 2015-09-29 10:38:28 +0000 |
| 25 | @@ -5,7 +5,8 @@ |
| 26 | Source: eog |
| 27 | Section: gnome |
| 28 | Priority: optional |
| 29 | -Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org> |
| 30 | +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
| 31 | +XSBC-Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org> |
| 32 | Uploaders: Andreas Henriksson <andreas@fatal.se>, Iain Lane <laney@debian.org>, Michael Biebl <biebl@debian.org>, Sjoerd Simons <sjoerd@debian.org> |
| 33 | Standards-Version: 3.9.6 |
| 34 | Homepage: https://wiki.gnome.org/Apps/EyeOfGnome |
| 35 | |
| 36 | === modified file 'debian/control.in' |
| 37 | --- debian/control.in 2015-05-27 16:03:38 +0000 |
| 38 | +++ debian/control.in 2015-09-29 10:38:28 +0000 |
| 39 | @@ -1,7 +1,8 @@ |
| 40 | Source: eog |
| 41 | Section: gnome |
| 42 | Priority: optional |
| 43 | -Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org> |
| 44 | +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
| 45 | +XSBC-Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org> |
| 46 | Uploaders: @GNOME_TEAM@ |
| 47 | Standards-Version: 3.9.6 |
| 48 | Homepage: https://wiki.gnome.org/Apps/EyeOfGnome |
| 49 | |
| 50 | === added file 'debian/patches/0001-Add-a-traditional-menu-bar.patch' |
| 51 | --- debian/patches/0001-Add-a-traditional-menu-bar.patch 1970-01-01 00:00:00 +0000 |
| 52 | +++ debian/patches/0001-Add-a-traditional-menu-bar.patch 2015-09-29 10:38:28 +0000 |
| 53 | @@ -0,0 +1,360 @@ |
| 54 | +From b7cf1b9c79f6c547ac8daec82d3fa851ceec839d Mon Sep 17 00:00:00 2001 |
| 55 | +From: Lars Uebernickel <lars.uebernickel@canonical.com> |
| 56 | +Date: Fri, 25 Sep 2015 10:27:24 +0200 |
| 57 | +Subject: [PATCH 1/2] Add a traditional menu bar |
| 58 | + |
| 59 | +--- |
| 60 | + data/eog-menubar.xml | 205 ++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 61 | + src/eog-application.c | 39 +++++++--- |
| 62 | + src/eog-window.c | 44 ++++++----- |
| 63 | + src/eog.gresource.xml | 1 + |
| 64 | + 4 files changed, 259 insertions(+), 30 deletions(-) |
| 65 | + create mode 100644 data/eog-menubar.xml |
| 66 | + |
| 67 | +diff --git a/data/eog-menubar.xml b/data/eog-menubar.xml |
| 68 | +new file mode 100644 |
| 69 | +index 0000000..cc99604 |
| 70 | +--- /dev/null |
| 71 | ++++ b/data/eog-menubar.xml |
| 72 | +@@ -0,0 +1,205 @@ |
| 73 | ++<?xml version="1.0" encoding="utf-8"?> |
| 74 | ++<interface> |
| 75 | ++ <menu id="menubar"> |
| 76 | ++ <submenu> |
| 77 | ++ <attribute name="label" translatable="yes">_Image</attribute> |
| 78 | ++ <section> |
| 79 | ++ <item> |
| 80 | ++ <attribute name="label" translatable="yes">_Open…</attribute> |
| 81 | ++ <attribute name="action">win.open</attribute> |
| 82 | ++ <attribute name="accel"><Ctrl>o</attribute> |
| 83 | ++ </item> |
| 84 | ++ </section> |
| 85 | ++ <section> |
| 86 | ++ <item> |
| 87 | ++ <attribute name="label" translatable="yes">_Save</attribute> |
| 88 | ++ <attribute name="action">win.save</attribute> |
| 89 | ++ <attribute name="accel"><Ctrl>s</attribute> |
| 90 | ++ </item> |
| 91 | ++ <item> |
| 92 | ++ <attribute name="label" translatable="yes">_Save As…</attribute> |
| 93 | ++ <attribute name="action">win.save-as</attribute> |
| 94 | ++ <attribute name="accel"><Ctrl><Shift>s</attribute> |
| 95 | ++ </item> |
| 96 | ++ </section> |
| 97 | ++ <section> |
| 98 | ++ <item> |
| 99 | ++ <attribute name="label" translatable="yes">Print…</attribute> |
| 100 | ++ <attribute name="action">win.print</attribute> |
| 101 | ++ <attribute name="accel"><Ctrl>p</attribute> |
| 102 | ++ </item> |
| 103 | ++ </section> |
| 104 | ++ <section> |
| 105 | ++ <item> |
| 106 | ++ <attribute name="label" translatable="yes">Set as _Wallpaper</attribute> |
| 107 | ++ <attribute name="action">win.set-wallpaper</attribute> |
| 108 | ++ <attribute name="accel"><Ctrl>F8</attribute> |
| 109 | ++ </item> |
| 110 | ++ <item> |
| 111 | ++ <attribute name="label" translatable="yes">Show Containing _Folder</attribute> |
| 112 | ++ <attribute name="action">win.open-folder</attribute> |
| 113 | ++ </item> |
| 114 | ++ </section> |
| 115 | ++ <section> |
| 116 | ++ <item> |
| 117 | ++ <attribute name="label" translatable="yes">Image Properties</attribute> |
| 118 | ++ <attribute name="action">win.properties</attribute> |
| 119 | ++ <attribute name="accel"><Alt>Return</attribute> |
| 120 | ++ </item> |
| 121 | ++ </section> |
| 122 | ++ <section> |
| 123 | ++ <item> |
| 124 | ++ <attribute name="label" translatable="yes">_Close</attribute> |
| 125 | ++ <attribute name="action">win.close</attribute> |
| 126 | ++ <attribute name="accel"><Ctrl>w</attribute> |
| 127 | ++ </item> |
| 128 | ++ </section> |
| 129 | ++ </submenu> |
| 130 | ++ <submenu> |
| 131 | ++ <attribute name="label" translatable="yes">_Edit</attribute> |
| 132 | ++ <section> |
| 133 | ++ <item> |
| 134 | ++ <attribute name="label" translatable="yes">_Undo</attribute> |
| 135 | ++ <attribute name="action">win.undo</attribute> |
| 136 | ++ <attribute name="accel"><Ctrl>z</attribute> |
| 137 | ++ </item> |
| 138 | ++ </section> |
| 139 | ++ <section> |
| 140 | ++ <item> |
| 141 | ++ <attribute name="label" translatable="yes">_Copy Image</attribute> |
| 142 | ++ <attribute name="action">win.copy</attribute> |
| 143 | ++ <attribute name="accel"><Ctrl>c</attribute> |
| 144 | ++ </item> |
| 145 | ++ </section> |
| 146 | ++ <section> |
| 147 | ++ <item> |
| 148 | ++ <attribute name="label" translatable="yes">Flip _Horizontal</attribute> |
| 149 | ++ <attribute name="action">win.flip-horizontal</attribute> |
| 150 | ++ </item> |
| 151 | ++ <item> |
| 152 | ++ <attribute name="label" translatable="yes">Flip _Vertical</attribute> |
| 153 | ++ <attribute name="action">win.flip-vertical</attribute> |
| 154 | ++ </item> |
| 155 | ++ </section> |
| 156 | ++ <section> |
| 157 | ++ <item> |
| 158 | ++ <attribute name="label" translatable="yes">_Rotate Clockwise</attribute> |
| 159 | ++ <attribute name="action">win.rotate-90</attribute> |
| 160 | ++ <attribute name="accel"><Ctrl>r</attribute> |
| 161 | ++ </item> |
| 162 | ++ <item> |
| 163 | ++ <attribute name="label" translatable="yes">Rotate Counter_clockwise</attribute> |
| 164 | ++ <attribute name="action">win.rotate-270</attribute> |
| 165 | ++ <attribute name="accel"><Ctrl><Shift>r</attribute> |
| 166 | ++ </item> |
| 167 | ++ </section> |
| 168 | ++ <section> |
| 169 | ++ <item> |
| 170 | ++ <attribute name="label" translatable="yes">Move to _Trash</attribute> |
| 171 | ++ <attribute name="action">win.move-trash</attribute> |
| 172 | ++ <attribute name="accel">Delete</attribute> |
| 173 | ++ </item> |
| 174 | ++ <item> |
| 175 | ++ <attribute name="label" translatable="yes">_Delete</attribute> |
| 176 | ++ <attribute name="action">win.delete</attribute> |
| 177 | ++ <attribute name="accel"><Shift>Delete</attribute> |
| 178 | ++ </item> |
| 179 | ++ </section> |
| 180 | ++ <section> |
| 181 | ++ <item> |
| 182 | ++ <attribute name="label" translatable="yes">_Preferences</attribute> |
| 183 | ++ <attribute name="action">app.preferences</attribute> |
| 184 | ++ </item> |
| 185 | ++ </section> |
| 186 | ++ </submenu> |
| 187 | ++ <submenu> |
| 188 | ++ <attribute name="label" translatable="yes">_View</attribute> |
| 189 | ++ <section> |
| 190 | ++ <item> |
| 191 | ++ <attribute name="label" translatable="yes">_Statusbar</attribute> |
| 192 | ++ <attribute name="action">win.view-statusbar</attribute> |
| 193 | ++ </item> |
| 194 | ++ <item> |
| 195 | ++ <attribute name="label" translatable="yes">_Image Gallery</attribute> |
| 196 | ++ <attribute name="action">win.view-gallery</attribute> |
| 197 | ++ <attribute name="accel">F9</attribute> |
| 198 | ++ </item> |
| 199 | ++ <item> |
| 200 | ++ <attribute name="label" translatable="yes">Side _Pane</attribute> |
| 201 | ++ <attribute name="action">win.view-sidebar</attribute> |
| 202 | ++ <attribute name="accel"><Ctrl>F9</attribute> |
| 203 | ++ </item> |
| 204 | ++ </section> |
| 205 | ++ <section> |
| 206 | ++ <item> |
| 207 | ++ <attribute name="label" translatable="yes">Zoom _In</attribute> |
| 208 | ++ <attribute name="action">win.zoom-in</attribute> |
| 209 | ++ <attribute name="accel"><Ctrl>plus</attribute> |
| 210 | ++ </item> |
| 211 | ++ <item> |
| 212 | ++ <attribute name="label" translatable="yes">Zoom _Out</attribute> |
| 213 | ++ <attribute name="action">win.zoom-out</attribute> |
| 214 | ++ <attribute name="accel"><Ctrl>minus</attribute> |
| 215 | ++ </item> |
| 216 | ++ <item> |
| 217 | ++ <attribute name="label" translatable="yes">_Best Fit</attribute> |
| 218 | ++ <attribute name="action">win.toggle-zoom-fit</attribute> |
| 219 | ++ <attribute name="accel">F</attribute> |
| 220 | ++ </item> |
| 221 | ++ </section> |
| 222 | ++ <section> |
| 223 | ++ <item> |
| 224 | ++ <attribute name="label" translatable="yes">_Fullscreen</attribute> |
| 225 | ++ <attribute name="action">win.view-fullscreen</attribute> |
| 226 | ++ <attribute name="accel">F11</attribute> |
| 227 | ++ </item> |
| 228 | ++ <item> |
| 229 | ++ <attribute name="label" translatable="yes">Slide Show</attribute> |
| 230 | ++ <attribute name="action">win.view-slideshow</attribute> |
| 231 | ++ <attribute name="accel">F5</attribute> |
| 232 | ++ </item> |
| 233 | ++ </section> |
| 234 | ++ </submenu> |
| 235 | ++ <submenu> |
| 236 | ++ <attribute name="label" translatable="yes">_Go</attribute> |
| 237 | ++ <section> |
| 238 | ++ <item> |
| 239 | ++ <attribute name="label" translatable="yes">_Previous Image</attribute> |
| 240 | ++ <attribute name="action">win.go-previous</attribute> |
| 241 | ++ <attribute name="accel">Left</attribute> |
| 242 | ++ </item> |
| 243 | ++ <item> |
| 244 | ++ <attribute name="label" translatable="yes">_Next Image</attribute> |
| 245 | ++ <attribute name="action">win.go-next</attribute> |
| 246 | ++ <attribute name="accel">Right</attribute> |
| 247 | ++ </item> |
| 248 | ++ </section> |
| 249 | ++ <section> |
| 250 | ++ <item> |
| 251 | ++ <attribute name="label" translatable="yes">_First Image</attribute> |
| 252 | ++ <attribute name="action">win.go-first</attribute> |
| 253 | ++ <attribute name="accel"><Alt>Home</attribute> |
| 254 | ++ </item> |
| 255 | ++ <item> |
| 256 | ++ <attribute name="label" translatable="yes">_Last Image</attribute> |
| 257 | ++ <attribute name="action">win.go-last</attribute> |
| 258 | ++ <attribute name="accel"><Alt>End</attribute> |
| 259 | ++ </item> |
| 260 | ++ </section> |
| 261 | ++ </submenu> |
| 262 | ++ <submenu> |
| 263 | ++ <attribute name="label" translatable="yes">_Help</attribute> |
| 264 | ++ <section> |
| 265 | ++ <item> |
| 266 | ++ <attribute name="label" translatable="yes">_Manual</attribute> |
| 267 | ++ <attribute name="action">win.manual</attribute> |
| 268 | ++ <attribute name="accel"><Ctrl>F1</attribute> |
| 269 | ++ </item> |
| 270 | ++ <item> |
| 271 | ++ <attribute name="label" translatable="yes">_About</attribute> |
| 272 | ++ <attribute name="action">app.about</attribute> |
| 273 | ++ </item> |
| 274 | ++ </section> |
| 275 | ++ </submenu> |
| 276 | ++ </menu> |
| 277 | ++</interface> |
| 278 | +diff --git a/src/eog-application.c b/src/eog-application.c |
| 279 | +index 785ae49..3de5265 100644 |
| 280 | +--- a/src/eog-application.c |
| 281 | ++++ b/src/eog-application.c |
| 282 | +@@ -169,17 +169,34 @@ eog_application_init_app_menu (EogApplication *application) |
| 283 | + application); |
| 284 | + |
| 285 | + builder = gtk_builder_new (); |
| 286 | +- gtk_builder_add_from_resource (builder, |
| 287 | +- "/org/gnome/eog/ui/eog-app-menu.xml", |
| 288 | +- &error); |
| 289 | +- |
| 290 | +- if (error == NULL) { |
| 291 | +- gtk_application_set_app_menu (GTK_APPLICATION (application), |
| 292 | +- G_MENU_MODEL (gtk_builder_get_object (builder, |
| 293 | +- "app-menu"))); |
| 294 | +- } else { |
| 295 | +- g_critical ("Unable to add the application menu: %s\n", error->message); |
| 296 | +- g_error_free (error); |
| 297 | ++ |
| 298 | ++ if (gtk_application_prefers_app_menu (GTK_APPLICATION (application))) { |
| 299 | ++ gtk_builder_add_from_resource (builder, |
| 300 | ++ "/org/gnome/eog/ui/eog-app-menu.xml", |
| 301 | ++ &error); |
| 302 | ++ |
| 303 | ++ if (error == NULL) { |
| 304 | ++ gtk_application_set_app_menu (GTK_APPLICATION (application), |
| 305 | ++ G_MENU_MODEL (gtk_builder_get_object (builder, |
| 306 | ++ "app-menu"))); |
| 307 | ++ } else { |
| 308 | ++ g_critical ("Unable to add the application menu: %s\n", error->message); |
| 309 | ++ g_error_free (error); |
| 310 | ++ } |
| 311 | ++ } |
| 312 | ++ else { |
| 313 | ++ gtk_builder_add_from_resource (builder, |
| 314 | ++ "/org/gnome/eog/ui/eog-menubar.xml", |
| 315 | ++ &error); |
| 316 | ++ |
| 317 | ++ if (error == NULL) { |
| 318 | ++ gtk_application_set_menubar (GTK_APPLICATION (application), |
| 319 | ++ G_MENU_MODEL (gtk_builder_get_object (builder, |
| 320 | ++ "menubar"))); |
| 321 | ++ } else { |
| 322 | ++ g_critical ("Unable to add the application menu: %s\n", error->message); |
| 323 | ++ g_error_free (error); |
| 324 | ++ } |
| 325 | + } |
| 326 | + |
| 327 | + action = g_action_map_lookup_action (G_ACTION_MAP (application), |
| 328 | +diff --git a/src/eog-window.c b/src/eog-window.c |
| 329 | +index 738213f..ff5762c 100644 |
| 330 | +--- a/src/eog-window.c |
| 331 | ++++ b/src/eog-window.c |
| 332 | +@@ -4266,18 +4266,30 @@ eog_window_construct_ui (EogWindow *window) |
| 333 | + priv->zoom_scale); |
| 334 | + gtk_widget_show (priv->zoom_scale); |
| 335 | + |
| 336 | +- menu_button = gtk_menu_button_new (); |
| 337 | +- menu_image = gtk_image_new_from_icon_name ("open-menu-symbolic", |
| 338 | +- GTK_ICON_SIZE_BUTTON); |
| 339 | +- gtk_button_set_image (GTK_BUTTON (menu_button), menu_image); |
| 340 | ++ priv->open_with_menu = g_menu_new (); |
| 341 | ++ priv->appinfo = g_ptr_array_new_with_free_func (g_object_unref); |
| 342 | ++ |
| 343 | ++ if (gtk_application_prefers_app_menu (GTK_APPLICATION (EOG_APP))) { |
| 344 | ++ menu_button = gtk_menu_button_new (); |
| 345 | ++ menu_image = gtk_image_new_from_icon_name ("open-menu-symbolic", |
| 346 | ++ GTK_ICON_SIZE_BUTTON); |
| 347 | ++ gtk_button_set_image (GTK_BUTTON (menu_button), menu_image); |
| 348 | ++ |
| 349 | ++ builder = gtk_builder_new_from_resource ("/org/gnome/eog/ui/eog-gear-menu.ui"); |
| 350 | ++ builder_object = gtk_builder_get_object (builder, "gear-menu"); |
| 351 | ++ gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button), |
| 352 | ++ G_MENU_MODEL (builder_object)); |
| 353 | + |
| 354 | +- builder = gtk_builder_new_from_resource ("/org/gnome/eog/ui/eog-gear-menu.ui"); |
| 355 | +- builder_object = gtk_builder_get_object (builder, "gear-menu"); |
| 356 | +- gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button), |
| 357 | +- G_MENU_MODEL (builder_object)); |
| 358 | ++ gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), menu_button); |
| 359 | ++ gtk_widget_show (menu_button); |
| 360 | + |
| 361 | +- gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), menu_button); |
| 362 | +- gtk_widget_show (menu_button); |
| 363 | ++ builder_object = gtk_builder_get_object (builder, "open-with-menu"); |
| 364 | ++ g_menu_append_section (G_MENU (builder_object), |
| 365 | ++ NULL, |
| 366 | ++ G_MENU_MODEL (priv->open_with_menu)); |
| 367 | ++ priv->gear_menu_builder = builder; |
| 368 | ++ builder = NULL; |
| 369 | ++ } |
| 370 | + |
| 371 | + fullscreen_button = gtk_button_new_from_icon_name ("view-fullscreen-symbolic", |
| 372 | + GTK_ICON_SIZE_BUTTON); |
| 373 | +@@ -4288,15 +4300,6 @@ eog_window_construct_ui (EogWindow *window) |
| 374 | + gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), fullscreen_button); |
| 375 | + gtk_widget_show (fullscreen_button); |
| 376 | + |
| 377 | +- priv->open_with_menu = g_menu_new (); |
| 378 | +- priv->appinfo = g_ptr_array_new_with_free_func (g_object_unref); |
| 379 | +- builder_object = gtk_builder_get_object (builder, "open-with-menu"); |
| 380 | +- g_menu_append_section (G_MENU (builder_object), |
| 381 | +- NULL, |
| 382 | +- G_MENU_MODEL (priv->open_with_menu)); |
| 383 | +- priv->gear_menu_builder = builder; |
| 384 | +- builder = NULL; |
| 385 | +- |
| 386 | + priv->cbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); |
| 387 | + gtk_box_pack_start (GTK_BOX (priv->box), priv->cbox, TRUE, TRUE, 0); |
| 388 | + gtk_widget_show (priv->cbox); |
| 389 | +@@ -5241,6 +5244,9 @@ eog_window_get_gear_menu_section (EogWindow *window, const gchar *id) |
| 390 | + GObject *object; |
| 391 | + g_return_val_if_fail (EOG_IS_WINDOW (window), NULL); |
| 392 | + |
| 393 | ++ if (window->priv->gear_menu_builder == NULL) |
| 394 | ++ return NULL; |
| 395 | ++ |
| 396 | + object = gtk_builder_get_object (window->priv->gear_menu_builder, id); |
| 397 | + if (object == NULL || !G_IS_MENU (object)) |
| 398 | + return NULL; |
| 399 | +diff --git a/src/eog.gresource.xml b/src/eog.gresource.xml |
| 400 | +index 0f69c90..9f6bc43 100644 |
| 401 | +--- a/src/eog.gresource.xml |
| 402 | ++++ b/src/eog.gresource.xml |
| 403 | +@@ -3,6 +3,7 @@ |
| 404 | + <gresource prefix="/org/gnome/eog/ui"> |
| 405 | + <file>eog.css</file> |
| 406 | + <file compressed="true" preprocess="xml-stripblanks">eog-app-menu.xml</file> |
| 407 | ++ <file compressed="true" preprocess="xml-stripblanks">eog-menubar.xml</file> |
| 408 | + <file compressed="true" preprocess="xml-stripblanks">eog-gear-menu.ui</file> |
| 409 | + <file compressed="true" preprocess="xml-stripblanks">eog-image-properties-dialog.ui</file> |
| 410 | + <file compressed="true" preprocess="xml-stripblanks">eog-multiple-save-as-dialog.ui</file> |
| 411 | +-- |
| 412 | +2.5.0 |
| 413 | + |
| 414 | |
| 415 | === added file 'debian/patches/0002-Show-traditional-title-bar-in-unity.patch' |
| 416 | --- debian/patches/0002-Show-traditional-title-bar-in-unity.patch 1970-01-01 00:00:00 +0000 |
| 417 | +++ debian/patches/0002-Show-traditional-title-bar-in-unity.patch 2015-09-29 10:38:28 +0000 |
| 418 | @@ -0,0 +1,139 @@ |
| 419 | +From fd12d0136bfd9abc8a121f47775c2200237e535f Mon Sep 17 00:00:00 2001 |
| 420 | +From: Lars Uebernickel <lars.uebernickel@canonical.com> |
| 421 | +Date: Tue, 29 Sep 2015 12:25:29 +0200 |
| 422 | +Subject: [PATCH 2/2] Show traditional title bar in unity |
| 423 | + |
| 424 | +Based on a patch by Sebastien Bacher <seb128@ubuntu.com> |
| 425 | +--- |
| 426 | + src/eog-window.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++---------- |
| 427 | + 1 file changed, 55 insertions(+), 11 deletions(-) |
| 428 | + |
| 429 | +diff --git a/src/eog-window.c b/src/eog-window.c |
| 430 | +index ff5762c..4e3c716 100644 |
| 431 | +--- a/src/eog-window.c |
| 432 | ++++ b/src/eog-window.c |
| 433 | +@@ -134,6 +134,7 @@ struct _EogWindowPrivate { |
| 434 | + GtkWidget *zoom_revealer; |
| 435 | + GtkWidget *zoom_scale; |
| 436 | + GtkWidget *properties_dlg; |
| 437 | ++ GtkWidget *headerbar; |
| 438 | + |
| 439 | + GMenu *open_with_menu; |
| 440 | + GPtrArray *appinfo; |
| 441 | +@@ -4196,6 +4197,43 @@ eog_window_zoom_button_toggled_cb (GtkToggleButton *button, gpointer user_data) |
| 442 | + gtk_button_set_image (GTK_BUTTON (button), zoom_image); |
| 443 | + } |
| 444 | + |
| 445 | ++static gboolean |
| 446 | ++in_desktop (const gchar *name) |
| 447 | ++{ |
| 448 | ++ const gchar *desktop_name_list; |
| 449 | ++ gchar **names; |
| 450 | ++ gboolean in_list = FALSE; |
| 451 | ++ gint i; |
| 452 | ++ |
| 453 | ++ desktop_name_list = g_getenv ("XDG_CURRENT_DESKTOP"); |
| 454 | ++ if (!desktop_name_list) |
| 455 | ++ return FALSE; |
| 456 | ++ |
| 457 | ++ names = g_strsplit (desktop_name_list, ":", -1); |
| 458 | ++ for (i = 0; names[i] && !in_list; i++) |
| 459 | ++ if (strcmp (names[i], name) == 0) { |
| 460 | ++ in_list = TRUE; |
| 461 | ++ break; |
| 462 | ++ } |
| 463 | ++ g_strfreev (names); |
| 464 | ++ |
| 465 | ++ return in_list; |
| 466 | ++} |
| 467 | ++ |
| 468 | ++static void |
| 469 | ++on_action_state_changed (GActionGroup *action_group, |
| 470 | ++ gchar *name, |
| 471 | ++ GVariant *value, |
| 472 | ++ gpointer user_data) |
| 473 | ++{ |
| 474 | ++ EogWindow *window = user_data; |
| 475 | ++ EogWindowPrivate *priv = window->priv; |
| 476 | ++ |
| 477 | ++ gtk_widget_set_visible (GTK_WIDGET (priv->headerbar), |
| 478 | ++ priv->mode != EOG_WINDOW_MODE_FULLSCREEN && |
| 479 | ++ priv->mode != EOG_WINDOW_MODE_SLIDESHOW); |
| 480 | ++} |
| 481 | ++ |
| 482 | + static void |
| 483 | + eog_window_construct_ui (EogWindow *window) |
| 484 | + { |
| 485 | +@@ -4207,7 +4245,6 @@ eog_window_construct_ui (EogWindow *window) |
| 486 | + |
| 487 | + GtkWidget *popup_menu; |
| 488 | + GtkWidget *hpaned; |
| 489 | +- GtkWidget *headerbar; |
| 490 | + GtkWidget *zoom_button; |
| 491 | + GtkWidget *zoom_image; |
| 492 | + GtkWidget *menu_button; |
| 493 | +@@ -4222,12 +4259,19 @@ eog_window_construct_ui (EogWindow *window) |
| 494 | + gtk_container_add (GTK_CONTAINER (window), priv->box); |
| 495 | + gtk_widget_show (priv->box); |
| 496 | + |
| 497 | +- headerbar = gtk_header_bar_new (); |
| 498 | +- gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (headerbar), TRUE); |
| 499 | +- gtk_header_bar_set_title (GTK_HEADER_BAR (headerbar), |
| 500 | +- g_get_application_name ()); |
| 501 | +- gtk_window_set_titlebar (GTK_WINDOW (window), headerbar); |
| 502 | +- gtk_widget_show (headerbar); |
| 503 | ++ priv->headerbar = gtk_header_bar_new (); |
| 504 | ++ if (!in_desktop ("Unity")) { |
| 505 | ++ gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (priv->headerbar), TRUE); |
| 506 | ++ gtk_header_bar_set_title (GTK_HEADER_BAR (priv->headerbar), g_get_application_name ()); |
| 507 | ++ gtk_window_set_titlebar (GTK_WINDOW (window), priv->headerbar); |
| 508 | ++ } else { |
| 509 | ++ gtk_container_add (GTK_CONTAINER (priv->box), priv->headerbar); |
| 510 | ++ |
| 511 | ++ /* Need to hide toolbar when fullscreen (slideshow or normal fullscreen) */ |
| 512 | ++ g_signal_connect (window, "action-state-changed", |
| 513 | ++ G_CALLBACK (on_action_state_changed), window); |
| 514 | ++ } |
| 515 | ++ gtk_widget_show (priv->headerbar); |
| 516 | + |
| 517 | + zoom_button = gtk_toggle_button_new (); |
| 518 | + zoom_image = gtk_image_new_from_icon_name ("zoom-in-symbolic", |
| 519 | +@@ -4238,7 +4282,7 @@ eog_window_construct_ui (EogWindow *window) |
| 520 | + g_signal_connect (zoom_button, "toggled", |
| 521 | + G_CALLBACK (eog_window_zoom_button_toggled_cb), |
| 522 | + window); |
| 523 | +- gtk_header_bar_pack_start (GTK_HEADER_BAR (headerbar), zoom_button); |
| 524 | ++ gtk_header_bar_pack_start (GTK_HEADER_BAR (priv->headerbar), zoom_button); |
| 525 | + /* disable zoom button if no image is loaded */ |
| 526 | + g_object_bind_property (g_action_map_lookup_action (G_ACTION_MAP(window), |
| 527 | + "zoom-normal"), |
| 528 | +@@ -4249,7 +4293,7 @@ eog_window_construct_ui (EogWindow *window) |
| 529 | + priv->zoom_revealer = gtk_revealer_new (); |
| 530 | + gtk_revealer_set_transition_type (GTK_REVEALER (priv->zoom_revealer), |
| 531 | + GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT); |
| 532 | +- gtk_header_bar_pack_start (GTK_HEADER_BAR (headerbar), |
| 533 | ++ gtk_header_bar_pack_start (GTK_HEADER_BAR (priv->headerbar), |
| 534 | + priv->zoom_revealer); |
| 535 | + gtk_widget_show (priv->zoom_revealer); |
| 536 | + |
| 537 | +@@ -4280,7 +4324,7 @@ eog_window_construct_ui (EogWindow *window) |
| 538 | + gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button), |
| 539 | + G_MENU_MODEL (builder_object)); |
| 540 | + |
| 541 | +- gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), menu_button); |
| 542 | ++ gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->headerbar), menu_button); |
| 543 | + gtk_widget_show (menu_button); |
| 544 | + |
| 545 | + builder_object = gtk_builder_get_object (builder, "open-with-menu"); |
| 546 | +@@ -4297,7 +4341,7 @@ eog_window_construct_ui (EogWindow *window) |
| 547 | + "win.view-fullscreen"); |
| 548 | + gtk_widget_set_tooltip_text(fullscreen_button, |
| 549 | + _("Show the current image in fullscreen mode")); |
| 550 | +- gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), fullscreen_button); |
| 551 | ++ gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->headerbar), fullscreen_button); |
| 552 | + gtk_widget_show (fullscreen_button); |
| 553 | + |
| 554 | + priv->cbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); |
| 555 | +-- |
| 556 | +2.5.0 |
| 557 | + |
| 558 | |
| 559 | === removed file 'debian/patches/disable-appmenu-when-not-needed.patch' |
| 560 | --- debian/patches/disable-appmenu-when-not-needed.patch 2015-09-21 10:53:08 +0000 |
| 561 | +++ debian/patches/disable-appmenu-when-not-needed.patch 1970-01-01 00:00:00 +0000 |
| 562 | @@ -1,33 +0,0 @@ |
| 563 | -Description: Disables the application menu on platforms that show an app menu |
| 564 | - and a menubar (such as unity). The menubar already contains all the actions of |
| 565 | - the appmenu. Having both is redundant. |
| 566 | -Forwarded: doesn't make sense upstream until eog is ported to GMenuModel |
| 567 | -Author: Lars Uebernickel <lars.uebernickel@canonical.com> |
| 568 | -Index: eog-3.16.3/src/eog-application.c |
| 569 | -=================================================================== |
| 570 | ---- eog-3.16.3.orig/src/eog-application.c 2015-08-20 23:52:05.472049295 +0200 |
| 571 | -+++ eog-3.16.3/src/eog-application.c 2015-08-20 23:52:05.472049295 +0200 |
| 572 | -@@ -291,6 +291,8 @@ |
| 573 | - GFile *css_file; |
| 574 | - GtkSettings *settings; |
| 575 | - GtkCssProvider *provider; |
| 576 | -+ gboolean shows_app_menu; |
| 577 | -+ gboolean shows_menubar; |
| 578 | - |
| 579 | - G_APPLICATION_CLASS (eog_application_parent_class)->startup (application); |
| 580 | - |
| 581 | -@@ -330,7 +332,13 @@ |
| 582 | - "gtk-application-prefer-dark-theme", TRUE, |
| 583 | - NULL); |
| 584 | - |
| 585 | -- eog_application_init_app_menu (app); |
| 586 | -+ g_object_get (gtk_settings_get_default (), |
| 587 | -+ "gtk-shell-shows-app-menu", &shows_app_menu, |
| 588 | -+ "gtk-shell-shows-menubar", &shows_menubar, |
| 589 | -+ NULL); |
| 590 | -+ |
| 591 | -+ if (shows_app_menu && !shows_menubar) |
| 592 | -+ eog_application_init_app_menu (EOG_APPLICATION (application)); |
| 593 | - eog_application_init_accelerators (GTK_APPLICATION (app)); |
| 594 | - |
| 595 | - app->priv->extensions = peas_extension_set_new ( |
| 596 | |
| 597 | === modified file 'debian/patches/series' |
| 598 | --- debian/patches/series 2015-05-27 16:03:38 +0000 |
| 599 | +++ debian/patches/series 2015-09-29 10:38:28 +0000 |
| 600 | @@ -1,3 +1,2 @@ |
| 601 | -disable-appmenu-when-not-needed.patch |
| 602 | -unity_traditional_titlebar.patch |
| 603 | - |
| 604 | +0001-Add-a-traditional-menu-bar.patch |
| 605 | +0002-Show-traditional-title-bar-in-unity.patch |
| 606 | |
| 607 | === removed file 'debian/patches/unity_traditional_titlebar.patch' |
| 608 | --- debian/patches/unity_traditional_titlebar.patch 2015-09-21 10:57:41 +0000 |
| 609 | +++ debian/patches/unity_traditional_titlebar.patch 1970-01-01 00:00:00 +0000 |
| 610 | @@ -1,140 +0,0 @@ |
| 611 | -# Description: Show traditional titlebar under unity |
| 612 | -# Upstream: https://bugzilla.gnome.org/show_bug.cgi?id=749976 |
| 613 | -# |
| 614 | -Index: b/src/eog-window.c |
| 615 | -=================================================================== |
| 616 | ---- a/src/eog-window.c |
| 617 | -+++ b/src/eog-window.c |
| 618 | -@@ -130,6 +130,7 @@ |
| 619 | - GtkWidget *thumbview; |
| 620 | - GtkWidget *statusbar; |
| 621 | - GtkWidget *nav; |
| 622 | -+ GtkWidget *headerbar; |
| 623 | - GtkWidget *message_area; |
| 624 | - GtkWidget *zoom_revealer; |
| 625 | - GtkWidget *zoom_scale; |
| 626 | -@@ -4196,6 +4197,42 @@ |
| 627 | - gtk_button_set_image (GTK_BUTTON (button), zoom_image); |
| 628 | - } |
| 629 | - |
| 630 | -+static gboolean |
| 631 | -+in_desktop (const gchar *name) |
| 632 | -+{ |
| 633 | -+ const gchar *desktop_name_list; |
| 634 | -+ gchar **names; |
| 635 | -+ gboolean in_list = FALSE; |
| 636 | -+ gint i; |
| 637 | -+ |
| 638 | -+ desktop_name_list = g_getenv ("XDG_CURRENT_DESKTOP"); |
| 639 | -+ if (!desktop_name_list) |
| 640 | -+ return FALSE; |
| 641 | -+ |
| 642 | -+ names = g_strsplit (desktop_name_list, ":", -1); |
| 643 | -+ for (i = 0; names[i] && !in_list; i++) |
| 644 | -+ if (strcmp (names[i], name) == 0) { |
| 645 | -+ in_list = TRUE; |
| 646 | -+ break; |
| 647 | -+ } |
| 648 | -+ g_strfreev (names); |
| 649 | -+ |
| 650 | -+ return in_list; |
| 651 | -+} |
| 652 | -+ |
| 653 | -+static void |
| 654 | -+on_action_state_changed (GObject *object G_GNUC_UNUSED, |
| 655 | -+ GParamSpec *pspec G_GNUC_UNUSED, |
| 656 | -+ gpointer user_data) |
| 657 | -+{ |
| 658 | -+ EogWindow *window = EOG_WINDOW (user_data); |
| 659 | -+ EogWindowPrivate *priv = window->priv; |
| 660 | -+ |
| 661 | -+ gtk_widget_set_visible (GTK_WIDGET (priv->headerbar), |
| 662 | -+ priv->mode != EOG_WINDOW_MODE_FULLSCREEN && |
| 663 | -+ priv->mode != EOG_WINDOW_MODE_SLIDESHOW); |
| 664 | -+} |
| 665 | -+ |
| 666 | - static void |
| 667 | - eog_window_construct_ui (EogWindow *window) |
| 668 | - { |
| 669 | -@@ -4207,7 +4244,6 @@ |
| 670 | - |
| 671 | - GtkWidget *popup_menu; |
| 672 | - GtkWidget *hpaned; |
| 673 | -- GtkWidget *headerbar; |
| 674 | - GtkWidget *zoom_button; |
| 675 | - GtkWidget *zoom_image; |
| 676 | - GtkWidget *menu_button; |
| 677 | -@@ -4222,12 +4258,31 @@ |
| 678 | - gtk_container_add (GTK_CONTAINER (window), priv->box); |
| 679 | - gtk_widget_show (priv->box); |
| 680 | - |
| 681 | -- headerbar = gtk_header_bar_new (); |
| 682 | -- gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (headerbar), TRUE); |
| 683 | -- gtk_header_bar_set_title (GTK_HEADER_BAR (headerbar), |
| 684 | -- g_get_application_name ()); |
| 685 | -- gtk_window_set_titlebar (GTK_WINDOW (window), headerbar); |
| 686 | -- gtk_widget_show (headerbar); |
| 687 | -+ priv->headerbar = gtk_header_bar_new (); |
| 688 | -+ if (!in_desktop ("Unity")) { |
| 689 | -+ gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (priv->headerbar), |
| 690 | -+ TRUE); |
| 691 | -+ gtk_header_bar_set_title (GTK_HEADER_BAR (priv->headerbar), |
| 692 | -+ g_get_application_name ()); |
| 693 | -+ gtk_window_set_titlebar (GTK_WINDOW (window), priv->headerbar); |
| 694 | -+ } else { |
| 695 | -+ gtk_container_add (GTK_CONTAINER (priv->box), priv->headerbar); |
| 696 | -+ |
| 697 | -+ /* Need to hide toolbar when fullscreen (slideshow or normal fullscreen) */ |
| 698 | -+ action = g_action_map_lookup_action (G_ACTION_MAP (window), |
| 699 | -+ "view-fullscreen"); |
| 700 | -+ g_signal_connect (action, |
| 701 | -+ "notify::state", |
| 702 | -+ G_CALLBACK (on_action_state_changed), |
| 703 | -+ window); |
| 704 | -+ action = g_action_map_lookup_action (G_ACTION_MAP (window), |
| 705 | -+ "view-slideshow"); |
| 706 | -+ g_signal_connect (action, |
| 707 | -+ "notify::state", |
| 708 | -+ G_CALLBACK (on_action_state_changed), |
| 709 | -+ window); |
| 710 | -+ } |
| 711 | -+ gtk_widget_show (priv->headerbar); |
| 712 | - |
| 713 | - zoom_button = gtk_toggle_button_new (); |
| 714 | - zoom_image = gtk_image_new_from_icon_name ("zoom-in-symbolic", |
| 715 | -@@ -4238,7 +4293,7 @@ |
| 716 | - g_signal_connect (zoom_button, "toggled", |
| 717 | - G_CALLBACK (eog_window_zoom_button_toggled_cb), |
| 718 | - window); |
| 719 | -- gtk_header_bar_pack_start (GTK_HEADER_BAR (headerbar), zoom_button); |
| 720 | -+ gtk_header_bar_pack_start (GTK_HEADER_BAR (priv->headerbar), zoom_button); |
| 721 | - /* disable zoom button if no image is loaded */ |
| 722 | - g_object_bind_property (g_action_map_lookup_action (G_ACTION_MAP(window), |
| 723 | - "zoom-normal"), |
| 724 | -@@ -4249,7 +4304,7 @@ |
| 725 | - priv->zoom_revealer = gtk_revealer_new (); |
| 726 | - gtk_revealer_set_transition_type (GTK_REVEALER (priv->zoom_revealer), |
| 727 | - GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT); |
| 728 | -- gtk_header_bar_pack_start (GTK_HEADER_BAR (headerbar), |
| 729 | -+ gtk_header_bar_pack_start (GTK_HEADER_BAR (priv->headerbar), |
| 730 | - priv->zoom_revealer); |
| 731 | - gtk_widget_show (priv->zoom_revealer); |
| 732 | - |
| 733 | -@@ -4276,7 +4331,7 @@ |
| 734 | - gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button), |
| 735 | - G_MENU_MODEL (builder_object)); |
| 736 | - |
| 737 | -- gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), menu_button); |
| 738 | -+ gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->headerbar), menu_button); |
| 739 | - gtk_widget_show (menu_button); |
| 740 | - |
| 741 | - fullscreen_button = gtk_button_new_from_icon_name ("view-fullscreen-symbolic", |
| 742 | -@@ -4285,7 +4340,7 @@ |
| 743 | - "win.view-fullscreen"); |
| 744 | - gtk_widget_set_tooltip_text(fullscreen_button, |
| 745 | - _("Show the current image in fullscreen mode")); |
| 746 | -- gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), fullscreen_button); |
| 747 | -+ gtk_header_bar_pack_end (GTK_HEADER_BAR (priv->headerbar), fullscreen_button); |
| 748 | - gtk_widget_show (fullscreen_button); |
| 749 | - |
| 750 | - priv->open_with_menu = g_menu_new (); |
