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

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

This proposal has been superseded by a proposal from 2014-06-18.

Commit message

Don't use Gtk.Header Bar for preferences window in order to keep a consistent style with other apps, for example Scratch.

To post a comment you must log in.
1614. By Fabio
1615. By Fabio

ready for merge

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

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
1616. By Fabio

use grid intead of box

1617. By Fabio

window made draggable

1618. By Fabio

uses headerbar but hides the close button

1619. By Fabio

need to hide the close button

1620. By Fabio

show_close_button (false)

1621. By Fabio

transient_for removed

Unmerged revisions

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-06-01 08:24:24 +0000
4@@ -39,7 +39,6 @@
5 private int index = 0;
6
7 public PreferencesWindow (LibraryWindow lw) {
8- Object (use_header_bar: 1);
9 build_ui (lw);
10
11 lw.add_preference_page.connect ((page) => {add_page (page);});
12@@ -56,6 +55,16 @@
13
14 Plugins.Manager.get_default ().hook_preferences_window (this);
15
16+ /*
17+ * Allow moving the window
18+ */
19+ this.button_press_event.connect ( (e) => {
20+ if (e.button == 1) {
21+ this.begin_move_drag ((int) e.button, (int) e.x_root, (int) e.y_root, e.time);
22+ return true;
23+ }
24+ return false;
25+ });
26 }
27
28
29@@ -90,6 +99,7 @@
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 +109,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