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
1=== modified file 'src/Dialogs/PreferencesDialog.vala'
2--- src/Dialogs/PreferencesDialog.vala 2013-06-09 18:39:15 +0000
3+++ src/Dialogs/PreferencesDialog.vala 2014-04-07 03:45:22 +0000
4@@ -24,7 +24,7 @@
5
6 namespace Scratch.Dialogs {
7
8- public class Preferences : Granite.Widgets.LightWindow {
9+ public class Preferences : Gtk.Dialog {
10
11 public StaticNotebook main_static_notebook;
12
13@@ -43,20 +43,17 @@
14 public Preferences () {
15
16 this.title = _("Preferences");
17- this.type_hint = Gdk.WindowTypeHint.DIALOG;
18+ this.border_width = 5;
19 set_default_size (630, 330);
20 resizable = false;
21
22 main_static_notebook = new StaticNotebook (false);
23- main_static_notebook.margin = 5;
24
25 create_layout ();
26
27 }
28
29 private void create_layout () {
30- // Create main box
31- var box = new Box (Orientation.VERTICAL, 0);
32
33 //create static notebook Behavior tab
34 var behavior_label = new Label (_("Behavior"));
35@@ -81,23 +78,16 @@
36 }
37
38 // Close button
39- var close = new Button.with_label (_("Close"));
40- close.clicked.connect (() => {
41- this.destroy ();
42- });
43-
44- var bbox = new ButtonBox (Orientation.HORIZONTAL);
45- bbox.halign = Align.END;
46- bbox.margin_bottom = 11;
47- bbox.margin_right = 8;
48- bbox.add (close);
49+ this.response.connect ((response_id) => {
50+ this.destroy();
51+ });
52+ add_button ("_Close", Gtk.ResponseType.CLOSE);
53
54 // Pack everything into the dialog
55- box.pack_start (main_static_notebook, true, true, 0);
56- box.pack_start (bbox, true, false, 0);
57- this.add (box);
58+ Gtk.Box content = get_content_area () as Gtk.Box;
59+ content.pack_start (main_static_notebook, true, true, 0);
60 }
61-
62+
63 void add_section (Gtk.Grid grid, Gtk.Label name, ref int row) {
64 name.use_markup = true;
65 name.set_markup ("<b>%s</b>".printf (name.get_text ()));
66@@ -287,4 +277,4 @@
67
68 }
69
70-} // Namespace
71+} // Namespace
72\ No newline at end of file

Subscribers

People subscribed via source and target branches