[libhandy/wip/exalm/expander-action: 9/11] expander-row: Move switch to the left of the arrow



commit 3b1a2f93ad927c71ec7c4bf4762deac2e936d52e
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon May 18 21:26:59 2020 +0500

    expander-row: Move switch to the left of the arrow
    
    Also remove the separator and add margin instead.

 src/hdy-expander-row.c        |  2 --
 src/hdy-expander-row.ui       | 24 ++++++++----------------
 src/themes/Adwaita-dark.css   |  4 ++++
 src/themes/Adwaita.css        |  4 ++++
 src/themes/_Adwaita-base.scss |  4 ++++
 src/themes/_definitions.scss  | 10 ++++++++++
 6 files changed, 30 insertions(+), 18 deletions(-)
---
diff --git a/src/hdy-expander-row.c b/src/hdy-expander-row.c
index e4b11e39..46f444b4 100644
--- a/src/hdy-expander-row.c
+++ b/src/hdy-expander-row.c
@@ -41,7 +41,6 @@ typedef struct
   HdyActionRow *action_row;
   GtkSwitch *enable_switch;
   GtkImage *image;
-  GtkSeparator *separator;
 
   gboolean expanded;
   gboolean enable_expansion;
@@ -358,7 +357,6 @@ hdy_expander_row_class_init (HdyExpanderRowClass *klass)
   gtk_widget_class_bind_template_child_private (widget_class, HdyExpanderRow, box);
   gtk_widget_class_bind_template_child_private (widget_class, HdyExpanderRow, list);
   gtk_widget_class_bind_template_child_private (widget_class, HdyExpanderRow, image);
-  gtk_widget_class_bind_template_child_private (widget_class, HdyExpanderRow, separator);
   gtk_widget_class_bind_template_child_private (widget_class, HdyExpanderRow, enable_switch);
   gtk_widget_class_bind_template_callback (widget_class, activate_cb);
   gtk_widget_class_bind_template_callback (widget_class, list_children_changed_cb);
diff --git a/src/hdy-expander-row.ui b/src/hdy-expander-row.ui
index 97d656e6..daceedec 100644
--- a/src/hdy-expander-row.ui
+++ b/src/hdy-expander-row.ui
@@ -40,6 +40,14 @@
                 <style>
                   <class name="header"/>
                 </style>
+                <child>
+                  <object class="GtkSwitch" id="enable_switch">
+                    <property name="active" bind-source="HdyExpanderRow" bind-property="enable-expansion" 
bind-flags="bidirectional|sync-create"/>
+                    <property name="can-focus">True</property>
+                    <property name="valign">center</property>
+                    <property name="visible" bind-source="HdyExpanderRow" bind-property="show-enable-switch" 
bind-flags="bidirectional|sync-create"/>
+                  </object>
+                </child>
                 <child>
                   <object class="GtkImage" id="image">
                     <property name="can-focus">False</property>
@@ -52,22 +60,6 @@
                     </style>
                   </object>
                 </child>
-                <child>
-                  <object class="GtkSeparator" id="separator">
-                    <property name="margin-bottom">8</property>
-                    <property name="margin-top">8</property>
-                    <property name="orientation">vertical</property>
-                    <property name="visible" bind-source="HdyExpanderRow" bind-property="show-enable-switch" 
bind-flags="sync-create"/>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkSwitch" id="enable_switch">
-                    <property name="active" bind-source="HdyExpanderRow" bind-property="enable-expansion" 
bind-flags="bidirectional|sync-create"/>
-                    <property name="can-focus">True</property>
-                    <property name="valign">center</property>
-                    <property name="visible" bind-source="HdyExpanderRow" bind-property="show-enable-switch" 
bind-flags="bidirectional|sync-create"/>
-                  </object>
-                </child>
               </object>
             </child>
           </object>
diff --git a/src/themes/Adwaita-dark.css b/src/themes/Adwaita-dark.css
index 51228c9d..1cf5efeb 100644
--- a/src/themes/Adwaita-dark.css
+++ b/src/themes/Adwaita-dark.css
@@ -90,6 +90,10 @@ popover.combo scrollbar.vertical:dir(rtl) { border-top-left-radius: 8px; -gtk-ou
 
 row.expander { padding: 0px; }
 
+row.expander image.expander-row-arrow:dir(ltr) { margin-left: 6px; }
+
+row.expander image.expander-row-arrow:dir(rtl) { margin-right: 6px; }
+
 keypad .digit { font-size: 200%; font-weight: bold; }
 
 keypad .letters { font-size: 70%; }
diff --git a/src/themes/Adwaita.css b/src/themes/Adwaita.css
index 34c3d6ef..cab57756 100644
--- a/src/themes/Adwaita.css
+++ b/src/themes/Adwaita.css
@@ -90,6 +90,10 @@ popover.combo scrollbar.vertical:dir(rtl) { border-top-left-radius: 8px; -gtk-ou
 
 row.expander { padding: 0px; }
 
+row.expander image.expander-row-arrow:dir(ltr) { margin-left: 6px; }
+
+row.expander image.expander-row-arrow:dir(rtl) { margin-right: 6px; }
+
 keypad .digit { font-size: 200%; font-weight: bold; }
 
 keypad .letters { font-size: 70%; }
diff --git a/src/themes/_Adwaita-base.scss b/src/themes/_Adwaita-base.scss
index 166a5d3d..df287ed3 100644
--- a/src/themes/_Adwaita-base.scss
+++ b/src/themes/_Adwaita-base.scss
@@ -53,6 +53,10 @@ popover.combo {
 
 row.expander {
   padding: 0px;
+
+  image.expander-row-arrow {
+    @include margin-start(6px);
+  }
 }
 
 // HdyKeypad
diff --git a/src/themes/_definitions.scss b/src/themes/_definitions.scss
index f3aa4db4..de9cc9c4 100644
--- a/src/themes/_definitions.scss
+++ b/src/themes/_definitions.scss
@@ -52,3 +52,13 @@ $leaflet_border: rgba(0, 0, 0, if($variant == 'light', 0.05, 0.2));
     }
   }
 }
+
+@mixin margin-start($margin) {
+  &:dir(ltr) {
+    margin-left: $margin;
+  }
+
+  &:dir(rtl) {
+    margin-right: $margin;
+  }
+}


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