Merge lp:~meese/pantheon-photos/kill-menubar into lp:~pantheon-photos/pantheon-photos/trunk

Proposed by meese
Status: Merged
Approved by: meese
Approved revision: 2613
Merged at revision: 2620
Proposed branch: lp:~meese/pantheon-photos/kill-menubar
Merge into: lp:~pantheon-photos/pantheon-photos/trunk
Diff against target: 520 lines (+63/-209)
15 files modified
src/AppWindow.vala (+21/-14)
src/CollectionPage.vala (+0/-7)
src/Page.vala (+0/-7)
src/direct/DirectPhotoPage.vala (+2/-2)
src/direct/DirectWindow.vala (+11/-1)
src/library/LibraryWindow.vala (+29/-13)
ui/direct.ui (+0/-17)
ui/event.ui (+0/-4)
ui/events_directory.ui (+0/-19)
ui/import.ui (+0/-21)
ui/import_queue.ui (+0/-22)
ui/media.ui (+0/-21)
ui/offline.ui (+0/-23)
ui/photo.ui (+0/-19)
ui/trash.ui (+0/-19)
To merge this branch: bzr merge lp:~meese/pantheon-photos/kill-menubar
Reviewer Review Type Date Requested Status
Viko Adi Rahmawan (community) code Approve
Danielle Foré ux Approve
Photos Devs Pending
Review via email: mp+233107@code.launchpad.net

Commit message

kills menu bar

Description of the change

Kills the menu bar with nonviolent action. Also I put undo and redo up in the header bar because the gear icon looked lonely by itself.

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

peace and love, star child. Perhaps we use color icons for undo and redo instead of symbolic?

2611. By meese

change undo icons to non symbolic and fix menu separator not showing up

Revision history for this message
meese (meese) wrote :

Done! (and I spent 20 minutes trying to figure out why the menu separator was deciding not to show up... of course menu.show_all () needed to be called, there will be no love for GTK)

2612. By meese

fix ui file

Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

as we've move about menuitem to the quicklist, should we remove it too from the gear button?

Revision history for this message
Danielle Foré (danrabbit) wrote :

Yes we should remove it from the gear button

2613. By meese

remove about from gear menu

Revision history for this message
meese (meese) wrote :

fixed

Revision history for this message
Danielle Foré (danrabbit) wrote :

I'm good with this :)

review: Approve (ux)
Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

for me, the code is good

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/AppWindow.vala'
2--- src/AppWindow.vala 2014-08-08 21:13:09 +0000
3+++ src/AppWindow.vala 2014-09-05 23:00:47 +0000
4@@ -434,6 +434,7 @@
5 protected Dimensions dimensions;
6 protected int pos_x = 0;
7 protected int pos_y = 0;
8+ protected Gtk.HeaderBar header;
9
10 private Gtk.ActionGroup common_action_group = new Gtk.ActionGroup ("AppWindowGlobalActionGroup");
11
12@@ -442,10 +443,8 @@
13 assert (instance == null);
14 instance = this;
15
16- var header = new Gtk.HeaderBar ();
17+ header = new Gtk.HeaderBar ();
18 header.set_show_close_button (true);
19- header.get_style_context ().remove_class ("header-bar");
20-
21 this.set_titlebar (header);
22
23 title = _ (Resources.APP_TITLE);
24@@ -489,6 +488,20 @@
25
26 ui.ensure_update ();
27 add_accel_group (ui.get_accel_group ());
28+
29+ build_header_bar ();
30+ }
31+
32+ protected virtual void build_header_bar () {
33+ var undo_action = get_common_action ("CommonUndo");
34+ var undo_btn = undo_action.create_tool_item ();
35+ undo_btn.sensitive = true;
36+ header.pack_start (undo_btn);
37+
38+ var redo_action = get_common_action ("CommonRedo");
39+ var redo_btn = redo_action.create_tool_item ();
40+ redo_btn.sensitive = true;
41+ header.pack_start (redo_btn);
42 }
43
44 private Gtk.ActionEntry[] create_common_actions () {
45@@ -500,25 +513,19 @@
46 quit.label = _ ("_Quit");
47 actions += quit;
48
49- Gtk.ActionEntry about = { "CommonAbout", Gtk.Stock.ABOUT, TRANSLATABLE, null,
50- TRANSLATABLE, on_about
51- };
52- about.label = _ ("_About");
53- actions += about;
54-
55 Gtk.ActionEntry fullscreen = { "CommonFullscreen", Gtk.Stock.FULLSCREEN,
56 TRANSLATABLE, "F11", TRANSLATABLE, on_fullscreen
57 };
58 fullscreen.label = _ ("Fulls_creen");
59 actions += fullscreen;
60
61- Gtk.ActionEntry undo = { "CommonUndo", Gtk.Stock.UNDO, TRANSLATABLE, "<Ctrl>Z",
62+ Gtk.ActionEntry undo = { "CommonUndo", "edit-undo", TRANSLATABLE, "<Ctrl>Z",
63 TRANSLATABLE, on_undo
64 };
65 undo.label = Resources.UNDO_MENU;
66 actions += undo;
67
68- Gtk.ActionEntry redo = { "CommonRedo", Gtk.Stock.REDO, TRANSLATABLE, "<Ctrl><Shift>Z",
69+ Gtk.ActionEntry redo = { "CommonRedo", "edit-redo", TRANSLATABLE, "<Ctrl><Shift>Z",
70 TRANSLATABLE, on_redo
71 };
72 redo.label = Resources.REDO_MENU;
73@@ -870,7 +877,7 @@
74
75 if (desc != null) {
76 action.label = "%s %s".printf (prefix, desc.get_name ());
77- action.tooltip = desc.get_explanation ();
78+ action.tooltip = action.label;
79 action.sensitive = true;
80 } else {
81 action.label = prefix;
82@@ -880,12 +887,12 @@
83 }
84
85 public void decorate_undo_action () {
86- decorate_command_manager_action ("CommonUndo", Resources.UNDO_MENU, "",
87+ decorate_command_manager_action ("CommonUndo", Resources.UNDO_LABEL, "",
88 get_command_manager ().get_undo_description ());
89 }
90
91 public void decorate_redo_action () {
92- decorate_command_manager_action ("CommonRedo", Resources.REDO_MENU, "",
93+ decorate_command_manager_action ("CommonRedo", Resources.REDO_LABEL, "",
94 get_command_manager ().get_redo_description ());
95 }
96
97
98=== modified file 'src/CollectionPage.vala'
99--- src/CollectionPage.vala 2014-08-28 14:41:02 +0000
100+++ src/CollectionPage.vala 2014-09-05 23:00:47 +0000
101@@ -85,12 +85,6 @@
102 return toolbar;
103 }
104
105- private static InjectionGroup create_file_menu_injectables () {
106- InjectionGroup group = new InjectionGroup ("/MenuBar/FileMenu/FileExtrasPlaceholder");
107-
108- return group;
109- }
110-
111 private static InjectionGroup create_context_menu_injectables () {
112 InjectionGroup group = new InjectionGroup ("/CollectionContextMenu/EditExtrasPlaceholder");
113
114@@ -218,7 +212,6 @@
115 protected override InjectionGroup[] init_collect_injection_groups () {
116 InjectionGroup[] groups = base.init_collect_injection_groups ();
117
118- groups += create_file_menu_injectables ();
119 groups += create_context_menu_injectables ();
120 groups += create_view_menu_fullscreen_injectables ();
121
122
123=== modified file 'src/Page.vala'
124--- src/Page.vala 2014-08-27 23:59:02 +0000
125+++ src/Page.vala 2014-09-05 23:00:47 +0000
126@@ -264,13 +264,6 @@
127 return event_source;
128 }
129
130- public virtual Gtk.MenuBar get_menubar () {
131- Gtk.MenuBar? menubar = ui.get_widget ("/MenuBar") as Gtk.MenuBar;
132- assert (menubar != null);
133-
134- return menubar;
135- }
136-
137 public virtual unowned Gtk.Widget get_page_ui_widget (string path) {
138 return ui.get_widget (path);
139 }
140
141=== modified file 'src/direct/DirectPhotoPage.vala'
142--- src/direct/DirectPhotoPage.vala 2014-08-25 06:04:50 +0000
143+++ src/direct/DirectPhotoPage.vala 2014-09-05 23:00:47 +0000
144@@ -47,14 +47,14 @@
145 file.label = _ ("_File");
146 actions += file;
147
148- Gtk.ActionEntry save = { "Save", Gtk.Stock.SAVE, TRANSLATABLE, "<Ctrl>S", TRANSLATABLE,
149+ Gtk.ActionEntry save = { "Save", "document-save", TRANSLATABLE, "<Ctrl>S", TRANSLATABLE,
150 on_save
151 };
152 save.label = _ ("_Save");
153 save.tooltip = _ ("Save photo");
154 actions += save;
155
156- Gtk.ActionEntry save_as = { "SaveAs", Gtk.Stock.SAVE_AS, TRANSLATABLE,
157+ Gtk.ActionEntry save_as = { "SaveAs", "document-save-as", TRANSLATABLE,
158 "<Ctrl><Shift>S", TRANSLATABLE, on_save_as
159 };
160 save_as.label = _ ("Save _As...");
161
162=== modified file 'src/direct/DirectWindow.vala'
163--- src/direct/DirectWindow.vala 2014-08-08 21:13:09 +0000
164+++ src/direct/DirectWindow.vala 2014-09-05 23:00:47 +0000
165@@ -21,11 +21,21 @@
166 // simple layout: menu on top, photo in center, toolbar along bottom (mimicking the
167 // PhotoPage in the library, but without the sidebar)
168 Gtk.Box layout = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
169- layout.pack_start (direct_photo_page.get_menubar (), false, false, 0);
170 layout.pack_start (direct_photo_page, true, true, 0);
171 layout.pack_end (direct_photo_page.get_toolbar (), false, false, 0);
172
173 add (layout);
174+ header.pack_start (new Gtk.Separator (Gtk.Orientation.VERTICAL));
175+
176+ var save_action = get_direct_page ().get_action ("Save");
177+ var save_btn = save_action.create_tool_item ();
178+ save_btn.sensitive = true;
179+ header.pack_start (save_btn);
180+
181+ var save_as_action = get_direct_page ().get_action ("SaveAs");
182+ var save_as_btn = save_as_action.create_tool_item ();
183+ save_as_btn.sensitive = true;
184+ header.pack_start (save_as_btn);
185 }
186
187 public static DirectWindow get_app () {
188
189=== modified file 'src/library/LibraryWindow.vala'
190--- src/library/LibraryWindow.vala 2014-08-28 06:02:48 +0000
191+++ src/library/LibraryWindow.vala 2014-09-05 23:00:47 +0000
192@@ -187,13 +187,6 @@
193 error (e.message);
194 }
195
196- Gtk.MenuBar? menubar = ui.get_widget ("/MenuBar") as Gtk.MenuBar;
197- layout.add (menubar);
198-
199- // We never want to invoke show_all () on the menubar since that will show empty menus,
200- // which should be hidden.
201- menubar.no_show_all = true;
202-
203 // create the main layout & start at the Library page
204 create_layout (library_branch.photos_entry.get_page ());
205
206@@ -229,6 +222,29 @@
207
208 background_progress_bar.set_show_text (true);
209
210+ build_settings_header ();
211+ }
212+
213+ protected void build_settings_header () {
214+ var settings_menu = new Gtk.Menu ();
215+
216+ var import_action = get_common_action ("CommonFileImport");
217+ settings_menu.add (import_action.create_menu_item ());
218+
219+ var sep = new Gtk.SeparatorMenuItem ();
220+ settings_menu.add (sep);
221+
222+ var pref_action = get_common_action ("CommonPreferences");
223+ settings_menu.add (pref_action.create_menu_item ());
224+
225+ settings_menu.show_all ();
226+
227+ var settings = new Gtk.MenuButton ();
228+ settings.image = new Gtk.Image.from_icon_name ("document-properties", Gtk.IconSize.LARGE_TOOLBAR);
229+ settings.set_tooltip_text (_ ("Settings"));
230+ settings.popup = settings_menu;
231+ settings.show_all ();
232+ header.pack_end (settings);
233 }
234
235 ~LibraryWindow () {
236@@ -374,11 +390,11 @@
237 };
238 sidebar.label = _ ("S_idebar");
239 sidebar.tooltip = _ ("Display the sidebar");
240- actions += sidebar;
241+ actions += sidebar;
242
243 Gtk.ToggleActionEntry meta_sidebar = { "CommonDisplayMetadataSidebar", null, TRANSLATABLE,
244- "F10", TRANSLATABLE, on_display_metadata_sidebar, is_metadata_sidebar_visible ()
245- };
246+ "F10", TRANSLATABLE, on_display_metadata_sidebar, is_metadata_sidebar_visible ()
247+ };
248 meta_sidebar.label = _ ("Edit Photo In_fo");
249 actions += meta_sidebar;
250
251@@ -788,7 +804,7 @@
252 private void on_display_sidebar (Gtk.Action action) {
253 set_sidebar_visible (((Gtk.ToggleAction) action).get_active ());
254
255- }
256+ }
257
258 private void on_display_metadata_sidebar (Gtk.Action action) {
259 set_metadata_sidebar_visible (((Gtk.ToggleAction) action).get_active ());
260@@ -1245,7 +1261,7 @@
261 client_paned.pack2 (right_frame, true, false);
262 client_paned.set_position (Config.Facade.get_instance ().get_sidebar_position ());
263
264- int metadata_sidebar_pos = Config.Facade.get_instance ().get_metadata_sidebar_position ();
265+ int metadata_sidebar_pos = Config.Facade.get_instance ().get_metadata_sidebar_position ();
266 if (metadata_sidebar_pos > 0)
267 right_client_paned.set_position (metadata_sidebar_pos);
268
269@@ -1523,4 +1539,4 @@
270
271 return false;
272 }
273-}
274+}
275\ No newline at end of file
276
277=== modified file 'ui/direct.ui'
278--- ui/direct.ui 2014-08-25 06:55:28 +0000
279+++ ui/direct.ui 2014-09-05 23:00:47 +0000
280@@ -1,21 +1,4 @@
281 <ui>
282-
283- <menubar name="MenuBar">
284- <menu name="FileMenu" action="FileMenu">
285- <menuitem name="Save" action="Save" />
286- <menuitem name="SaveAs" action="SaveAs" />
287- </menu>
288-
289- <menu name="EditMenu" action="EditMenu">
290- <menuitem name="Undo" action="CommonUndo" />
291- <menuitem name="Redo" action="CommonRedo" />
292- </menu>
293-
294- <menu name="HelpMenu" action="HelpMenu">
295- <menuitem name="About" action="CommonAbout" />
296- </menu>
297- </menubar>
298-
299 <popup name="DirectContextMenu">
300 <placeholder name="ContextJumpPlaceholder">
301 <menuitem name="ContextJumpToFile" action="CommonJumpToFile" />
302
303=== modified file 'ui/event.ui'
304--- ui/event.ui 2014-08-25 06:55:28 +0000
305+++ ui/event.ui 2014-09-05 23:00:47 +0000
306@@ -1,8 +1,4 @@
307 <ui>
308-
309- <menubar name="MenuBar">
310- </menubar>
311-
312 <popup name="CollectionContextMenu">
313 <separator />
314 <menuitem name="ContextMakePrimary" action="MakePrimary" />
315
316=== modified file 'ui/events_directory.ui'
317--- ui/events_directory.ui 2014-08-27 12:43:58 +0000
318+++ ui/events_directory.ui 2014-09-05 23:00:47 +0000
319@@ -1,23 +1,4 @@
320 <ui>
321-
322- <menubar name="MenuBar">
323- <menu name="FileMenu" action="FileMenu">
324- <menuitem name="Import" action="CommonFileImport" />
325- <menuitem name="ImportExternal" action="ExternalLibraryImport" />
326- </menu>
327-
328- <menu name="EditMenu" action="EditMenu">
329- <menuitem name="Undo" action="CommonUndo" />
330- <menuitem name="Redo" action="CommonRedo" />
331- <separator />
332- <menuitem name="Preferences" action="CommonPreferences" />
333- </menu>
334-
335- <menu name="HelpMenu" action="HelpMenu">
336- <menuitem name="About" action="CommonAbout" />
337- </menu>
338- </menubar>
339-
340 <popup name="EventsDirectoryContextMenu">
341 <menuitem name="ContextMerge" action="Merge" />
342 <menuitem name="ContextRename" action="Rename" />
343
344=== modified file 'ui/import.ui'
345--- ui/import.ui 2014-08-27 12:43:58 +0000
346+++ ui/import.ui 2014-09-05 23:00:47 +0000
347@@ -1,25 +1,4 @@
348 <ui>
349-
350- <menubar name="MenuBar">
351- <menu name="FileMenu" action="FileMenu">
352- <menuitem name="Import" action="CommonFileImport" />
353- <menuitem name="ImportSelected" action="ImportSelected" />
354- <menuitem name="ImportAll" action="ImportAll" />
355- <menuitem name="ImportExternal" action="ExternalLibraryImport" />
356- </menu>
357-
358- <menu name="EditMenu" action="EditMenu">
359- <menuitem name="Undo" action="CommonUndo" />
360- <menuitem name="Redo" action="CommonRedo" />
361- <separator />
362- <menuitem name="Preferences" action="CommonPreferences" />
363- </menu>
364-
365- <menu name="HelpMenu" action="HelpMenu">
366- <menuitem name="About" action="CommonAbout" />
367- </menu>
368- </menubar>
369-
370 <popup name="ImportContextMenu">
371 <menuitem name="ContextImportSelected" action="ImportSelected" />
372 <menuitem name="ContextImportAll" action="ImportAll" />
373
374=== modified file 'ui/import_queue.ui'
375--- ui/import_queue.ui 2014-08-27 12:43:58 +0000
376+++ ui/import_queue.ui 2014-09-05 23:00:47 +0000
377@@ -1,24 +1,2 @@
378 <ui>
379-
380- <menubar name="MenuBar">
381- <menu name="FileMenu" action="FileMenu">
382- <menuitem name="Stop" action="Stop" />
383- <separator />
384- <menuitem name="Import" action="CommonFileImport" />
385- <menuitem name="ImportExternal" action="ExternalLibraryImport" />
386- <separator />
387- </menu>
388-
389- <menu name="ViewMenu" action="ViewMenu">
390- <menu name="SortEvents" action="CommonSortEvents">
391- <menuitem name="SortEventsAscending" action="CommonSortEventsAscending" />
392- <menuitem name="SortEventsDescending" action="CommonSortEventsDescending" />
393- </menu>
394- </menu>
395-
396- <menu name="HelpMenu" action="HelpMenu">
397- <menuitem name="About" action="CommonAbout" />
398- </menu>
399- </menubar>
400-
401 </ui>
402\ No newline at end of file
403
404=== modified file 'ui/media.ui'
405--- ui/media.ui 2014-08-27 12:43:58 +0000
406+++ ui/media.ui 2014-09-05 23:00:47 +0000
407@@ -1,25 +1,4 @@
408 <ui>
409-
410- <menubar name="MenuBar">
411- <menu name="FileMenu" action="FileMenu">
412- <menuitem name="Import" action="CommonFileImport" />
413- <menuitem name="ImportExternal" action="ExternalLibraryImport" />
414- </menu>
415-
416- <menu name="EditMenu" action="EditMenu">
417- <menuitem name="Undo" action="CommonUndo" />
418- <menuitem name="Redo" action="CommonRedo" />
419- <separator />
420- <menuitem name="Preferences" action="CommonPreferences" />
421- </menu>
422-
423- <placeholder name="FacesMenuPlaceholder" />
424-
425- <menu name="HelpMenu" action="HelpMenu">
426- <menuitem name="About" action="CommonAbout" />
427- </menu>
428- </menubar>
429-
430 <popup name="MediaViewMenu" action="ViewMenu">
431 <menuitem name="DisplaySidebar" action="CommonDisplaySidebar" />
432 <menuitem name="DisplayMetadataSidebar" action="CommonDisplayMetadataSidebar" />
433
434=== modified file 'ui/offline.ui'
435--- ui/offline.ui 2014-08-27 12:43:58 +0000
436+++ ui/offline.ui 2014-09-05 23:00:47 +0000
437@@ -1,27 +1,4 @@
438 <ui>
439-
440- <menubar name="MenuBar">
441- <menu name="FileMenu" action="FileMenu">
442- <menuitem name="Import" action="CommonFileImport" />
443- <menuitem name="ImportExternal" action="ExternalLibraryImport" />
444- <separator />
445- <menuitem name="EmptyTrash" action="CommonEmptyTrash" />
446- <separator />
447- <menuitem name="Quit" action="CommonQuit" />
448- </menu>
449-
450- <menu name="EditMenu" action="EditMenu">
451- <menuitem name="Undo" action="CommonUndo" />
452- <menuitem name="Redo" action="CommonRedo" />
453- <separator />
454- <menuitem name="Preferences" action="CommonPreferences" />
455- </menu>
456-
457- <menu name="HelpMenu" action="HelpMenu">
458- <menuitem name="About" action="CommonAbout" />
459- </menu>
460- </menubar>
461-
462 <popup name="OfflineContextMenu">
463 <menuitem name="RemoveFromLibrary" action="RemoveFromLibrary" />
464 </popup>
465
466=== modified file 'ui/photo.ui'
467--- ui/photo.ui 2014-08-27 12:43:58 +0000
468+++ ui/photo.ui 2014-09-05 23:00:47 +0000
469@@ -1,23 +1,4 @@
470 <ui>
471-
472- <menubar name="MenuBar">
473- <menu name="FileMenu" action="FileMenu">
474- <menuitem name="Import" action="CommonFileImport" />
475- <menuitem name="ImportExternal" action="ExternalLibraryImport" />
476- </menu>
477-
478- <menu name="EditMenu" action="EditMenu">
479- <menuitem name="Undo" action="CommonUndo" />
480- <menuitem name="Redo" action="CommonRedo" />
481- <separator />
482- <menuitem name="Preferences" action="CommonPreferences" />
483- </menu>
484-
485- <menu name="HelpMenu" action="HelpMenu">
486- <menuitem name="About" action="CommonAbout" />
487- </menu>
488- </menubar>
489-
490 <popup name="PhotoContextMenu">
491 <placeholder name="ContextJumpPlaceholder">
492 <menuitem name="ContextJumpToEvent" action="CommonJumpToEvent" />
493
494=== modified file 'ui/trash.ui'
495--- ui/trash.ui 2014-08-28 02:19:38 +0000
496+++ ui/trash.ui 2014-09-05 23:00:47 +0000
497@@ -1,23 +1,4 @@
498 <ui>
499-
500- <menubar name="MenuBar">
501- <menu name="FileMenu" action="FileMenu">
502- <menuitem name="Import" action="CommonFileImport" />
503- <menuitem name="ImportExternal" action="ExternalLibraryImport" />
504- </menu>
505-
506- <menu name="EditMenu" action="EditMenu">
507- <menuitem name="Undo" action="CommonUndo" />
508- <menuitem name="Redo" action="CommonRedo" />
509- <separator />
510- <menuitem name="Preferences" action="CommonPreferences" />
511- </menu>
512-
513- <menu name="HelpMenu" action="HelpMenu">
514- <menuitem name="About" action="CommonAbout" />
515- </menu>
516- </menubar>
517-
518 <popup name="TrashContextMenu">
519 <menuitem name="ContextDelete" action="Delete" />
520 <menuitem name="ContextRestore" action="Restore" />

Subscribers

People subscribed via source and target branches

to all changes: