Merge lp:~fabiozaramella/noise/dont-use-headerbar into lp:~elementary-apps/noise/trunk

Proposed by Fabio Zaramella
Status: Merged
Merged at revision: 1654
Proposed branch: lp:~fabiozaramella/noise/dont-use-headerbar
Merge into: lp:~elementary-apps/noise/trunk
Diff against target: 53 lines (+19/-5)
1 file modified
src/Dialogs/PreferencesWindow.vala (+19/-5)
To merge this branch: bzr merge lp:~fabiozaramella/noise/dont-use-headerbar
Reviewer Review Type Date Requested Status
xapantu (community) Approve
Cody Garver Pending
Review via email: mp+223623@code.launchpad.net

This proposal supersedes a proposal from 2014-05-31.

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote : Posted in a previous version of this proposal

Gtk.Box is/is going to be deprecated, use Grid instead https://developer.gnome.org/gtk3/3.7/gtk-migrating-GtkGrid.html

review: Needs Fixing
Revision history for this message
Fabio Zaramella (fabiozaramella) wrote :

it's ok

1618. By Fabio

uses headerbar but hides the close button

Revision history for this message
Corentin Noël (tintou) wrote :

Please reuse Object (use_header_bar: 1);
and use get_header_bar () to get the header_bar object.

1619. By Fabio

need to hide the close button

1620. By Fabio

show_close_button (false)

Revision history for this message
Fabio Zaramella (fabiozaramella) wrote :

done

Revision history for this message
Cody Garver (codygarver) wrote :

Dragging the titlebar drags the whole app, none of the other preferences behave that way

1621. By Fabio

transient_for removed

Revision history for this message
Cody Garver (codygarver) wrote :

What's the purpose of the 'Allow moving the window' stuff?

Revision history for this message
Fabio Zaramella (fabiozaramella) wrote :

Oh it's remained from the tests I was doing. Personally I think that in this way is easier and faster for the user to drag the window instead of being forced to grab the title bar which has also a smaller area. However, if the team thinks it doesn't fit good i can remove it immediately.

Revision history for this message
xapantu (xapantu) wrote :

I removed that code and merged it, thanks for your work!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Dialogs/PreferencesWindow.vala'
2--- src/Dialogs/PreferencesWindow.vala 2014-03-16 20:34:25 +0000
3+++ src/Dialogs/PreferencesWindow.vala 2014-07-27 18:27:58 +0000
4@@ -56,6 +56,16 @@
5
6 Plugins.Manager.get_default ().hook_preferences_window (this);
7
8+ /*
9+ * Allow moving the window
10+ */
11+ this.button_press_event.connect ( (e) => {
12+ if (e.button == 1) {
13+ this.begin_move_drag ((int) e.button, (int) e.x_root, (int) e.y_root, e.time);
14+ return true;
15+ }
16+ return false;
17+ });
18 }
19
20
21@@ -85,11 +95,14 @@
22 resizable = false;
23 window_position = Gtk.WindowPosition.CENTER;
24 type_hint = Gdk.WindowTypeHint.DIALOG;
25- transient_for = parent_window;
26+
27+ (get_header_bar () as Gtk.HeaderBar).show_close_button = false;
28+ get_header_bar ().get_style_context ().remove_class ("header-bar");
29
30 main_stack = new Gtk.Stack ();
31 main_stackswitcher = new Gtk.StackSwitcher ();
32 main_stackswitcher.set_stack (main_stack);
33+ main_stackswitcher.halign = Gtk.Align.CENTER;
34
35 var close_button = new Gtk.Button.with_label (_("Close"));
36 close_button.clicked.connect (() => {this.destroy ();});
37@@ -99,11 +112,12 @@
38 button_box.pack_end (close_button);
39 button_box.margin_right = 12;
40
41- var main_grid = new Gtk.Grid ();
42- main_grid.attach (main_stack, 0, 0, 1, 1);
43- main_grid.attach (button_box, 0, 1, 1, 1);
44+ // Pack everything into the dialog
45+ Gtk.Grid main_grid = new Gtk.Grid ();
46+ main_grid.attach (main_stackswitcher, 0, 0, 1, 1);
47+ main_grid.attach (main_stack, 0, 1, 1, 1);
48+ main_grid.attach (button_box, 0, 2, 1, 1);
49
50- ((Gtk.HeaderBar) get_header_bar ()).set_custom_title (main_stackswitcher);
51 ((Gtk.Container) get_content_area ()).add (main_grid);
52 }
53 }

Subscribers

People subscribed via source and target branches