Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/bz-apps-page.blp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Adjustment>.value, carousel.visible) as <bool>;
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 {
Expand All @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions src/bz-apps-page.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
Loading