[gnome-software/gbsneto/no-size-groups] app-row: Remove image size group




commit 1e97ef8be038c84a1f853123c251778ff6699596
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Dec 17 12:42:08 2021 -0300

    app-row: Remove image size group
    
    We already set the pixel-size property of the image, which
    should force it to have at least AND at most that size. Size
    groups are also not very performant, specially when used like
    this, with too many widgets.
    
    Remove the image size group from GsAppRow.

 src/gs-app-row.c         | 3 ---
 src/gs-app-row.h         | 1 -
 src/gs-extras-page.c     | 4 ----
 src/gs-installed-page.c  | 4 ----
 src/gs-moderate-page.c   | 4 ----
 src/gs-search-page.c     | 4 ----
 src/gs-update-list.c     | 4 ----
 src/gs-updates-section.c | 4 ----
 8 files changed, 28 deletions(-)
---
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index b35432557..7ff1b1c15 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -861,7 +861,6 @@ gs_app_row_init (GsAppRow *app_row)
 
 void
 gs_app_row_set_size_groups (GsAppRow *app_row,
-                           GtkSizeGroup *image,
                            GtkSizeGroup *name,
                            GtkSizeGroup *desc,
                            GtkSizeGroup *button_label,
@@ -869,8 +868,6 @@ gs_app_row_set_size_groups (GsAppRow *app_row,
 {
        GsAppRowPrivate *priv = gs_app_row_get_instance_private (app_row);
 
-       if (image != NULL)
-               gtk_size_group_add_widget (image, priv->image);
        if (name != NULL)
                gtk_size_group_add_widget (name, priv->name_box);
        if (desc != NULL)
diff --git a/src/gs-app-row.h b/src/gs-app-row.h
index 2c34f502b..560d45c3e 100644
--- a/src/gs-app-row.h
+++ b/src/gs-app-row.h
@@ -43,7 +43,6 @@ void           gs_app_row_set_show_update             (GsAppRow       *app_row,
                                                         gboolean        show_update);
 GsApp          *gs_app_row_get_app                     (GsAppRow       *app_row);
 void            gs_app_row_set_size_groups             (GsAppRow       *app_row,
-                                                        GtkSizeGroup   *image,
                                                         GtkSizeGroup   *name,
                                                         GtkSizeGroup   *desc,
                                                         GtkSizeGroup   *button_label,
diff --git a/src/gs-extras-page.c b/src/gs-extras-page.c
index c55814687..e3916e430 100644
--- a/src/gs-extras-page.c
+++ b/src/gs-extras-page.c
@@ -45,7 +45,6 @@ struct _GsExtrasPage
        GCancellable             *search_cancellable;
        GsShell                  *shell;
        GsExtrasPageState         state;
-       GtkSizeGroup             *sizegroup_image;
        GtkSizeGroup             *sizegroup_name;
        GtkSizeGroup             *sizegroup_desc;
        GtkSizeGroup             *sizegroup_button_label;
@@ -323,7 +322,6 @@ gs_extras_page_add_app (GsExtrasPage *self, GsApp *app, GsAppList *list, SearchD
 
        gtk_list_box_append (GTK_LIST_BOX (self->list_box_results), app_row);
        gs_app_row_set_size_groups (GS_APP_ROW (app_row),
-                                   self->sizegroup_image,
                                    self->sizegroup_name,
                                    self->sizegroup_desc,
                                    self->sizegroup_button_label,
@@ -1273,7 +1271,6 @@ gs_extras_page_dispose (GObject *object)
        g_cancellable_cancel (self->search_cancellable);
        g_clear_object (&self->search_cancellable);
 
-       g_clear_object (&self->sizegroup_image);
        g_clear_object (&self->sizegroup_name);
        g_clear_object (&self->sizegroup_desc);
        g_clear_object (&self->sizegroup_button_label);
@@ -1297,7 +1294,6 @@ gs_extras_page_init (GsExtrasPage *self)
        gtk_widget_init_template (GTK_WIDGET (self));
 
        self->state = GS_EXTRAS_PAGE_STATE_LOADING;
-       self->sizegroup_image = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
        self->sizegroup_name = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
        self->sizegroup_desc = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
        self->sizegroup_button_label = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
diff --git a/src/gs-installed-page.c b/src/gs-installed-page.c
index 6da76365a..b4751ee2e 100644
--- a/src/gs-installed-page.c
+++ b/src/gs-installed-page.c
@@ -25,7 +25,6 @@ struct _GsInstalledPage
 
        GsPluginLoader          *plugin_loader;
        GCancellable            *cancellable;
-       GtkSizeGroup            *sizegroup_image;
        GtkSizeGroup            *sizegroup_name;
        GtkSizeGroup            *sizegroup_desc;
        GtkSizeGroup            *sizegroup_button_label;
@@ -360,7 +359,6 @@ gs_installed_page_add_app (GsInstalledPage *self, GsAppList *list, GsApp *app)
        update_groups (self);
 
        gs_app_row_set_size_groups (GS_APP_ROW (app_row),
-                                   self->sizegroup_image,
                                    self->sizegroup_name,
                                    self->sizegroup_desc,
                                    self->sizegroup_button_label,
@@ -747,7 +745,6 @@ gs_installed_page_dispose (GObject *object)
 {
        GsInstalledPage *self = GS_INSTALLED_PAGE (object);
 
-       g_clear_object (&self->sizegroup_image);
        g_clear_object (&self->sizegroup_name);
        g_clear_object (&self->sizegroup_desc);
        g_clear_object (&self->sizegroup_button_label);
@@ -819,7 +816,6 @@ gs_installed_page_init (GsInstalledPage *self)
 {
        gtk_widget_init_template (GTK_WIDGET (self));
 
-       self->sizegroup_image = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
        self->sizegroup_name = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
        self->sizegroup_desc = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
        self->sizegroup_button_label = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
diff --git a/src/gs-moderate-page.c b/src/gs-moderate-page.c
index b1ad167d4..c26d0bbdc 100644
--- a/src/gs-moderate-page.c
+++ b/src/gs-moderate-page.c
@@ -26,7 +26,6 @@ struct _GsModeratePage
 
        GsPluginLoader          *plugin_loader;
        GCancellable            *cancellable;
-       GtkSizeGroup            *sizegroup_image;
        GtkSizeGroup            *sizegroup_name;
        GtkSizeGroup            *sizegroup_desc;
        GtkSizeGroup            *sizegroup_button_label;
@@ -160,7 +159,6 @@ gs_moderate_page_add_app (GsModeratePage *self, GsApp *app)
        gs_app_row_set_show_buttons (GS_APP_ROW (app_row), TRUE);
        gtk_list_box_append (GTK_LIST_BOX (self->list_box_install), app_row);
        gs_app_row_set_size_groups (GS_APP_ROW (app_row),
-                                   self->sizegroup_image,
                                    self->sizegroup_name,
                                    self->sizegroup_desc,
                                    self->sizegroup_button_label,
@@ -361,7 +359,6 @@ gs_moderate_page_dispose (GObject *object)
 {
        GsModeratePage *self = GS_MODERATE_PAGE (object);
 
-       g_clear_object (&self->sizegroup_image);
        g_clear_object (&self->sizegroup_name);
        g_clear_object (&self->sizegroup_desc);
        g_clear_object (&self->sizegroup_button_label);
@@ -422,7 +419,6 @@ gs_moderate_page_init (GsModeratePage *self)
        g_signal_connect (self->list_box_install, "row-activated",
                          G_CALLBACK (gs_moderate_page_selection_changed_cb), self);
 
-       self->sizegroup_image = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
        self->sizegroup_name = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
        self->sizegroup_desc = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
        self->sizegroup_button_label = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
diff --git a/src/gs-search-page.c b/src/gs-search-page.c
index 055bb7a68..d58ef9d25 100644
--- a/src/gs-search-page.c
+++ b/src/gs-search-page.c
@@ -26,7 +26,6 @@ struct _GsSearchPage
        GsPluginLoader          *plugin_loader;
        GCancellable            *cancellable;
        GCancellable            *search_cancellable;
-       GtkSizeGroup            *sizegroup_image;
        GtkSizeGroup            *sizegroup_name;
        GtkSizeGroup            *sizegroup_desc;
        GtkSizeGroup            *sizegroup_button_label;
@@ -153,7 +152,6 @@ gs_search_page_get_search_cb (GObject *source_object,
                                  self);
                gtk_list_box_append (GTK_LIST_BOX (self->list_box_search), app_row);
                gs_app_row_set_size_groups (GS_APP_ROW (app_row),
-                                           self->sizegroup_image,
                                            self->sizegroup_name,
                                            self->sizegroup_desc,
                                            self->sizegroup_button_label,
@@ -476,7 +474,6 @@ gs_search_page_dispose (GObject *object)
 {
        GsSearchPage *self = GS_SEARCH_PAGE (object);
 
-       g_clear_object (&self->sizegroup_image);
        g_clear_object (&self->sizegroup_name);
        g_clear_object (&self->sizegroup_desc);
        g_clear_object (&self->sizegroup_button_label);
@@ -534,7 +531,6 @@ gs_search_page_init (GsSearchPage *self)
 {
        gtk_widget_init_template (GTK_WIDGET (self));
 
-       self->sizegroup_image = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
        self->sizegroup_name = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
        self->sizegroup_desc = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
        self->sizegroup_button_label = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
diff --git a/src/gs-update-list.c b/src/gs-update-list.c
index 0c12578a0..034d60380 100644
--- a/src/gs-update-list.c
+++ b/src/gs-update-list.c
@@ -18,7 +18,6 @@
 
 typedef struct
 {
-       GtkSizeGroup            *sizegroup_image;
        GtkSizeGroup            *sizegroup_name;
        GtkSizeGroup            *sizegroup_desc;
        GtkListBox              *listbox;
@@ -63,7 +62,6 @@ gs_update_list_add_app (GsUpdateList *update_list, GsApp *app)
        gs_app_row_set_show_buttons (GS_APP_ROW (app_row), FALSE);
        gtk_list_box_append (priv->listbox, app_row);
        gs_app_row_set_size_groups (GS_APP_ROW (app_row),
-                                   priv->sizegroup_image,
                                    priv->sizegroup_name,
                                    priv->sizegroup_desc,
                                    NULL,
@@ -95,7 +93,6 @@ gs_update_list_dispose (GObject *object)
                priv->listbox = NULL;
        }
 
-       g_clear_object (&priv->sizegroup_image);
        g_clear_object (&priv->sizegroup_name);
        g_clear_object (&priv->sizegroup_desc);
 
@@ -106,7 +103,6 @@ static void
 gs_update_list_init (GsUpdateList *update_list)
 {
        GsUpdateListPrivate *priv = gs_update_list_get_instance_private (update_list);
-       priv->sizegroup_image = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
        priv->sizegroup_name = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
        priv->sizegroup_desc = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
diff --git a/src/gs-updates-section.c b/src/gs-updates-section.c
index 8be9da1fb..8867da797 100644
--- a/src/gs-updates-section.c
+++ b/src/gs-updates-section.c
@@ -40,7 +40,6 @@ struct _GsUpdatesSection
        GCancellable            *cancellable;
        GsPage                  *page;
        GsPluginLoader          *plugin_loader;
-       GtkSizeGroup            *sizegroup_image;
        GtkSizeGroup            *sizegroup_name;
        GtkSizeGroup            *sizegroup_desc;
        GtkSizeGroup            *sizegroup_button_label;
@@ -146,7 +145,6 @@ gs_updates_section_add_app (GsUpdatesSection *self, GsApp *app)
        gs_app_list_add (self->list, app);
 
        gs_app_row_set_size_groups (GS_APP_ROW (app_row),
-                                   self->sizegroup_image,
                                    self->sizegroup_name,
                                    self->sizegroup_desc,
                                    self->sizegroup_button_label,
@@ -562,7 +560,6 @@ gs_updates_section_dispose (GObject *object)
        g_clear_object (&self->list);
        g_clear_object (&self->plugin_loader);
        g_clear_object (&self->page);
-       g_clear_object (&self->sizegroup_image);
        g_clear_object (&self->sizegroup_name);
        g_clear_object (&self->sizegroup_desc);
        g_clear_object (&self->sizegroup_button_label);
@@ -634,7 +631,6 @@ gs_updates_section_set_size_groups (GsUpdatesSection *self,
 {
        g_return_if_fail (GS_IS_UPDATES_SECTION (self));
 
-       g_set_object (&self->sizegroup_image, image);
        g_set_object (&self->sizegroup_name, name);
        g_set_object (&self->sizegroup_desc, desc);
        g_set_object (&self->sizegroup_button_label, button_label);


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