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
=== modified file 'src/Dialogs/PreferencesWindow.vala'
--- src/Dialogs/PreferencesWindow.vala 2014-03-16 20:34:25 +0000
+++ src/Dialogs/PreferencesWindow.vala 2014-07-27 18:27:58 +0000
@@ -56,6 +56,16 @@
5656
57 Plugins.Manager.get_default ().hook_preferences_window (this);57 Plugins.Manager.get_default ().hook_preferences_window (this);
5858
59 /*
60 * Allow moving the window
61 */
62 this.button_press_event.connect ( (e) => {
63 if (e.button == 1) {
64 this.begin_move_drag ((int) e.button, (int) e.x_root, (int) e.y_root, e.time);
65 return true;
66 }
67 return false;
68 });
59 }69 }
6070
6171
@@ -85,11 +95,14 @@
85 resizable = false;95 resizable = false;
86 window_position = Gtk.WindowPosition.CENTER;96 window_position = Gtk.WindowPosition.CENTER;
87 type_hint = Gdk.WindowTypeHint.DIALOG;97 type_hint = Gdk.WindowTypeHint.DIALOG;
88 transient_for = parent_window;98
99 (get_header_bar () as Gtk.HeaderBar).show_close_button = false;
100 get_header_bar ().get_style_context ().remove_class ("header-bar");
89101
90 main_stack = new Gtk.Stack ();102 main_stack = new Gtk.Stack ();
91 main_stackswitcher = new Gtk.StackSwitcher ();103 main_stackswitcher = new Gtk.StackSwitcher ();
92 main_stackswitcher.set_stack (main_stack);104 main_stackswitcher.set_stack (main_stack);
105 main_stackswitcher.halign = Gtk.Align.CENTER;
93106
94 var close_button = new Gtk.Button.with_label (_("Close"));107 var close_button = new Gtk.Button.with_label (_("Close"));
95 close_button.clicked.connect (() => {this.destroy ();});108 close_button.clicked.connect (() => {this.destroy ();});
@@ -99,11 +112,12 @@
99 button_box.pack_end (close_button);112 button_box.pack_end (close_button);
100 button_box.margin_right = 12;113 button_box.margin_right = 12;
101114
102 var main_grid = new Gtk.Grid ();115 // Pack everything into the dialog
103 main_grid.attach (main_stack, 0, 0, 1, 1);116 Gtk.Grid main_grid = new Gtk.Grid ();
104 main_grid.attach (button_box, 0, 1, 1, 1);117 main_grid.attach (main_stackswitcher, 0, 0, 1, 1);
118 main_grid.attach (main_stack, 0, 1, 1, 1);
119 main_grid.attach (button_box, 0, 2, 1, 1);
105120
106 ((Gtk.HeaderBar) get_header_bar ()).set_custom_title (main_stackswitcher);
107 ((Gtk.Container) get_content_area ()).add (main_grid);121 ((Gtk.Container) get_content_area ()).add (main_grid);
108 }122 }
109}123}

Subscribers

People subscribed via source and target branches