Merge lp:~fabianthoma/granite/fix-bug994797 into lp:~elementary-pantheon/granite/granite

Proposed by Fabian Thoma
Status: Merged
Merged at revision: 243
Proposed branch: lp:~fabianthoma/granite/fix-bug994797
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 36 lines (+12/-7)
1 file modified
lib/Widgets/StaticNotebook.vala (+12/-7)
To merge this branch: bzr merge lp:~fabianthoma/granite/fix-bug994797
Reviewer Review Type Date Requested Status
Cody Garver (community) Approve
Review via email: mp+106533@code.launchpad.net

Description of the change

As Bug 994797 describes:
the new content-view side panel looks super sexy, but the horizontal separator on the tabs mess it up. Since there is nothing above the tabs, there is no need to have a separator here.

Because of that I added a parameter to hide the seperator:

public StaticNotebook (bool show_separator = true)

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/Widgets/StaticNotebook.vala'
2--- lib/Widgets/StaticNotebook.vala 2012-01-22 11:27:54 +0000
3+++ lib/Widgets/StaticNotebook.vala 2012-05-20 15:49:18 +0000
4@@ -36,7 +36,7 @@
5
6 public signal void page_changed (int index);
7
8- public StaticNotebook () {
9+ public StaticNotebook (bool show_separator = true) {
10
11 orientation = Gtk.Orientation.VERTICAL;
12 switcher_hidden = false;
13@@ -47,12 +47,17 @@
14 switcher = new ModeButton();
15
16 switcher_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
17- var left_separator = new Gtk.Separator(Gtk.Orientation.HORIZONTAL);
18- var right_separator = new Gtk.Separator(Gtk.Orientation.HORIZONTAL);
19-
20- switcher_box.pack_start(left_separator, true, true);
21- switcher_box.pack_start(switcher, false, false);
22- switcher_box.pack_end(right_separator, true, true);
23+
24+ if (show_separator) {
25+ var left_separator = new Gtk.Separator(Gtk.Orientation.HORIZONTAL);
26+ var right_separator = new Gtk.Separator(Gtk.Orientation.HORIZONTAL);
27+ switcher_box.pack_start(left_separator, true, true);
28+ switcher_box.pack_start(switcher, false, false);
29+ switcher_box.pack_end(right_separator, true, true);
30+ } else {
31+ switcher.halign = Gtk.Align.CENTER;
32+ switcher_box.pack_start(switcher, true, true);
33+ }
34
35 switcher.set_margin_top(5);
36 switcher.set_margin_bottom(5);

Subscribers

People subscribed via source and target branches