From 9815feff161896e9a35a2a091e0cce14299942c5 Mon Sep 17 00:00:00 2001 From: Alexander Vanhee <160625516+AlexanderVanhee@users.noreply.github.com> Date: Tue, 19 May 2026 21:24:42 +0200 Subject: [PATCH] Hide header bar title for apps page if regular title is visible Copies that animation thingy from the full view --- src/bz-apps-page.blp | 19 ++++++++++++++++--- src/bz-apps-page.c | 9 +++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/bz-apps-page.blp b/src/bz-apps-page.blp index 9a5c66a9..b00c15ef 100644 --- a/src/bz-apps-page.blp +++ b/src/bz-apps-page.blp @@ -5,13 +5,26 @@ template $BzAppsPage: Adw.NavigationPage { Adw.ToolbarView { [top] - Adw.HeaderBar {} + Adw.HeaderBar { + + [title] + Revealer { + reveal-child: bind $is_scrolled_down(main_scroll.vadjustment as .value, carousel.visible) as ; + transition-type: slide_up; + transition-duration: 500; + overflow: visible; + child: Label { + label: bind template.page-title; + styles ["title"] + }; + } + } content: Adw.BreakpointBin { width-request: 360; height-request: 100; - child: Gtk.ScrolledWindow { + child: Gtk.ScrolledWindow main_scroll { hscrollbar-policy: never; Adw.Clamp { @@ -26,7 +39,7 @@ template $BzAppsPage: Adw.NavigationPage { margin-top: 8; margin-bottom: 50; - $BzFeaturedCarousel { + $BzFeaturedCarousel carousel { margin-start: 3; margin-end: 3; margin-bottom: 12; diff --git a/src/bz-apps-page.c b/src/bz-apps-page.c index 48966ce0..f90fc87c 100644 --- a/src/bz-apps-page.c +++ b/src/bz-apps-page.c @@ -194,6 +194,14 @@ is_not_empty_list (gpointer object, return list != NULL && g_list_model_get_n_items (list) > 0; } +static gboolean +is_scrolled_down (gpointer object, + double value, + gboolean carousel_visible) +{ + return value > (carousel_visible ? 400.0 : 50.0); +} + static void featured_carousel_group_clicked_cb (BzAppsPage *self, BzEntryGroup *group, @@ -297,6 +305,7 @@ bz_apps_page_class_init (BzAppsPageClass *klass) gtk_widget_class_bind_template_callback (widget_class, is_not_null); gtk_widget_class_bind_template_callback (widget_class, is_not_empty_string); gtk_widget_class_bind_template_callback (widget_class, is_not_empty_list); + gtk_widget_class_bind_template_callback (widget_class, is_scrolled_down); gtk_widget_class_bind_template_callback (widget_class, bind_widget_cb); gtk_widget_class_bind_template_callback (widget_class, unbind_widget_cb); gtk_widget_class_bind_template_callback (widget_class, featured_carousel_group_clicked_cb);