~codygarver/granite/fix-1522165

« back to all changes in this revision

Viewing changes to lib/Widgets/Welcome.vala

  • Committer: RabbitBot
  • Author(s): Corentin Noël
  • Date: 2016-01-01 01:08:29 UTC
  • mfrom: (918.1.1 granite)
  • Revision ID: rabbitbot-20160101010829-ye7ez1ljxfn1y4m4
Simplify the Welcome layout

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
    }
80
80
 
81
81
    construct {
82
 
        Gtk.Box content = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
83
 
 
84
 
        // Box properties
85
 
        content.homogeneous = false;
86
 
 
87
 
        // Top spacer
88
 
        content.pack_start (new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0), true, true, 0);
89
 
 
90
 
        // Labels
91
82
        title_label = new Gtk.Label (null);
 
83
        title_label.justify = Gtk.Justification.CENTER;
 
84
        title_label.hexpand = true;
92
85
        title_label.get_style_context ().add_class ("h1");
93
86
 
94
 
        title_label.set_justify (Gtk.Justification.CENTER);
95
 
        content.pack_start (title_label, false, true, 0);
96
 
 
97
87
        subtitle_label = new Gtk.Label (null);
 
88
        subtitle_label.justify = Gtk.Justification.CENTER;
 
89
        subtitle_label.hexpand = true;
 
90
        subtitle_label.wrap = true;
 
91
        subtitle_label.wrap_mode = Pango.WrapMode.WORD;
98
92
        subtitle_label.get_style_context ().add_class ("h2");
99
93
 
100
 
        subtitle_label.set_line_wrap (true);
101
 
        subtitle_label.set_line_wrap_mode (Pango.WrapMode.WORD);
102
 
        subtitle_label.set_justify (Gtk.Justification.CENTER);
103
 
 
104
 
        content.pack_start (subtitle_label, false, true, 2);
105
 
 
106
94
        // Options wrapper
107
 
        this.options = new Gtk.Box (Gtk.Orientation.VERTICAL, 8);
108
 
        var options_wrapper = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
109
 
 
110
 
        options_wrapper.pack_start (new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0), true, true, 0); // left padding
111
 
        options_wrapper.pack_start (this.options, false, false, 0); // actual options
112
 
        options_wrapper.pack_end (new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0), true, true, 0); // right padding
113
 
 
114
 
        content.pack_start (options_wrapper, false, false, 20);
115
 
 
116
 
        // Bottom spacer
117
 
        content.pack_end (new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0), true, true, 0);
 
95
        this.options = new Gtk.Box (Gtk.Orientation.VERTICAL, 9);
 
96
        options.halign = Gtk.Align.CENTER;
 
97
        options.margin = 12;
 
98
 
 
99
        var content = new Gtk.Grid ();
 
100
        content.expand = true;
 
101
        content.margin_top = 12;
 
102
        content.valign = Gtk.Align.CENTER;
 
103
        content.orientation = Gtk.Orientation.VERTICAL;
 
104
        content.add (title_label);
 
105
        content.add (subtitle_label);
 
106
        content.add (options);
118
107
 
119
108
        add (content);
120
109
    }