[gnome-music/wip/jfelder/playlistscontrols-size: 2/2] playlistcontrols: Avoid a resize when the song count is updated



commit caa72aed6d5a4d96e63fd4659aec007bcd8751db
Author: Jean Felder <jfelder src gnome org>
Date:   Mon Jun 3 10:56:46 2019 +0200

    playlistcontrols: Avoid a resize when the song count is updated
    
    When a new playlist is selected from the PlaylistViews' sidebar, the
    songs_count_label is hidden while it is updated. This PlaylistControls
    is resized which results in a strange effect: the circular button on
    the right position changes two times (one time when the label is
    hidden and a second time when the label is visible again).
    
    Fix the issue by adding an empty label beside songs_count_label. This
    allows to preserve the height when the song count is updated.

 data/ui/PlaylistControls.ui | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
---
diff --git a/data/ui/PlaylistControls.ui b/data/ui/PlaylistControls.ui
index 64456fdd..4cf699ca 100644
--- a/data/ui/PlaylistControls.ui
+++ b/data/ui/PlaylistControls.ui
@@ -104,6 +104,24 @@
         <property name="height">1</property>
       </packing>
     </child>
+    <child>
+      <!-- This label is used to prevent a box resize -->
+      <!-- when the new song count is computed. -->
+      <object class="GtkLabel" id="_empty_label">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label"> </property>
+        <style>
+          <class name="dim-label"/>
+        </style>
+      </object>
+      <packing>
+        <property name="left_attach">1</property>
+        <property name="top_attach">1</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
     <child>
       <object class="GtkMenuButton" id="_menubutton">
         <property name="visible">True</property>


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