Merge lp:~nathandyer/pantheon-mail/headerbar-fix into lp:~elementary-apps/pantheon-mail/trunk
- headerbar-fix
- Merge into trunk
Proposed by
Nathan Dyer
Status: | Rejected |
---|---|
Rejected by: | Danielle Foré |
Proposed branch: | lp:~nathandyer/pantheon-mail/headerbar-fix |
Merge into: | lp:~elementary-apps/pantheon-mail/trunk |
Diff against target: |
902 lines (+399/-66) (has conflicts) 11 files modified
src/client/application/geary-controller.vala (+9/-10) src/client/components/main-toolbar.vala (+220/-3) src/client/components/main-window.vala (+18/-14) src/client/components/pill-toolbar.vala (+15/-2) src/client/composer/composer-box.vala (+0/-5) src/client/composer/composer-embed.vala (+1/-0) src/client/composer/composer-headerbar.vala (+48/-4) src/client/composer/composer-toolbar.vala (+69/-9) src/client/composer/composer-widget.vala (+3/-2) src/client/composer/composer-window.vala (+16/-11) src/client/util/util-gtk.vala (+0/-6) Text conflict in src/client/components/main-toolbar.vala Text conflict in src/client/components/main-window.vala Text conflict in src/client/components/pill-toolbar.vala Text conflict in src/client/composer/composer-headerbar.vala Text conflict in src/client/composer/composer-toolbar.vala |
To merge this branch: | bzr merge lp:~nathandyer/pantheon-mail/headerbar-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
kay van der Zander (community) | code | Needs Fixing | |
Danielle Foré | Needs Fixing | ||
Review via email: mp+277934@code.launchpad.net |
Commit message
Description of the change
This moves back to a normal headerbar, adds back the search entry, and removes the search bar from the application.
To post a comment you must log in.
- 1869. By Nathan Dyer <email address hidden>
-
Added send, close, and detach buttons to the primary toolbar and improved the overall compose headerbar support.
Revision history for this message
kay van der Zander (kay20) wrote : | # |
see the diff comments :)
review:
Needs Fixing
(code)
Revision history for this message
kay van der Zander (kay20) wrote : | # |
clean up merging lines
Unmerged revisions
- 1872. By Nathan Dyer <email address hidden>
-
Restored the empty and undo buttons.
- 1871. By Nathan Dyer <email address hidden>
-
Hide detach button when popped out.
- 1870. By Nathan Dyer <email address hidden>
-
Keep the toolbar embedded to match normal composer style when popping out into new window.
- 1869. By Nathan Dyer <email address hidden>
-
Added send, close, and detach buttons to the primary toolbar and improved the overall compose headerbar support.
- 1868. By Nathan Dyer <email address hidden>
-
Additional archive/trash fixes.
- 1867. By Nathan Dyer <email address hidden>
-
Fix the search entry and murder the searchbar.
- 1866. By Nathan Dyer <email address hidden>
-
Back to the good headerbar.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/client/application/geary-controller.vala' |
2 | --- src/client/application/geary-controller.vala 2015-11-18 23:34:21 +0000 |
3 | +++ src/client/application/geary-controller.vala 2015-11-25 01:35:24 +0000 |
4 | @@ -210,7 +210,7 @@ |
5 | main_window.folder_list.move_conversation.connect(on_move_conversation); |
6 | main_window.main_toolbar.copy_folder_menu.folder_selected.connect(on_copy_conversation); |
7 | main_window.main_toolbar.move_folder_menu.folder_selected.connect(on_move_conversation); |
8 | - main_window.search_bar.search_text_changed.connect(on_search_text_changed); |
9 | + main_window.main_toolbar.search_text_changed.connect(on_search_text_changed); |
10 | main_window.conversation_viewer.link_selected.connect(on_link_selected); |
11 | main_window.conversation_viewer.reply_to_message.connect(on_reply_to_message); |
12 | main_window.conversation_viewer.reply_all_message.connect(on_reply_all_message); |
13 | @@ -279,7 +279,7 @@ |
14 | main_window.folder_list.move_conversation.disconnect(on_move_conversation); |
15 | main_window.main_toolbar.copy_folder_menu.folder_selected.disconnect(on_copy_conversation); |
16 | main_window.main_toolbar.move_folder_menu.folder_selected.disconnect(on_move_conversation); |
17 | - main_window.search_bar.search_text_changed.disconnect(on_search_text_changed); |
18 | + main_window.main_toolbar.search_text_changed.disconnect(on_search_text_changed); |
19 | main_window.conversation_viewer.link_selected.disconnect(on_link_selected); |
20 | main_window.conversation_viewer.reply_to_message.disconnect(on_reply_to_message); |
21 | main_window.conversation_viewer.reply_all_message.disconnect(on_reply_all_message); |
22 | @@ -522,7 +522,7 @@ |
23 | // widget |
24 | Gtk.ActionEntry search = { ACTION_SEARCH, null, null, null, null, on_search }; |
25 | entries += search; |
26 | - add_accelerator("<Ctrl>S", ACTION_SEARCH); |
27 | + add_accelerator("<Ctrl>F", ACTION_SEARCH); |
28 | |
29 | Gtk.ActionEntry conversation_list = { ACTION_CONVERSATION_LIST, null, null, null, null, on_conversation_list }; |
30 | entries += conversation_list; |
31 | @@ -1214,7 +1214,7 @@ |
32 | cancel_inbox(account); |
33 | |
34 | previous_non_search_folder = null; |
35 | - main_window.search_bar.set_search_text(""); // Reset search. |
36 | + main_window.main_toolbar.set_search_text(""); // Reset search. |
37 | if (current_account == account) { |
38 | cancel_folder(); |
39 | switch_to_first_inbox(); // Switch folder. |
40 | @@ -1311,7 +1311,7 @@ |
41 | // by other utility methods |
42 | private void update_ui() { |
43 | update_tooltips(); |
44 | - main_window.main_toolbar.update_trash_archive_buttons( |
45 | + main_window.main_toolbar.update_trash_buttons( |
46 | current_folder_supports_trash() || !(current_folder is Geary.FolderSupport.Remove), |
47 | current_account.can_support_archive); |
48 | } |
49 | @@ -1323,7 +1323,6 @@ |
50 | if (folder == null) { |
51 | current_folder = null; |
52 | main_window.conversation_list_store.clear(); |
53 | - main_window.main_toolbar.folder = null; |
54 | folder_selected(null); |
55 | |
56 | return; |
57 | @@ -1722,7 +1721,7 @@ |
58 | private void on_shift_key(bool pressed) { |
59 | if (main_window != null && main_window.main_toolbar != null |
60 | && current_account != null && current_folder != null) { |
61 | - main_window.main_toolbar.update_trash_archive_buttons( |
62 | + main_window.main_toolbar.update_trash_buttons( |
63 | (!pressed && current_folder_supports_trash()) || !(current_folder is Geary.FolderSupport.Remove), |
64 | current_account.can_support_archive); |
65 | } |
66 | @@ -2644,7 +2643,7 @@ |
67 | } |
68 | |
69 | private void on_search() { |
70 | - main_window.search_bar.give_search_focus(); |
71 | + main_window.main_toolbar.give_search_focus(); |
72 | } |
73 | |
74 | private void on_conversation_list() { |
75 | @@ -2810,7 +2809,7 @@ |
76 | cancellable_search); |
77 | |
78 | main_window.folder_list.set_search(folder); |
79 | - search_text_changed(main_window.search_bar.search_text); |
80 | + search_text_changed(main_window.main_toolbar.search_text); |
81 | } |
82 | |
83 | private void on_search_text_changed(string search_text) { |
84 | @@ -2825,7 +2824,7 @@ |
85 | private bool on_search_timeout() { |
86 | search_timeout_id = 0; |
87 | |
88 | - do_search(main_window.search_bar.search_text); |
89 | + do_search(main_window.main_toolbar.search_text); |
90 | |
91 | return false; |
92 | } |
93 | |
94 | === modified file 'src/client/components/main-toolbar.vala' |
95 | --- src/client/components/main-toolbar.vala 2015-11-24 19:48:54 +0000 |
96 | +++ src/client/components/main-toolbar.vala 2015-11-25 01:35:24 +0000 |
97 | @@ -1,13 +1,18 @@ |
98 | -/* Copyright 2011-2015 Yorba Foundation |
99 | +/* Copyright 2011-2014 Yorba Foundation |
100 | * |
101 | * This software is licensed under the GNU Lesser General Public License |
102 | * (version 2.1 or later). See the COPYING file in this distribution. |
103 | */ |
104 | |
105 | // Draws the main toolbar. |
106 | -public class MainToolbar : Gtk.Box { |
107 | +public class MainToolbar : PillHeaderbar { |
108 | + private const string ICON_CLEAR_NAME = "edit-clear"; |
109 | + private const string ICON_CLEAR_RTL_NAME = "edit-clear-rtl"; |
110 | + private const string DEFAULT_SEARCH_TEXT = _("Search"); |
111 | + |
112 | public FolderMenu copy_folder_menu { get; private set; default = new FolderMenu(); } |
113 | public FolderMenu move_folder_menu { get; private set; default = new FolderMenu(); } |
114 | +<<<<<<< TREE |
115 | public string account { get; set; } |
116 | public string folder { get; set; } |
117 | public bool show_close_button { get; set; default = false; } |
118 | @@ -18,11 +23,28 @@ |
119 | |
120 | private PillHeaderbar folder_header; |
121 | private PillHeaderbar conversation_header; |
122 | +======= |
123 | + public string search_text { get { return search_entry.text; } } |
124 | + public bool search_entry_has_focus { get { return search_entry.has_focus; } } |
125 | + |
126 | +>>>>>>> MERGE-SOURCE |
127 | private Gtk.Button archive_button; |
128 | +<<<<<<< TREE |
129 | private Gtk.Button trash_delete_button; |
130 | private Binding guest_header_binding; |
131 | |
132 | +======= |
133 | + private Gtk.Button trash_buttons[2]; |
134 | + private Gtk.SearchEntry search_entry = new Gtk.SearchEntry(); |
135 | + private Geary.ProgressMonitor? search_upgrade_progress_monitor = null; |
136 | + private MonitoredProgressBar search_upgrade_progress_bar = new MonitoredProgressBar(); |
137 | + private Geary.Account? current_account = null; |
138 | + |
139 | + public signal void search_text_changed(string search_text); |
140 | + |
141 | +>>>>>>> MERGE-SOURCE |
142 | public MainToolbar() { |
143 | +<<<<<<< TREE |
144 | Object(orientation: Gtk.Orientation.HORIZONTAL, spacing: 0); |
145 | |
146 | folder_header = new PillHeaderbar(GearyApplication.instance.actions); |
147 | @@ -55,25 +77,60 @@ |
148 | |
149 | bool rtl = get_direction() == Gtk.TextDirection.RTL; |
150 | |
151 | +======= |
152 | + base(GearyApplication.instance.actions); |
153 | + GearyApplication.instance.controller.account_selected.connect(on_account_changed); |
154 | + |
155 | +>>>>>>> MERGE-SOURCE |
156 | // Assemble mark menu. |
157 | GearyApplication.instance.load_ui_file("toolbar_mark_menu.ui"); |
158 | Gtk.Menu mark_menu = (Gtk.Menu) GearyApplication.instance.ui_manager.get_widget("/ui/ToolbarMarkMenu"); |
159 | mark_menu.foreach(GtkUtil.show_menuitem_accel_labels); |
160 | +<<<<<<< TREE |
161 | |
162 | +======= |
163 | + |
164 | + // Setup the application menu. |
165 | + GearyApplication.instance.load_ui_file("toolbar_menu.ui"); |
166 | + Gtk.Menu application_menu = (Gtk.Menu) GearyApplication.instance.ui_manager.get_widget("/ui/ToolbarMenu"); |
167 | + application_menu.foreach(GtkUtil.show_menuitem_accel_labels); |
168 | + |
169 | +>>>>>>> MERGE-SOURCE |
170 | // Toolbar setup. |
171 | Gee.List<Gtk.Button> insert = new Gee.ArrayList<Gtk.Button>(); |
172 | |
173 | // Compose. |
174 | +<<<<<<< TREE |
175 | Gtk.Button compose = new Gtk.Button(); |
176 | compose.related_action = GearyApplication.instance.actions.get_action(GearyController.ACTION_NEW_MESSAGE); |
177 | compose.tooltip_text = compose.related_action.tooltip; |
178 | compose.image = new Gtk.Image.from_icon_name("mail-message-new", Gtk.IconSize.LARGE_TOOLBAR); //FIXME: For some reason doing Button.from_icon_name doesn't work |
179 | folder_header.pack_start(compose); |
180 | |
181 | +======= |
182 | + insert.add(create_toolbar_button("mail-message-new", GearyController.ACTION_NEW_MESSAGE)); |
183 | + add_start(create_pill_buttons(insert, false)); |
184 | + |
185 | + // Reply buttons |
186 | + insert.clear(); |
187 | + insert.add(create_toolbar_button("mail-reply-sender", GearyController.ACTION_REPLY_TO_MESSAGE)); |
188 | + insert.add(create_toolbar_button("mail-reply-all", GearyController.ACTION_REPLY_ALL_MESSAGE)); |
189 | + insert.add(create_toolbar_button("mail-forward", GearyController.ACTION_FORWARD_MESSAGE)); |
190 | + add_start(create_pill_buttons(insert)); |
191 | + |
192 | + // Mark, copy, move. |
193 | + insert.clear(); |
194 | + insert.add(create_menu_button("edit-mark", mark_menu, GearyController.ACTION_MARK_AS_MENU)); |
195 | + insert.add(create_menu_button("tag-new", copy_folder_menu, GearyController.ACTION_COPY_MENU)); |
196 | + insert.add(create_menu_button("mail-move", move_folder_menu, GearyController.ACTION_MOVE_MENU)); |
197 | + add_start(create_pill_buttons(insert)); |
198 | + |
199 | +>>>>>>> MERGE-SOURCE |
200 | // Assemble the empty menu |
201 | GearyApplication.instance.load_ui_file("toolbar_empty_menu.ui"); |
202 | Gtk.Menu empty_menu = (Gtk.Menu) GearyApplication.instance.ui_manager.get_widget("/ui/ToolbarEmptyMenu"); |
203 | empty_menu.foreach(GtkUtil.show_menuitem_accel_labels); |
204 | +<<<<<<< TREE |
205 | |
206 | Gtk.MenuButton empty = new Gtk.MenuButton(); |
207 | empty.image = new Gtk.Image.from_icon_name("edit-clear", Gtk.IconSize.LARGE_TOOLBAR); |
208 | @@ -154,12 +211,78 @@ |
209 | |
210 | Gtk.Settings.get_default().notify["gtk-decoration-layout"].connect(set_window_buttons); |
211 | realize.connect(set_window_buttons); |
212 | +======= |
213 | + |
214 | + Gtk.MenuButton empty = new Gtk.MenuButton(); |
215 | + empty.image = new Gtk.Image.from_icon_name("edit-clear", Gtk.IconSize.LARGE_TOOLBAR); |
216 | + empty.popup = empty_menu; |
217 | + empty.tooltip_text = _("Empty Spam or Trash folders"); |
218 | + |
219 | + // The toolbar looks bad when you hide one of a pair of pill buttons. |
220 | + // Unfortunately, this means we have to have one pair for archive/trash |
221 | + // and one single button for just trash, for when the archive button is |
222 | + // hidden. |
223 | + insert.clear(); |
224 | + insert.add(archive_button = create_toolbar_button("mail-archive", GearyController.ACTION_ARCHIVE_MESSAGE, false)); |
225 | + insert.add(trash_buttons[0] = create_toolbar_button("user-trash", GearyController.ACTION_TRASH_MESSAGE, false)); |
226 | + Gtk.Box trash_archive = create_pill_buttons(insert); |
227 | + insert.clear(); |
228 | + insert.add(trash_buttons[1] = create_toolbar_button("user-trash", GearyController.ACTION_TRASH_MESSAGE, false)); |
229 | + Gtk.Box trash = create_pill_buttons(insert, false); |
230 | + add_start(empty); |
231 | + add_start(trash_archive); |
232 | + add_start(trash); |
233 | + |
234 | + // Search bar. |
235 | + search_entry.width_chars = 28; |
236 | + search_entry.tooltip_text = _("Search all mail in account for keywords (Ctrl+S)"); |
237 | + search_entry.changed.connect(on_search_entry_changed); |
238 | + search_entry.key_press_event.connect(on_search_key_press); |
239 | + on_search_entry_changed(); // set initial state |
240 | + search_entry.has_focus = true; |
241 | + |
242 | + // Search upgrade progress bar. |
243 | + search_upgrade_progress_bar.margin_top = 3; |
244 | + search_upgrade_progress_bar.margin_bottom = 3; |
245 | + search_upgrade_progress_bar.show_text = true; |
246 | + search_upgrade_progress_bar.visible = false; |
247 | + search_upgrade_progress_bar.no_show_all = true; |
248 | + |
249 | + insert.clear(); |
250 | + insert.add(create_menu_button("open-menu", application_menu, GearyController.ACTION_GEAR_MENU)); |
251 | + add_end(create_pill_buttons(insert)); |
252 | + |
253 | + Gtk.Button undo = new Gtk.Button(); |
254 | + undo.related_action = GearyApplication.instance.actions.get_action(GearyController.ACTION_UNDO); |
255 | + undo.tooltip_text = undo.related_action.tooltip; |
256 | + undo.related_action.notify["tooltip"].connect(() => { undo.tooltip_text = undo.related_action.tooltip; }); |
257 | + undo.image = new Gtk.Image.from_icon_name("edit-undo", Gtk.IconSize.LARGE_TOOLBAR); //FIXME: For some reason doing Button.from_icon_name doesn't work |
258 | + |
259 | + add_end(search_entry); |
260 | + add_end(search_upgrade_progress_bar); |
261 | + add_end(undo); |
262 | + |
263 | + set_search_placeholder_text(DEFAULT_SEARCH_TEXT); |
264 | + } |
265 | + |
266 | + private void show_archive_button(bool show) { |
267 | + if (show) { |
268 | + archive_button.show(); |
269 | + trash_buttons[0].show(); |
270 | + trash_buttons[1].hide(); |
271 | + } else { |
272 | + archive_button.hide(); |
273 | + trash_buttons[0].hide(); |
274 | + trash_buttons[1].show(); |
275 | + } |
276 | +>>>>>>> MERGE-SOURCE |
277 | } |
278 | |
279 | /// Updates the trash button as trash or delete, and shows or hides the archive button. |
280 | - public void update_trash_archive_buttons(bool trash, bool archive) { |
281 | + public void update_trash_buttons(bool trash, bool archive) { |
282 | string action_name = (trash ? GearyController.ACTION_TRASH_MESSAGE |
283 | : GearyController.ACTION_DELETE_MESSAGE); |
284 | +<<<<<<< TREE |
285 | conversation_header.setup_button(trash_delete_button, null, action_name, false); |
286 | |
287 | archive_button.visible = archive; |
288 | @@ -197,4 +320,98 @@ |
289 | conversation_header.decoration_layout = ":" + buttons[1]; |
290 | } |
291 | } |
292 | +======= |
293 | + foreach (Gtk.Button b in trash_buttons) |
294 | + setup_button(b, "user-trash", action_name, false); |
295 | +>>>>>>> MERGE-SOURCE |
296 | |
297 | + show_archive_button(archive); |
298 | + } |
299 | + |
300 | + public void set_search_text(string text) { |
301 | + search_entry.text = text; |
302 | + } |
303 | + |
304 | + public void give_search_focus() { |
305 | + search_entry.grab_focus(); |
306 | + } |
307 | + |
308 | + public void set_search_placeholder_text(string placeholder) { |
309 | + search_entry.placeholder_text = placeholder; |
310 | + } |
311 | + |
312 | + private void on_search_entry_changed() { |
313 | + search_text_changed(search_entry.text); |
314 | + // Enable/disable clear button. |
315 | + search_entry.secondary_icon_name = search_entry.text != "" ? |
316 | + (get_direction() == Gtk.TextDirection.RTL ? ICON_CLEAR_RTL_NAME : ICON_CLEAR_NAME) : null; |
317 | + } |
318 | + |
319 | + private bool on_search_key_press(Gdk.EventKey event) { |
320 | + // Clear box if user hits escape. |
321 | + if (Gdk.keyval_name(event.keyval) == "Escape") |
322 | + search_entry.text = ""; |
323 | + |
324 | + // Force search if user hits enter. |
325 | + if (Gdk.keyval_name(event.keyval) == "Return") |
326 | + on_search_entry_changed(); |
327 | + |
328 | + return false; |
329 | + } |
330 | + |
331 | + private void on_search_upgrade_start() { |
332 | + // Set the progress bar's width to match the search entry's width. |
333 | + int minimum_width = 0; |
334 | + int natural_width = 0; |
335 | + search_entry.get_preferred_width(out minimum_width, out natural_width); |
336 | + search_upgrade_progress_bar.width_request = minimum_width; |
337 | + |
338 | + search_entry.hide(); |
339 | + search_upgrade_progress_bar.show(); |
340 | + } |
341 | + |
342 | + private void on_search_upgrade_finished() { |
343 | + search_entry.show(); |
344 | + search_upgrade_progress_bar.hide(); |
345 | + } |
346 | + |
347 | + private void on_account_changed(Geary.Account? account) { |
348 | + on_search_upgrade_finished(); // Reset search box. |
349 | + |
350 | + if (search_upgrade_progress_monitor != null) { |
351 | + search_upgrade_progress_monitor.start.disconnect(on_search_upgrade_start); |
352 | + search_upgrade_progress_monitor.finish.disconnect(on_search_upgrade_finished); |
353 | + search_upgrade_progress_monitor = null; |
354 | + } |
355 | + |
356 | + if (current_account != null) { |
357 | + current_account.information.notify[Geary.AccountInformation.PROP_NICKNAME].disconnect( |
358 | + on_nickname_changed); |
359 | + } |
360 | + |
361 | + if (account != null) { |
362 | + search_upgrade_progress_monitor = account.search_upgrade_monitor; |
363 | + search_upgrade_progress_bar.set_progress_monitor(search_upgrade_progress_monitor); |
364 | + |
365 | + search_upgrade_progress_monitor.start.connect(on_search_upgrade_start); |
366 | + search_upgrade_progress_monitor.finish.connect(on_search_upgrade_finished); |
367 | + if (search_upgrade_progress_monitor.is_in_progress) |
368 | + on_search_upgrade_start(); // Remove search box, we're already in progress. |
369 | + |
370 | + account.information.notify[Geary.AccountInformation.PROP_NICKNAME].connect( |
371 | + on_nickname_changed); |
372 | + |
373 | + search_upgrade_progress_bar.text = _("Indexing %s account").printf(account.information.nickname); |
374 | + } |
375 | + |
376 | + current_account = account; |
377 | + |
378 | + on_nickname_changed(); // Set new account name. |
379 | + } |
380 | + |
381 | + private void on_nickname_changed() { |
382 | + set_search_placeholder_text(current_account == null || |
383 | + GearyApplication.instance.controller.get_num_accounts() == 1 ? DEFAULT_SEARCH_TEXT : |
384 | + _("Search %s account").printf(current_account.information.nickname)); |
385 | + } |
386 | +} |
387 | \ No newline at end of file |
388 | |
389 | === modified file 'src/client/components/main-window.vala' |
390 | --- src/client/components/main-window.vala 2015-11-23 01:27:32 +0000 |
391 | +++ src/client/components/main-window.vala 2015-11-25 01:35:24 +0000 |
392 | @@ -15,7 +15,6 @@ |
393 | public FolderList.Tree folder_list { get; private set; default = new FolderList.Tree(); } |
394 | public ConversationListStore conversation_list_store { get; private set; default = new ConversationListStore(); } |
395 | public MainToolbar main_toolbar { get; private set; } |
396 | - public SearchBar search_bar { get; private set; default = new SearchBar(); } |
397 | public ConversationListView conversation_list_view { get; private set; } |
398 | public ConversationViewer conversation_viewer { get; private set; default = new ConversationViewer(); } |
399 | public StatusBar status_bar { get; private set; default = new StatusBar(); } |
400 | @@ -84,7 +83,9 @@ |
401 | Geary.Engine.instance.account_unavailable.connect(on_account_unavailable); |
402 | |
403 | // Toolbar. |
404 | + // Toolbar. |
405 | main_toolbar = new MainToolbar(); |
406 | +<<<<<<< TREE |
407 | main_toolbar.bind_property("search-open", search_bar, "search-mode-enabled", |
408 | BindingFlags.SYNC_CREATE | BindingFlags.BIDIRECTIONAL); |
409 | if (!GearyApplication.instance.is_running_unity) { |
410 | @@ -104,8 +105,15 @@ |
411 | main_toolbar.bind_property("account", this, "title", BindingFlags.SYNC_CREATE, title_func); |
412 | } |
413 | |
414 | +======= |
415 | +#if !ENABLE_UNITY |
416 | + main_toolbar.show_close_button = true; |
417 | + set_titlebar(main_toolbar); |
418 | +#endif |
419 | + |
420 | + set_styling(); |
421 | +>>>>>>> MERGE-SOURCE |
422 | create_layout(); |
423 | - on_change_orientation(); |
424 | } |
425 | |
426 | public override void show_all() { |
427 | @@ -183,12 +191,8 @@ |
428 | folder_paned.pack1(folder_box, false, false); |
429 | folder_paned.pack2(conversation_box, true, false); |
430 | |
431 | - Gtk.Box search_bar_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); |
432 | - search_bar_box.pack_start(search_bar, false, false, 0); |
433 | - search_bar_box.pack_start(folder_paned); |
434 | - |
435 | // Message list left of message viewer. |
436 | - conversations_paned.pack1(search_bar_box, false, false); |
437 | + conversations_paned.pack1(folder_paned, true, true); |
438 | conversations_paned.pack2(conversation_viewer, true, true); |
439 | |
440 | if (GearyApplication.instance.is_running_unity) |
441 | @@ -208,7 +212,7 @@ |
442 | |
443 | private bool on_key_press_event(Gdk.EventKey event) { |
444 | if ((event.keyval == Gdk.Key.Shift_L || event.keyval == Gdk.Key.Shift_R) |
445 | - && (event.state & Gdk.ModifierType.SHIFT_MASK) == 0 && !search_bar.search_entry_has_focus) |
446 | + && (event.state & Gdk.ModifierType.SHIFT_MASK) == 0 && !main_toolbar.search_entry_has_focus) |
447 | on_shift_key(true); |
448 | |
449 | // Check whether the focused widget wants to handle it, if not let the accelerators kick in |
450 | @@ -221,7 +225,7 @@ |
451 | // the shift key to report as released when they release ALL of them. |
452 | // There doesn't seem to be an easy way to do this in Gdk. |
453 | if ((event.keyval == Gdk.Key.Shift_L || event.keyval == Gdk.Key.Shift_R) |
454 | - && !search_bar.search_entry_has_focus) |
455 | + && !main_toolbar.search_entry_has_focus) |
456 | on_shift_key(false); |
457 | |
458 | return propagate_key_event(event); |
459 | @@ -325,13 +329,13 @@ |
460 | |
461 | private void update_headerbar() { |
462 | if (current_folder == null) { |
463 | - main_toolbar.account = null; |
464 | - main_toolbar.folder = null; |
465 | + main_toolbar.title = null; |
466 | + main_toolbar.subtitle = null; |
467 | |
468 | return; |
469 | } |
470 | |
471 | - main_toolbar.account = current_folder.account.information.nickname; |
472 | + main_toolbar.title = current_folder.account.information.nickname; |
473 | |
474 | /// Current folder's name followed by its unread count, i.e. "Inbox (42)" |
475 | // except for Drafts and Outbox, where we show total count |
476 | @@ -348,9 +352,9 @@ |
477 | } |
478 | |
479 | if (count > 0) |
480 | - main_toolbar.folder = _("%s (%d)").printf(current_folder.get_display_name(), count); |
481 | + main_toolbar.subtitle = _("%s (%d)").printf(current_folder.get_display_name(), count); |
482 | else |
483 | - main_toolbar.folder = current_folder.get_display_name(); |
484 | + main_toolbar.subtitle = current_folder.get_display_name(); |
485 | } |
486 | } |
487 | |
488 | |
489 | === modified file 'src/client/components/pill-toolbar.vala' |
490 | --- src/client/components/pill-toolbar.vala 2015-11-24 19:48:54 +0000 |
491 | +++ src/client/components/pill-toolbar.vala 2015-11-25 01:35:24 +0000 |
492 | @@ -1,4 +1,4 @@ |
493 | -/* Copyright 2011-2015 Yorba Foundation |
494 | +/* Copyright 2011-2014 Yorba Foundation |
495 | * |
496 | * This software is licensed under the GNU Lesser General Public License |
497 | * (version 2.1 or later). See the COPYING file in this distribution. |
498 | @@ -32,12 +32,18 @@ |
499 | pack_end(widget); |
500 | size.add_widget(widget); |
501 | } |
502 | +<<<<<<< TREE |
503 | |
504 | public virtual void setup_button(Gtk.Button b, string? icon_name, string action_name, |
505 | +======= |
506 | + |
507 | + protected virtual void setup_button(Gtk.Button b, string? icon_name, string action_name, |
508 | +>>>>>>> MERGE-SOURCE |
509 | bool show_label = false) { |
510 | b.related_action = action_group.get_action(action_name); |
511 | b.tooltip_text = b.related_action.tooltip; |
512 | b.related_action.notify["tooltip"].connect(() => { b.tooltip_text = b.related_action.tooltip; }); |
513 | +<<<<<<< TREE |
514 | |
515 | // Load icon by name with this fallback order: specified icon name, the action's icon name, |
516 | // the action's stock ID ... although stock IDs are being deprecated, that's how we specify |
517 | @@ -59,6 +65,11 @@ |
518 | if (GearyApplication.instance.is_running_unity && b.image != null) |
519 | b.image.margin = b.image.margin + 4; |
520 | |
521 | +======= |
522 | + b.image = new Gtk.Image.from_icon_name(icon_name != null ? icon_name : |
523 | + b.related_action.icon_name, Gtk.IconSize.LARGE_TOOLBAR); |
524 | + |
525 | +>>>>>>> MERGE-SOURCE |
526 | b.always_show_image = true; |
527 | |
528 | if (!show_label) |
529 | @@ -118,6 +129,7 @@ |
530 | public PillHeaderbar(Gtk.ActionGroup toolbar_action_group) { |
531 | initialize(toolbar_action_group); |
532 | } |
533 | +<<<<<<< TREE |
534 | |
535 | public bool close_button_at_end() { |
536 | string layout; |
537 | @@ -135,6 +147,8 @@ |
538 | } |
539 | return at_end; |
540 | } |
541 | +======= |
542 | +>>>>>>> MERGE-SOURCE |
543 | } |
544 | |
545 | /** |
546 | @@ -157,4 +171,3 @@ |
547 | base.pack_end(widget, false, false, 0); |
548 | } |
549 | } |
550 | - |
551 | |
552 | === modified file 'src/client/composer/composer-box.vala' |
553 | --- src/client/composer/composer-box.vala 2015-11-23 01:27:32 +0000 |
554 | +++ src/client/composer/composer-box.vala 2015-11-25 01:35:24 +0000 |
555 | @@ -30,8 +30,6 @@ |
556 | conversation_list_view.get_selection().unselect_all(); |
557 | |
558 | composer.free_header(); |
559 | - GearyApplication.instance.controller.main_window.main_toolbar.set_conversation_header( |
560 | - composer.header); |
561 | get_style_context().add_class("full-pane"); |
562 | } |
563 | } |
564 | @@ -72,9 +70,6 @@ |
565 | public void vanish() { |
566 | hide(); |
567 | parent.hide(); |
568 | - if (get_style_context().has_class("full-pane")) |
569 | - GearyApplication.instance.controller.main_window.main_toolbar.remove_conversation_header( |
570 | - composer.header); |
571 | |
572 | composer.state = ComposerWidget.ComposerState.DETACHED; |
573 | composer.editor.focus_in_event.disconnect(on_focus_in); |
574 | |
575 | === modified file 'src/client/composer/composer-embed.vala' |
576 | --- src/client/composer/composer-embed.vala 2015-03-12 01:16:27 +0000 |
577 | +++ src/client/composer/composer-embed.vala 2015-11-25 01:35:24 +0000 |
578 | @@ -25,6 +25,7 @@ |
579 | public ComposerEmbed(ComposerWidget composer, ConversationViewer conversation_viewer, |
580 | Geary.Email referred) { |
581 | this.composer = composer; |
582 | + this.composer.header.hide_all_except_recipients(); |
583 | this.conversation_viewer = conversation_viewer; |
584 | halign = Gtk.Align.FILL; |
585 | valign = Gtk.Align.FILL; |
586 | |
587 | === modified file 'src/client/composer/composer-headerbar.vala' |
588 | --- src/client/composer/composer-headerbar.vala 2015-11-24 21:21:25 +0000 |
589 | +++ src/client/composer/composer-headerbar.vala 2015-11-25 01:35:24 +0000 |
590 | @@ -4,8 +4,13 @@ |
591 | * (version 2.1 or later). See the COPYING file in this distribution. |
592 | */ |
593 | |
594 | +<<<<<<< TREE |
595 | public class ComposerHeaderbar : PillHeaderbar { |
596 | |
597 | +======= |
598 | +public class ComposerHeaderbar : PillToolbar { |
599 | + |
600 | +>>>>>>> MERGE-SOURCE |
601 | public ComposerWidget.ComposerState state { get; set; } |
602 | public bool show_pending_attachments { get; set; default = false; } |
603 | public bool send_enabled { get; set; default = false; } |
604 | @@ -14,12 +19,25 @@ |
605 | private Gtk.Label recipients_label; |
606 | private Gtk.Box detach_start; |
607 | private Gtk.Box detach_end; |
608 | - |
609 | +<<<<<<< TREE |
610 | + |
611 | +======= |
612 | + |
613 | + private Gtk.Box attach_buttons; |
614 | + private Gtk.Button send_button; |
615 | + private Gtk.Box close_buttons; |
616 | + private Gtk.Button detach_button; |
617 | + |
618 | +>>>>>>> MERGE-SOURCE |
619 | public ComposerHeaderbar(Gtk.ActionGroup action_group) { |
620 | base(action_group); |
621 | +<<<<<<< TREE |
622 | |
623 | show_close_button = false; |
624 | |
625 | +======= |
626 | + |
627 | +>>>>>>> MERGE-SOURCE |
628 | bool rtl = (get_direction() == Gtk.TextDirection.RTL); |
629 | |
630 | // Toolbar setup. |
631 | @@ -27,7 +45,7 @@ |
632 | |
633 | // Window management. |
634 | detach_start = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); |
635 | - Gtk.Button detach_button = create_toolbar_button(null, ComposerWidget.ACTION_DETACH); |
636 | + detach_button = create_toolbar_button(null, ComposerWidget.ACTION_DETACH); |
637 | detach_button.set_relief(Gtk.ReliefStyle.NONE); |
638 | if (rtl) |
639 | detach_button.set_margin_left(6); |
640 | @@ -48,13 +66,23 @@ |
641 | |
642 | insert.add(create_toolbar_button(null, ComposerWidget.ACTION_CLOSE_DISCARD)); |
643 | insert.add(create_toolbar_button(null, ComposerWidget.ACTION_CLOSE_SAVE)); |
644 | - Gtk.Box close_buttons = create_pill_buttons(insert, false); |
645 | + close_buttons = create_pill_buttons(insert, false); |
646 | insert.clear(); |
647 | +<<<<<<< TREE |
648 | |
649 | Gtk.Button send_button = create_toolbar_button(null, ComposerWidget.ACTION_SEND, true); |
650 | +======= |
651 | + |
652 | + send_button = create_toolbar_button(null, ComposerWidget.ACTION_SEND, true); |
653 | +>>>>>>> MERGE-SOURCE |
654 | send_button.get_style_context().add_class("suggested-action"); |
655 | +<<<<<<< TREE |
656 | |
657 | Gtk.Box attach_buttons = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); |
658 | +======= |
659 | + |
660 | + attach_buttons = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); |
661 | +>>>>>>> MERGE-SOURCE |
662 | Gtk.Button attach_only = create_toolbar_button(null, ComposerWidget.ACTION_ADD_ATTACHMENT); |
663 | insert.add(create_toolbar_button(null, ComposerWidget.ACTION_ADD_ATTACHMENT)); |
664 | insert.add(create_toolbar_button(null, ComposerWidget.ACTION_ADD_ORIGINAL_ATTACHMENTS)); |
665 | @@ -117,9 +145,25 @@ |
666 | } |
667 | |
668 | private void set_detach_button_side() { |
669 | - bool at_end = close_button_at_end(); |
670 | + bool at_end = true; |
671 | detach_start.visible = !at_end; |
672 | detach_end.visible = at_end; |
673 | } |
674 | + |
675 | + public void hide_all_except_recipients() { |
676 | + detach_start.set_no_show_all(true); |
677 | + detach_start.hide(); |
678 | + detach_end.set_no_show_all(true); |
679 | + detach_end.hide(); |
680 | + detach_button.set_no_show_all(true); |
681 | + detach_button.hide(); |
682 | + |
683 | + attach_buttons.set_no_show_all(true); |
684 | + attach_buttons.hide(); |
685 | + send_button.set_no_show_all(true); |
686 | + send_button.hide(); |
687 | + close_buttons.set_no_show_all(true); |
688 | + close_buttons.hide(); |
689 | + } |
690 | } |
691 | |
692 | |
693 | === modified file 'src/client/composer/composer-toolbar.vala' |
694 | --- src/client/composer/composer-toolbar.vala 2015-11-24 19:48:54 +0000 |
695 | +++ src/client/composer/composer-toolbar.vala 2015-11-25 01:35:24 +0000 |
696 | @@ -7,36 +7,57 @@ |
697 | public class ComposerToolbar : PillToolbar { |
698 | |
699 | public string label_text { get; set; } |
700 | +<<<<<<< TREE |
701 | |
702 | +======= |
703 | + private Gtk.Button detach_button; |
704 | + |
705 | +>>>>>>> MERGE-SOURCE |
706 | public ComposerToolbar(Gtk.ActionGroup toolbar_action_group, Gtk.Menu menu) { |
707 | base(toolbar_action_group); |
708 | |
709 | Gee.List<Gtk.Button> insert = new Gee.ArrayList<Gtk.Button>(); |
710 | - |
711 | +<<<<<<< TREE |
712 | + |
713 | +======= |
714 | + |
715 | + // Detach |
716 | + detach_button = setup_button("detach-symbolic", ComposerWidget.ACTION_DETACH); |
717 | + insert.add(detach_button); |
718 | + add_start(create_pill_buttons(insert, false, true)); |
719 | + |
720 | + // Attachments |
721 | + insert.clear(); |
722 | + insert.add(setup_button("mail-attachment-symbolic", ComposerWidget.ACTION_ADD_ATTACHMENT)); |
723 | + add_start(create_pill_buttons(insert, false, true)); |
724 | + |
725 | +>>>>>>> MERGE-SOURCE |
726 | // Font formatting. |
727 | - insert.add(create_toggle_button(null, ComposerWidget.ACTION_BOLD)); |
728 | - insert.add(create_toggle_button(null, ComposerWidget.ACTION_ITALIC)); |
729 | - insert.add(create_toggle_button(null, ComposerWidget.ACTION_UNDERLINE)); |
730 | - insert.add(create_toggle_button(null, ComposerWidget.ACTION_STRIKETHROUGH)); |
731 | + insert.clear(); |
732 | + insert.add(setup_button("format-text-bold-symbolic", ComposerWidget.ACTION_BOLD)); |
733 | + insert.add(setup_button("format-text-italic-symbolic", ComposerWidget.ACTION_ITALIC)); |
734 | + insert.add(setup_button("format-text-underline-symbolic", ComposerWidget.ACTION_UNDERLINE)); |
735 | + insert.add(setup_button("format-text-strikethrough-symbolic", ComposerWidget.ACTION_STRIKETHROUGH)); |
736 | add_start(create_pill_buttons(insert, false, true)); |
737 | |
738 | // Indent level. |
739 | insert.clear(); |
740 | - insert.add(create_toolbar_button(null, ComposerWidget.ACTION_INDENT)); |
741 | - insert.add(create_toolbar_button(null, ComposerWidget.ACTION_OUTDENT)); |
742 | + insert.add(setup_button("format-indent-more-symbolic", ComposerWidget.ACTION_INDENT)); |
743 | + insert.add(setup_button("format-indent-less-symbolic", ComposerWidget.ACTION_OUTDENT)); |
744 | add_start(create_pill_buttons(insert, false)); |
745 | |
746 | // Link. |
747 | insert.clear(); |
748 | - insert.add(create_toolbar_button(null, ComposerWidget.ACTION_INSERT_LINK)); |
749 | + insert.add(setup_button("insert-link-symbolic", ComposerWidget.ACTION_INSERT_LINK)); |
750 | add_start(create_pill_buttons(insert)); |
751 | |
752 | // Remove formatting. |
753 | insert.clear(); |
754 | - insert.add(create_toolbar_button(null, ComposerWidget.ACTION_REMOVE_FORMAT)); |
755 | + insert.add(setup_button("format-text-remove-symbolic", ComposerWidget.ACTION_REMOVE_FORMAT)); |
756 | add_start(create_pill_buttons(insert)); |
757 | |
758 | // Menu. |
759 | +<<<<<<< TREE |
760 | Gtk.MenuButton more = new Gtk.MenuButton(); |
761 | more.image = new Gtk.Image.from_icon_name("view-more-symbolic", Gtk.IconSize.MENU); |
762 | more.popup = menu; |
763 | @@ -47,6 +68,45 @@ |
764 | label.get_style_context().add_class("dim-label"); |
765 | bind_property("label-text", label, "label", BindingFlags.SYNC_CREATE); |
766 | add_end(label); |
767 | +======= |
768 | + insert.clear(); |
769 | + insert.add(setup_button("open-menu-symbolic", ComposerWidget.ACTION_MENU)); |
770 | + add_start(create_pill_buttons(insert)); |
771 | + |
772 | + // Send |
773 | + insert.clear(); |
774 | + insert.add(setup_button("mail-send-symbolic", ComposerWidget.ACTION_SEND)); |
775 | + add_end(create_pill_buttons(insert)); |
776 | + add_end(new Gtk.Separator(Gtk.Orientation.VERTICAL)); |
777 | + |
778 | + // Close options. |
779 | + insert.clear(); |
780 | + insert.add(setup_button("document-save-symbolic", ComposerWidget.ACTION_CLOSE_SAVE)); |
781 | + insert.add(setup_button("user-trash-symbolic", ComposerWidget.ACTION_CLOSE_DISCARD)); |
782 | + add_end(create_pill_buttons(insert)); |
783 | + } |
784 | + |
785 | + protected Gtk.Button setup_button(string? icon_name, string action_name, bool show_label = false) { |
786 | + Gtk.Button b = new Gtk.Button(); |
787 | + b.related_action = action_group.get_action(action_name); |
788 | + b.tooltip_text = b.related_action.tooltip; |
789 | + b.related_action.notify["tooltip"].connect(() => { b.tooltip_text = b.related_action.tooltip; }); |
790 | + b.image = new Gtk.Image.from_icon_name(icon_name != null ? icon_name : |
791 | + b.related_action.icon_name, Gtk.IconSize.SMALL_TOOLBAR); |
792 | + |
793 | + b.always_show_image = true; |
794 | + b.relief = Gtk.ReliefStyle.NONE; |
795 | + |
796 | + if (!show_label) |
797 | + b.label = null; |
798 | + |
799 | + return b; |
800 | + } |
801 | + |
802 | + public void hide_detach_button() { |
803 | + detach_button.set_no_show_all(true); |
804 | + detach_button.hide(); |
805 | +>>>>>>> MERGE-SOURCE |
806 | } |
807 | } |
808 | |
809 | |
810 | === modified file 'src/client/composer/composer-widget.vala' |
811 | --- src/client/composer/composer-widget.vala 2015-03-20 22:50:31 +0000 |
812 | +++ src/client/composer/composer-widget.vala 2015-11-25 01:35:24 +0000 |
813 | @@ -220,7 +220,7 @@ |
814 | private Gee.Set<File> attachment_files = new Gee.HashSet<File>(Geary.Files.nullable_hash, |
815 | Geary.Files.nullable_equal); |
816 | |
817 | - private Gtk.Builder builder; |
818 | + public Gtk.Builder builder; |
819 | private Gtk.Label from_label; |
820 | private Gtk.Label from_single; |
821 | private Gtk.ComboBoxText from_multiple = new Gtk.ComboBoxText(); |
822 | @@ -1147,8 +1147,9 @@ |
823 | state = ComposerWidget.ComposerState.DETACHED; |
824 | if (focus != null && focus.parent.visible) { |
825 | ComposerWindow focus_win = focus.get_toplevel() as ComposerWindow; |
826 | - if (focus_win != null && focus_win == window) |
827 | + if (focus_win != null && focus_win == window) { |
828 | focus.grab_focus(); |
829 | + } |
830 | } else { |
831 | set_focus(); |
832 | } |
833 | |
834 | === modified file 'src/client/composer/composer-window.vala' |
835 | --- src/client/composer/composer-window.vala 2015-03-12 01:40:29 +0000 |
836 | +++ src/client/composer/composer-window.vala 2015-11-25 01:35:24 +0000 |
837 | @@ -8,26 +8,21 @@ |
838 | public class ComposerWindow : Gtk.Window, ComposerContainer { |
839 | |
840 | private bool closing = false; |
841 | + private ComposerWidget composer_widget; |
842 | |
843 | public ComposerWindow(ComposerWidget composer) { |
844 | Object(type: Gtk.WindowType.TOPLEVEL); |
845 | |
846 | + this.composer_widget = composer; |
847 | add(composer); |
848 | - |
849 | - if (!GearyApplication.instance.is_running_unity) { |
850 | - composer.header.show_close_button = true; |
851 | - composer.free_header(); |
852 | - set_titlebar(composer.header); |
853 | - composer.bind_property("window-title", composer.header, "title", |
854 | - BindingFlags.SYNC_CREATE); |
855 | - } else { |
856 | - composer.embed_header(); |
857 | - composer.bind_property("window-title", this, "title", BindingFlags.SYNC_CREATE); |
858 | - } |
859 | + |
860 | + composer.embed_header(); |
861 | + composer.bind_property("window-title", this, "title", BindingFlags.SYNC_CREATE); |
862 | |
863 | add_accel_group(composer.ui.get_accel_group()); |
864 | show(); |
865 | set_position(Gtk.WindowPosition.CENTER); |
866 | + remove_detach_button(); |
867 | } |
868 | |
869 | public Gtk.Window top_window { |
870 | @@ -56,5 +51,15 @@ |
871 | public void remove_composer() { |
872 | warning("Detached composer received remove"); |
873 | } |
874 | + |
875 | + private void remove_detach_button() { |
876 | + Gtk.Alignment toolbar_area = (Gtk.Alignment) composer_widget.builder.get_object("toolbar area"); |
877 | + if(toolbar_area != null) { |
878 | + ComposerToolbar tb = toolbar_area.get_child() as ComposerToolbar; |
879 | + if(tb != null) { |
880 | + tb.hide_detach_button(); |
881 | + } |
882 | + } |
883 | + } |
884 | } |
885 | |
886 | |
887 | === modified file 'src/client/util/util-gtk.vala' |
888 | --- src/client/util/util-gtk.vala 2015-03-23 19:09:44 +0000 |
889 | +++ src/client/util/util-gtk.vala 2015-11-25 01:35:24 +0000 |
890 | @@ -121,12 +121,6 @@ |
891 | } |
892 | |
893 | /** |
894 | - * This is not bound in Vala < 0.26. |
895 | - */ |
896 | -[CCode(cname = "g_binding_unbind")] |
897 | -extern void unbind(Binding binding); |
898 | - |
899 | -/** |
900 | * Set xalign property on Gtk.Label in a compatible way. |
901 | * |
902 | * GtkMisc is being deprecated in GTK+ 3 and the "xalign" property has been moved to GtkLabel. This |
* The big problem here is that the inline composer is supposed to use the second half of the headerbar for actions. Since that's gone, those actions are just missing. Which means you can't send a new message. I'm kind of wondering if we should just leave the dual headerbar for now until we figure out what to do about that
* It looks like the compose toolbar shares the same icon size as the headerbar. If we want to leave the format icons symbolic here, I think they need to remain 16px
* We lost the undo and clear buttons