[gnome-software/1188-only-2-items-in-carousel] gs-overview-page: Limit minimum featured apps
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/1188-only-2-items-in-carousel] gs-overview-page: Limit minimum featured apps
- Date: Tue, 31 Aug 2021 13:47:49 +0000 (UTC)
commit 15c8e91ea723320d9110e1d719008f7c9af48b72
Author: Milan Crha <mcrha redhat com>
Date: Tue Aug 31 15:46:29 2021 +0200
gs-overview-page: Limit minimum featured apps
Hide the featured carousel when there are not enough apps to be shown.
Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1188
src/gs-overview-page.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-overview-page.c b/src/gs-overview-page.c
index ace4a18c2..41a6a3b43 100644
--- a/src/gs-overview-page.c
+++ b/src/gs-overview-page.c
@@ -25,6 +25,10 @@
* 3-column layout. */
#define N_TILES 12
+/* When there are less than this number of the featured apps found
+ * the featured carousel is hidden. */
+#define MIN_FEATURED_APPS 4
+
struct _GsOverviewPage
{
GsPage parent_instance;
@@ -270,10 +274,10 @@ gs_overview_page_get_featured_cb (GObject *source_object,
/* Filter out apps which don’t have a suitable hi-res icon. */
gs_app_list_filter (list, filter_hi_res_icon, self);
- gtk_widget_set_visible (self->featured_carousel, gs_app_list_length (list) > 0);
+ gtk_widget_set_visible (self->featured_carousel, gs_app_list_length (list) >= MIN_FEATURED_APPS);
gs_featured_carousel_set_apps (GS_FEATURED_CAROUSEL (self->featured_carousel), list);
- self->empty = self->empty && (gs_app_list_length (list) == 0);
+ self->empty = self->empty && (gs_app_list_length (list) < MIN_FEATURED_APPS);
out:
gs_overview_page_decrement_action_cnt (self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]