[dconf-editor] Left-align customisation widgets in RegistryInfo.



commit 74543983cf4a65d3b3ad0295c133b495a9dfffa6
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon Jul 18 02:47:02 2016 +0200

    Left-align customisation widgets in RegistryInfo.

 editor/dconf-editor.css   |    7 +++++++
 editor/dconf-view.vala    |   31 +++++++++++++++++--------------
 editor/property-row.ui    |    3 +++
 editor/registry-info.vala |    2 +-
 4 files changed, 28 insertions(+), 15 deletions(-)
---
diff --git a/editor/dconf-editor.css b/editor/dconf-editor.css
index be06769..8a7e49f 100644
--- a/editor/dconf-editor.css
+++ b/editor/dconf-editor.css
@@ -175,3 +175,10 @@ list.properties-list:dir(rtl) > row > grid > label { padding-left:1em; }
 .bold-label {
   font-weight:bold;
 }
+
+.greyed-label {
+  color:@theme_fg_color;
+}
+.greyed-label:backdrop {
+  color:@theme_unfocused_fg_color;
+}
diff --git a/editor/dconf-view.vala b/editor/dconf-view.vala
index bc46943..a8c5030 100644
--- a/editor/dconf-view.vala
+++ b/editor/dconf-view.vala
@@ -37,7 +37,7 @@ private class KeyEditorChildEnum : MenuButton, KeyEditorChild
     {
         this.visible = true;
         this.hexpand = true;
-        this.halign = Align.END;
+        this.halign = Align.START;
         this.use_popover = true;
         this.width_request = 100;
 
@@ -79,18 +79,20 @@ private class KeyEditorChildFlags : Grid, KeyEditorChild
     {
         this.visible = true;
         this.hexpand = true;
-
-        label.visible = true;
-        label.halign = Align.START;
-        label.hexpand = true;
-        this.attach (label, 0, 0, 1, 1);
+        this.orientation = Orientation.HORIZONTAL;
+        this.column_spacing = 8;
 
         MenuButton button = new MenuButton ();
         button.visible = true;
         button.use_popover = true;
-        button.halign = Align.END;
+        button.halign = Align.START;
         ((StyleContext) button.get_style_context ()).add_class ("image-button");
-        this.attach (button, 1, 0, 1, 1);
+        this.add (button);
+
+        label.visible = true;
+        label.halign = Align.START;
+        label.hexpand = true;
+        this.add (label);
 
         ContextPopover popover = new ContextPopover ();
         popover.create_flags_list (key);
@@ -127,7 +129,7 @@ private class KeyEditorChildNullableBool : MenuButton, KeyEditorChild
     {
         this.visible = true;
         this.hexpand = true;
-        this.halign = Align.END;
+        this.halign = Align.START;
         this.use_popover = true;
         this.width_request = 100;
 
@@ -172,7 +174,8 @@ private class KeyEditorChildBool : Grid, KeyEditorChild // might be managed by a
     {
         this.visible = true;
         this.hexpand = true;
-        this.halign = Align.END;
+        this.orientation = Orientation.HORIZONTAL;
+        this.halign = Align.START;
         this.column_homogeneous = true;
         this.width_request = 100;
         ((StyleContext) this.get_style_context ()).add_class ("linked");
@@ -180,12 +183,12 @@ private class KeyEditorChildBool : Grid, KeyEditorChild // might be managed by a
         ToggleButton button_false = new ToggleButton ();
         button_false.visible = true;
         button_false.label = Key.cool_boolean_text_value (false);
-        this.attach (button_false, 0, 0, 1, 1);
+        this.add (button_false);
 
         button_true = new ToggleButton ();
         button_true.visible = true;
         button_true.label = Key.cool_boolean_text_value (true);
-        this.attach (button_true, 1, 0, 1, 1);
+        this.add (button_true);
 
         button_true.active = initial_value;
         button_true.bind_property ("active", button_false, "active", 
BindingFlags.INVERT_BOOLEAN|BindingFlags.SYNC_CREATE|BindingFlags.BIDIRECTIONAL);
@@ -214,7 +217,7 @@ private class KeyEditorChildNumberDouble : SpinButton, KeyEditorChild
     {
         this.visible = true;
         this.hexpand = true;
-        this.halign = Align.END;
+        this.halign = Align.START;
 
         double min, max;
         if (key.has_schema && ((GSettingsKey) key).range_type == "range")
@@ -266,7 +269,7 @@ private class KeyEditorChildNumberInt : SpinButton, KeyEditorChild
 
         this.visible = true;
         this.hexpand = true;
-        this.halign = Align.END;
+        this.halign = Align.START;
 
         double min, max;
         if (key.has_schema && ((GSettingsKey) key).range_type == "range")
diff --git a/editor/property-row.ui b/editor/property-row.ui
index 72b8d4c..294d22f 100644
--- a/editor/property-row.ui
+++ b/editor/property-row.ui
@@ -17,6 +17,9 @@
             <property name="vexpand">true</property>
             <property name="xalign">1</property>
             <property name="yalign">0</property>
+            <style>
+              <class name="greyed-label"/>
+            </style>
           </object>
         </child>
       </object>
diff --git a/editor/registry-info.vala b/editor/registry-info.vala
index 5e9cb20..cab9e81 100644
--- a/editor/registry-info.vala
+++ b/editor/registry-info.vala
@@ -65,7 +65,7 @@ class RegistryInfo : Grid
         if (has_schema)
         {
             Switch custom_value_switch = new Switch ();
-            custom_value_switch.halign = Align.END;
+            custom_value_switch.halign = Align.START;
             custom_value_switch.hexpand = true;
             custom_value_switch.show ();
             add_row_from_widget (_("Use default value"), custom_value_switch, null);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]