Merge lp:~parnold-x/switchboard-plug-pantheon-shell/fix-1290340 into lp:~elementary-apps/switchboard-plug-pantheon-shell/trunk

Proposed by Djax
Status: Merged
Approved by: Cody Garver
Approved revision: 260
Merged at revision: 269
Proposed branch: lp:~parnold-x/switchboard-plug-pantheon-shell/fix-1290340
Merge into: lp:~elementary-apps/switchboard-plug-pantheon-shell/trunk
Diff against target: 65 lines (+23/-15)
1 file modified
src/Dock.vala (+23/-15)
To merge this branch: bzr merge lp:~parnold-x/switchboard-plug-pantheon-shell/fix-1290340
Reviewer Review Type Date Requested Status
Danielle Foré ux Approve
elementary Pantheon team code Pending
Review via email: mp+238084@code.launchpad.net

Commit message

Use radio buttons for hide modes and better describe them (lp:1290340)

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

UX Approve. Needs code review

review: Approve (ux)
Revision history for this message
Cody Garver (codygarver) wrote :

It makes the switchboard window really wide when I launch the plug, tested on real machine and virtual machine

260. By Djax

remove fake labels

Revision history for this message
Djax (parnold-x) wrote :

@Cody
Yep sorry. That was caused by the fake labels. Don't know why they are there to be honest because it looks the same without them here.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Dock.vala'
2--- src/Dock.vala 2014-08-11 10:39:40 +0000
3+++ src/Dock.vala 2014-10-13 10:47:49 +0000
4@@ -5,6 +5,7 @@
5 Gtk.Switch primary_monitor;
6 Gtk.Label monitor_label;
7 Gtk.ComboBoxText monitor;
8+
9 public Dock () {
10 column_spacing = 12;
11 row_spacing = 6;
12@@ -29,15 +30,26 @@
13 icon_size.changed.connect (() => plank_settings.icon_size = int.parse (icon_size.active_id));
14 icon_size.halign = Gtk.Align.START;
15
16- var hide_mode = new Gtk.ComboBoxText ();
17- hide_mode.append ("0", _("Don't hide"));
18- hide_mode.append ("1", _("Intelligent hide"));
19- hide_mode.append ("2", _("Auto hide"));
20- hide_mode.append ("3", _("Hide on maximize"));
21- hide_mode.active_id = plank_settings.hide_mode.to_string ();
22- hide_mode.changed.connect (() => plank_settings.hide_mode = int.parse (hide_mode.active_id));
23- hide_mode.halign = Gtk.Align.START;
24- hide_mode.hexpand = true;
25+ Gtk.Box hide_mode = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
26+ string[] hide_mode_labels = new string[4];
27+ hide_mode_labels[0] = _("Hide when focused window is maximized");
28+ hide_mode_labels[1] = _("Hide when focused window overlaps the dock");
29+ hide_mode_labels[2] = _("Automatically hide when not being used");
30+ hide_mode_labels[3] = _("Never hide");
31+ int[] hide_mode_ids = {3, 1, 2, 0};
32+
33+ Gtk.RadioButton button = new Gtk.RadioButton(null);
34+ for (int i = 0; i < hide_mode_labels.length; i++) {
35+ int index = i;
36+ button = new Gtk.RadioButton.with_label_from_widget (button, hide_mode_labels[i]);
37+ hide_mode.pack_start (button, false, false, 2);
38+ if (i == plank_settings.hide_mode)
39+ button.set_active (true);
40+ button.toggled.connect ((b) => {
41+ if (b.get_active ())
42+ plank_settings.hide_mode = hide_mode_ids[index];
43+ });
44+ }
45
46 var theme = new Gtk.ComboBoxText ();
47 int theme_index = 0;
48@@ -105,15 +117,11 @@
49 icon_label.set_halign (Gtk.Align.END);
50 var hide_label = new Gtk.Label (_("Hide Mode:"));
51 hide_label.set_halign (Gtk.Align.END);
52- var fake_label_1 = new Gtk.Label ("");
53- fake_label_1.hexpand = true;
54- var fake_label_2 = new Gtk.Label ("");
55- fake_label_2.hexpand = true;
56+ hide_label.set_valign (Gtk.Align.START);
57+ hide_label.set_margin_top (4);
58 var primary_monitor_grid = new Gtk.Grid ();
59 primary_monitor_grid.add (primary_monitor);
60
61- attach (fake_label_1, 0, 0, 1, 1);
62- attach (fake_label_2, 3, 0, 1, 1);
63 attach (icon_label, 1, 0, 1, 1);
64 attach (icon_size, 2, 0, 1, 1);
65 attach (hide_label, 1, 1, 1, 1);

Subscribers

People subscribed via source and target branches

to all changes: