Merge lp:~niclasl/scratch/fix-padding into lp:scratch/2.x

Proposed by Niclas Lockner
Status: Merged
Approved by: Mario Guerriero
Approved revision: 1229
Merged at revision: 1229
Proposed branch: lp:~niclasl/scratch/fix-padding
Merge into: lp:scratch/2.x
Diff against target: 30 lines (+5/-3)
1 file modified
src/Widgets/DynamicNotebook.vala (+5/-3)
To merge this branch: bzr merge lp:~niclasl/scratch/fix-padding
Reviewer Review Type Date Requested Status
Mario Guerriero (community) Approve
Review via email: mp+198624@code.launchpad.net

Commit message

Add padding around the new tab button

Description of the change

Add padding around the new tab button

To post a comment you must log in.
lp:~niclasl/scratch/fix-padding updated
1229. By Niclas Lockner

Add padding around the new tab button

Revision history for this message
Niclas Lockner (niclasl) wrote :

Now it's ready for review.

Revision history for this message
Mario Guerriero (mefrio-g) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Widgets/DynamicNotebook.vala'
2--- src/Widgets/DynamicNotebook.vala 2013-10-30 19:44:28 +0000
3+++ src/Widgets/DynamicNotebook.vala 2013-12-11 19:08:51 +0000
4@@ -435,6 +435,7 @@
5 private Gtk.Button add_button;
6 private Gtk.Button restore_button; // should be a Gtk.MenuButton when we have Gtk+ 3.6
7
8+ private static const int ADD_BUTTON_PADDING = 5; // Padding around the new tab button
9 private static const string CLOSE_BUTTON_STYLE = """
10 * {
11 -GtkButton-default-border : 0;
12@@ -494,14 +495,15 @@
13 this.tab_restored (tab);
14 });
15
16+ Gtk.Box add_button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
17 add_button = new Gtk.Button ();
18 add_button.add (new Gtk.Image.from_icon_name ("list-add-symbolic", Gtk.IconSize.MENU));
19- add_button.margin_left = 6;
20 add_button.relief = Gtk.ReliefStyle.NONE;
21 add_button.tooltip_text = _("New Tab");
22- this.notebook.set_action_widget (add_button, Gtk.PackType.START);
23- add_button.show_all ();
24 add_button.get_style_context ().add_provider (button_fix, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
25+ add_button_box.pack_start (add_button, false, false, ADD_BUTTON_PADDING);
26+ add_button_box.show_all ();
27+ this.notebook.set_action_widget (add_button_box, Gtk.PackType.START);
28
29 restore_button = new Gtk.Button ();
30 restore_button.add (new Gtk.Image.from_icon_name ("user-trash-symbolic", Gtk.IconSize.MENU));

Subscribers

People subscribed via source and target branches