Merge lp:~elementary-apps/scratch/prefs-to-gtk-dialog into lp:~elementary-apps/scratch/scratch

Proposed by Danielle Foré
Status: Merged
Approved by: Avi Romanoff
Approved revision: 1270
Merged at revision: 1270
Proposed branch: lp:~elementary-apps/scratch/prefs-to-gtk-dialog
Merge into: lp:~elementary-apps/scratch/scratch
Diff against target: 72 lines (+10/-20)
1 file modified
src/Dialogs/PreferencesDialog.vala (+10/-20)
To merge this branch: bzr merge lp:~elementary-apps/scratch/prefs-to-gtk-dialog
Reviewer Review Type Date Requested Status
Danielle Foré Approve
Review via email: mp+214465@code.launchpad.net

Commit message

port prefs to gtk.dialog

Description of the change

Ports Scratch's prefs dialog to gtk.dialog

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

Close button isn't working. No idea why.

review: Needs Fixing
1270. By Avi Romanoff

Close button works now!

Revision history for this message
Danielle Foré (danrabbit) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Dialogs/PreferencesDialog.vala'
--- src/Dialogs/PreferencesDialog.vala 2013-06-09 18:39:15 +0000
+++ src/Dialogs/PreferencesDialog.vala 2014-04-07 03:45:22 +0000
@@ -24,7 +24,7 @@
2424
25namespace Scratch.Dialogs {25namespace Scratch.Dialogs {
2626
27 public class Preferences : Granite.Widgets.LightWindow {27 public class Preferences : Gtk.Dialog {
2828
29 public StaticNotebook main_static_notebook;29 public StaticNotebook main_static_notebook;
30 30
@@ -43,20 +43,17 @@
43 public Preferences () {43 public Preferences () {
4444
45 this.title = _("Preferences");45 this.title = _("Preferences");
46 this.type_hint = Gdk.WindowTypeHint.DIALOG;46 this.border_width = 5;
47 set_default_size (630, 330);47 set_default_size (630, 330);
48 resizable = false;48 resizable = false;
49 49
50 main_static_notebook = new StaticNotebook (false);50 main_static_notebook = new StaticNotebook (false);
51 main_static_notebook.margin = 5;
52 51
53 create_layout ();52 create_layout ();
5453
55 }54 }
5655
57 private void create_layout () {56 private void create_layout () {
58 // Create main box
59 var box = new Box (Orientation.VERTICAL, 0);
60 57
61 //create static notebook Behavior tab58 //create static notebook Behavior tab
62 var behavior_label = new Label (_("Behavior"));59 var behavior_label = new Label (_("Behavior"));
@@ -81,23 +78,16 @@
81 }78 }
82 79
83 // Close button80 // Close button
84 var close = new Button.with_label (_("Close"));81 this.response.connect ((response_id) => {
85 close.clicked.connect (() => {82 this.destroy();
86 this.destroy ();83 });
87 });84 add_button ("_Close", Gtk.ResponseType.CLOSE);
88
89 var bbox = new ButtonBox (Orientation.HORIZONTAL);
90 bbox.halign = Align.END;
91 bbox.margin_bottom = 11;
92 bbox.margin_right = 8;
93 bbox.add (close);
94 85
95 // Pack everything into the dialog86 // Pack everything into the dialog
96 box.pack_start (main_static_notebook, true, true, 0);87 Gtk.Box content = get_content_area () as Gtk.Box;
97 box.pack_start (bbox, true, false, 0);88 content.pack_start (main_static_notebook, true, true, 0);
98 this.add (box);
99 }89 }
100 90
101 void add_section (Gtk.Grid grid, Gtk.Label name, ref int row) {91 void add_section (Gtk.Grid grid, Gtk.Label name, ref int row) {
102 name.use_markup = true;92 name.use_markup = true;
103 name.set_markup ("<b>%s</b>".printf (name.get_text ()));93 name.set_markup ("<b>%s</b>".printf (name.get_text ()));
@@ -287,4 +277,4 @@
287277
288 }278 }
289279
290} // Namespace280} // Namespace
291\ No newline at end of file281\ No newline at end of file

Subscribers

People subscribed via source and target branches