[gnome-software/gnome-3-30] updates section: Fix row unrevealing to not leave behind 2 pixels



commit f27c7f55ccce0e744b7451592ca7e1a1d3d65855
Author: Kalev Lember <klember redhat com>
Date:   Thu Nov 29 12:08:12 2018 +0100

    updates section: Fix row unrevealing to not leave behind 2 pixels
    
    It's not enough to just hide the contents of the row, we also need to
    hide the row itself, as otherwise we have 2 pixels of the row left on
    the screen.

 src/gs-updates-section.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-updates-section.c b/src/gs-updates-section.c
index e37a8946..c5fc094d 100644
--- a/src/gs-updates-section.c
+++ b/src/gs-updates-section.c
@@ -68,12 +68,31 @@ _app_row_button_clicked_cb (GsAppRow *app_row, GsUpdatesSection *self)
        gs_page_update_app (GS_PAGE (self->page), app, gs_app_get_cancellable (app));
 }
 
+static void
+_row_unrevealed_cb (GObject *row, GParamSpec *pspec, gpointer data)
+{
+       GtkWidget *list;
+
+       list = gtk_widget_get_parent (GTK_WIDGET (row));
+       if (list == NULL)
+               return;
+       gtk_container_remove (GTK_CONTAINER (list), GTK_WIDGET (row));
+}
+
+static void
+_unreveal_row (GsAppRow *app_row)
+{
+       gs_app_row_unreveal (app_row);
+       g_signal_connect (app_row, "unrevealed",
+                         G_CALLBACK (_row_unrevealed_cb), NULL);
+}
+
 static void
 _app_state_notify_cb (GsApp *app, GParamSpec *pspec, gpointer user_data)
 {
        if (gs_app_get_state (app) == AS_APP_STATE_INSTALLED) {
                GsAppRow *app_row = GS_APP_ROW (user_data);
-               gs_app_row_unreveal (app_row);
+               _unreveal_row (app_row);
        }
 }
 


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