[gnome-software: 9/13] app-row: Expand the name when there is no description




commit 2417c222e04f997022020f1352b2ad33172f023a
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu Jul 1 08:49:44 2021 +0200

    app-row: Expand the name when there is no description
    
    This lets the name take up more space when there is no description,
    otherwise it is oddly squished at the start of the row.

 src/gs-app-row.c  | 6 ++++++
 src/gs-app-row.ui | 1 -
 2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index 7b22d00ac..38a7506d1 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -530,6 +530,12 @@ gs_app_row_actually_refresh (GsAppRow *app_row)
        gtk_widget_set_visible (priv->description_box,
                                gtk_widget_get_visible (priv->box_tag) ||
                                gtk_widget_get_visible (priv->description_label));
+
+       gtk_widget_set_hexpand (priv->name_box,
+                               !gtk_widget_get_visible (priv->description_box));
+
+       gtk_label_set_max_width_chars (GTK_LABEL (priv->name_label),
+                                      gtk_widget_get_visible (priv->description_box) ? 20 : -1);
 }
 
 static void
diff --git a/src/gs-app-row.ui b/src/gs-app-row.ui
index e825092a3..34cda38a5 100644
--- a/src/gs-app-row.ui
+++ b/src/gs-app-row.ui
@@ -32,7 +32,6 @@
               <object class="GtkLabel" id="name_label">
                 <property name="visible">True</property>
                 <property name="wrap">True</property>
-                <property name="max_width_chars">20</property>
                 <property name="xalign">0.0</property>
                 <property name="yalign">0.5</property>
                 <property name="ellipsize">end</property>


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