[gnome-software: 8/13] app-row: Hide boxes with their content




commit 56e0b1fcbe8bfe32ae790d04ac141e328276ceb9
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu Jul 1 08:45:22 2021 +0200

    app-row: Hide boxes with their content
    
    When their content is hidden, boxes are creating spacing errors, as
    their margin is still taking into account. This helps keeping a
    consistent spacing when the boxes have visible content or not.

 src/gs-app-row.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index 5d675aa97..7b22d00ac 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -36,6 +36,7 @@ typedef struct
        GtkWidget       *button;
        GtkWidget       *spinner;
        GtkWidget       *label;
+       GtkWidget       *box_tag;
        GtkWidget       *label_warning;
        GtkWidget       *label_origin;
        GtkWidget       *label_installed;
@@ -520,6 +521,15 @@ gs_app_row_actually_refresh (GsAppRow *app_row)
                        gtk_widget_show (priv->label_warning);
                }
        }
+
+       gtk_widget_set_visible (priv->box_tag,
+                               gtk_widget_get_visible (priv->label_origin) ||
+                               gtk_widget_get_visible (priv->label_installed) ||
+                               gtk_widget_get_visible (priv->label_warning));
+
+       gtk_widget_set_visible (priv->description_box,
+                               gtk_widget_get_visible (priv->box_tag) ||
+                               gtk_widget_get_visible (priv->description_label));
 }
 
 static void
@@ -824,6 +834,7 @@ gs_app_row_class_init (GsAppRowClass *klass)
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, button);
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, spinner);
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, label);
+       gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, box_tag);
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, label_warning);
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, label_origin);
        gtk_widget_class_bind_template_child_private (widget_class, GsAppRow, label_installed);


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