[gnome-calculator] math-converter: Set the spacing and margins via CSS



commit db3f8f2936d9c8f29139d3befe1d48e6dce6913f
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Wed Mar 10 13:51:41 2021 +0100

    math-converter: Set the spacing and margins via CSS

 src/ui/buttons-programming.ui |  4 +++-
 src/ui/calculator.css         | 17 ++++++++++++-----
 src/ui/math-converter.ui      |  1 -
 3 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/src/ui/buttons-programming.ui b/src/ui/buttons-programming.ui
index 6a098175..cd5d8ea6 100644
--- a/src/ui/buttons-programming.ui
+++ b/src/ui/buttons-programming.ui
@@ -4,11 +4,13 @@
   <requires lib="gtk+" version="3.16"/>
   <object class="GtkVBox" id="button_panel">
     <property name="visible">True</property>
-    <property name="spacing">6</property>
     <child>
       <object class="GtkBox" id="hbox1">
         <property name="visible">True</property>
         <property name="orientation">horizontal</property>
+        <style>
+          <class name="converter"/>
+        </style>
         <child>
           <object class="GtkComboBoxText" id="base_combo">
             <property name="visible">True</property>
diff --git a/src/ui/calculator.css b/src/ui/calculator.css
index 69edb155..8573ae4f 100644
--- a/src/ui/calculator.css
+++ b/src/ui/calculator.css
@@ -54,11 +54,18 @@ window > deck > box > clamp > grid > box {
   padding-bottom: 12px;
 }
 
-/* This affects the keyboard mode */
-window > deck > box > clamp > grid > mathconverter {
-  padding-left: 12px;
-  padding-right: 12px;
-  padding-top: 12px;
+.converter,
+mathconverter {
+  /* Prevents the squeezer transition from being cut 12px away from the border */
+  padding: 6px 12px 0 12px;
+}
+
+.converter > :not(squeezer):not(:first-child),
+mathconverter > :not(squeezer):not(:first-child),
+.converter > squeezer:not(:first-child) > :first-child,
+mathconverter > squeezer:not(:first-child) > :first-child {
+  /* Prevents the squeezer transition from being cut 12px away from the border */
+  margin-left: 6px;
 }
 
 .bit-panel {
diff --git a/src/ui/math-converter.ui b/src/ui/math-converter.ui
index c194b4e9..d0dc9d33 100644
--- a/src/ui/math-converter.ui
+++ b/src/ui/math-converter.ui
@@ -6,7 +6,6 @@
     <property name="visible">False</property>
     <property name="can_focus">False</property>
     <property name="row_spacing">6</property>
-    <property name="column_spacing">6</property>
     <child>
       <object class="GtkComboBox" id="from_combo">
         <property name="visible">True</property>


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