[gnome-software/1284-gs-summary-tile-define-minimum-width-for-better-display: 5/6] gs-overview-page: Replace GsHidingBox with GtkFlowBox




commit 65f23f5238c4ac059b08afbb3d843ce4fa8cfc12
Author: Milan Crha <mcrha redhat com>
Date:   Wed Jun 23 15:04:20 2021 +0200

    gs-overview-page: Replace GsHidingBox with GtkFlowBox
    
    This allows to show more lines of the applications. As the GsHidingBox
    had been used only here, it can be dropped from the code base as well.

 po/POTFILES.in          |   1 -
 src/gs-hiding-box.c     | 421 ------------------------------------------------
 src/gs-hiding-box.h     |  24 ---
 src/gs-overview-page.c  |  15 +-
 src/gs-overview-page.ui |  12 +-
 src/meson.build         |   1 -
 6 files changed, 17 insertions(+), 457 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 5c80e6086..8c620503f 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -33,7 +33,6 @@ src/gs-feature-tile.c
 src/gs-featured-carousel.c
 src/gs-featured-carousel.ui
 src/gs-first-run-dialog.ui
-src/gs-hiding-box.c
 src/gs-history-dialog.c
 src/gs-history-dialog.ui
 src/gs-installed-page.c
diff --git a/src/gs-overview-page.c b/src/gs-overview-page.c
index e092a56ae..640bced64 100644
--- a/src/gs-overview-page.c
+++ b/src/gs-overview-page.c
@@ -18,7 +18,6 @@
 #include "gs-app-list-private.h"
 #include "gs-featured-carousel.h"
 #include "gs-category-tile.h"
-#include "gs-hiding-box.h"
 #include "gs-common.h"
 #include "gs-summary-tile.h"
 
@@ -327,11 +326,15 @@ gs_overview_page_get_category_apps_cb (GObject *source_object,
        gtk_container_add (GTK_CONTAINER (headerbox), button);
        gtk_container_add (GTK_CONTAINER (self->box_popular_rotating), headerbox);
 
-       /* add hiding box */
-       box = gs_hiding_box_new ();
-       gs_hiding_box_set_spacing (GS_HIDING_BOX (box), 14);
-       gtk_widget_set_visible (box, TRUE);
-       gtk_widget_set_valign (box, GTK_ALIGN_START);
+       /* add the box */
+       box = gtk_flow_box_new ();
+       g_object_set (G_OBJECT (box),
+               "visible", TRUE,
+               "homogeneous", TRUE,
+               "column-spacing", 14,
+               "row-spacing", 14,
+               "valign", GTK_ALIGN_START,
+               NULL);
        gtk_container_add (GTK_CONTAINER (self->box_popular_rotating), box);
 
        /* add all the apps */
diff --git a/src/gs-overview-page.ui b/src/gs-overview-page.ui
index 7f597e8f2..8df471ee8 100644
--- a/src/gs-overview-page.ui
+++ b/src/gs-overview-page.ui
@@ -106,9 +106,11 @@
                               </object>
                             </child>
                             <child>
-                              <object class="GsHidingBox" id="box_popular">
+                              <object class="GtkFlowBox" id="box_popular">
                                 <property name="visible">True</property>
-                                <property name="spacing">14</property>
+                                <property name="homogeneous">True</property>
+                                <property name="column-spacing">14</property>
+                                <property name="row-spacing">14</property>
                                 <property name="valign">start</property>
                                 <accessibility>
                                   <relation target="popular_heading" type="labelled-by"/>
@@ -132,9 +134,11 @@
                               </object>
                             </child>
                             <child>
-                              <object class="GsHidingBox" id="box_recent">
+                              <object class="GtkFlowBox" id="box_recent">
                                 <property name="visible">True</property>
-                                <property name="spacing">14</property>
+                                <property name="homogeneous">True</property>
+                                <property name="column-spacing">14</property>
+                                <property name="row-spacing">14</property>
                                 <property name="valign">start</property>
                                 <accessibility>
                                   <relation target="recent_heading" type="labelled-by"/>
diff --git a/src/meson.build b/src/meson.build
index 1ffd665b4..a22557629 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -35,7 +35,6 @@ gnome_software_sources = [
   'gs-first-run-dialog.c',
   'gs-fixed-size-bin.c',
   'gs-folders.c',
-  'gs-hiding-box.c',
   'gs-history-dialog.c',
   'gs-info-bar.c',
   'gs-installed-page.c',


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