[gnome-control-center] sound: Make the panel adaptive



commit c74d28009c62bfc888933edd52b10b5b47abf30a
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Mon Feb 18 15:01:04 2019 +0100

    sound: Make the panel adaptive
    
    Use a HdyColumn and ellipsize same labels so the panel can fit in
    narrower windows.

 panels/sound/cc-device-combo-box.ui |  4 +++-
 panels/sound/cc-sound-button.ui     |  1 +
 panels/sound/cc-sound-panel.ui      | 29 +++++++++++++++--------------
 panels/sound/cc-stream-row.ui       |  2 ++
 4 files changed, 21 insertions(+), 15 deletions(-)
---
diff --git a/panels/sound/cc-device-combo-box.ui b/panels/sound/cc-device-combo-box.ui
index 22d45da9f..e54f292f0 100644
--- a/panels/sound/cc-device-combo-box.ui
+++ b/panels/sound/cc-device-combo-box.ui
@@ -12,7 +12,9 @@
       </attributes>
     </child>
     <child>
-      <object class="GtkCellRendererText"/>
+      <object class="GtkCellRendererText">
+        <property name="ellipsize">end</property>
+      </object>
       <attributes>
         <attribute name="text">0</attribute>
       </attributes>
diff --git a/panels/sound/cc-sound-button.ui b/panels/sound/cc-sound-button.ui
index 64db54121..1bce20f65 100644
--- a/panels/sound/cc-sound-button.ui
+++ b/panels/sound/cc-sound-button.ui
@@ -19,6 +19,7 @@
           <object class="GtkLabel" id="label">
             <property name="visible">True</property>
             <property name="wrap">True</property>
+            <property name="wrap_mode">word-char</property>
           </object>
         </child>
       </object>
diff --git a/panels/sound/cc-sound-panel.ui b/panels/sound/cc-sound-panel.ui
index a6ce920b2..31175cff6 100644
--- a/panels/sound/cc-sound-panel.ui
+++ b/panels/sound/cc-sound-panel.ui
@@ -8,19 +8,18 @@
         <property name="visible">True</property>
         <property name="hscrollbar_policy">never</property>
         <child>
-          <object class="GtkBox">
+          <object class="HdyColumn">
             <property name="visible">True</property>
-            <child>
-              <object class="GtkBox">
-                <property name="visible">True</property>
-                <property name="hexpand">True</property>
-              </object>
-            </child>
+            <property name="maximum_width">600</property>
+            <property name="linear_growth_width">400</property>
+            <property name="margin_top">32</property>
+            <property name="margin_bottom">32</property>
+            <property name="margin_start">12</property>
+            <property name="margin_end">12</property>
             <child>
               <object class="GtkBox" id="main_box">
                 <property name="visible">True</property>
                 <property name="orientation">vertical</property>
-                <property name="margin">32</property>
                 <property name="spacing">12</property>
                 <property name="hexpand">True</property>
                 <child>
@@ -90,6 +89,7 @@
                                 <child>
                                   <object class="GtkLabel" id="output_device_label">
                                     <property name="visible">True</property>
+                                    <property name="ellipsize">end</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">Output Device</property>
                                   </object>
@@ -143,6 +143,7 @@
                                 <child>
                                   <object class="GtkLabel" id="output_configuration_label">
                                     <property name="visible">True</property>
+                                    <property name="ellipsize">end</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">Configuration</property>
                                   </object>
@@ -175,6 +176,7 @@
                                 <child>
                                   <object class="GtkLabel" id="output_balance_label">
                                     <property name="visible">True</property>
+                                    <property name="ellipsize">end</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">Balance</property>
                                   </object>
@@ -201,6 +203,7 @@
                                 <child>
                                   <object class="GtkLabel" id="output_fade_label">
                                     <property name="visible">True</property>
+                                    <property name="ellipsize">end</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">Fade</property>
                                   </object>
@@ -227,6 +230,7 @@
                                 <child>
                                   <object class="GtkLabel" id="output_subwoofer_label">
                                     <property name="visible">True</property>
+                                    <property name="ellipsize">end</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">Subwoofer</property>
                                   </object>
@@ -275,6 +279,7 @@
                                 <child>
                                   <object class="GtkLabel" id="input_device_label">
                                     <property name="visible">True</property>
+                                    <property name="ellipsize">end</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">Input Device</property>
                                   </object>
@@ -315,6 +320,7 @@
                                 <child>
                                   <object class="GtkLabel" id="input_configuration_label">
                                     <property name="visible">True</property>
+                                    <property name="ellipsize">end</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">Configuration</property>
                                   </object>
@@ -347,6 +353,7 @@
                                 <child>
                                   <object class="GtkLabel" id="input_volume_label">
                                     <property name="visible">True</property>
+                                    <property name="ellipsize">end</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">Volume</property>
                                   </object>
@@ -384,12 +391,6 @@
                 </child>
               </object>
             </child>
-            <child>
-              <object class="GtkBox">
-                <property name="visible">True</property>
-                <property name="hexpand">True</property>
-              </object>
-            </child>
           </object>
         </child>
       </object>
diff --git a/panels/sound/cc-stream-row.ui b/panels/sound/cc-stream-row.ui
index 6571b8c95..8930f4fda 100644
--- a/panels/sound/cc-stream-row.ui
+++ b/panels/sound/cc-stream-row.ui
@@ -19,6 +19,8 @@
               <child>
                 <object class="GtkLabel" id="name_label">
                   <property name="visible">True</property>
+                  <property name="ellipsize">end</property>
+                  <property name="xalign">0</property>
                 </object>
               </child>
           </object>


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