Use bottom sheet and multi layout view

This commit is contained in:
Heliguy
2024-09-22 01:45:38 -04:00
parent 9d992df2fa
commit 549778a99b
2 changed files with 78 additions and 15 deletions

View File

@@ -9,30 +9,92 @@ template $InstallPage : Adw.BreakpointBin {
condition ("max-width: 600")
setters {
split_view.collapsed: true;
split_view.show-content: false;
// split_view.collapsed: true;
// split_view.show-content: false;
// results_action_bar.visible: true;
// pending_action_bar.visible: true;
// pending_page.child: null;
multi_view.layout: skinny;
}
}
Adw.NavigationPage {
title: _("Install Packages");
Adw.ToastOverlay toast_overlay {
Stack status_stack {
Adw.ToolbarView loading_view {
[top]
Adw.HeaderBar {
[start]
$SidebarButton {}
Stack {
// Adw.MultiLayoutView {
// Adw.Layout {
// name: "test1";
// Adw.LayoutSlot {
// id: "secondary";
// }
// }
// [primary]
// Adw.StatusPage {
// title: "one";
// }
// [secondary]
// Adw.StatusPage {
// title: "two";
// }
// }
Stack status_stack {
Adw.ToolbarView loading_view {
[top]
Adw.HeaderBar {
[start]
$SidebarButton {}
}
}
Adw.MultiLayoutView multi_view {
Adw.Layout wide {
Adw.NavigationSplitView split_view {
sidebar-width-fraction: 0.5;
max-sidebar-width: 999999999;
sidebar:
Adw.NavigationPage {
title: _("Select Source");
Adw.LayoutSlot {
id: "select_page";
}
}
;
content:
Adw.NavigationPage {
title: _("Pending Packages");
Adw.LayoutSlot {
id: "pending_page";
}
}
;
}
}
Adw.Layout skinny {
Adw.BottomSheet bottom_sheet {
[content]
Box {
margin-bottom: bind bottom_sheet.bottom-bar-height;
Adw.LayoutSlot {
id: "select_page";
}
}
[sheet]
Adw.LayoutSlot {
id: "pending_page";
}
[bottom-bar]
Label {
label: _("Pending Packages");
margin-top: 12;
margin-bottom: 12;
}
}
}
[select_page]
$SelectPage select_page {}
[pending_page]
$PendingPage pending_page {}
}
}
Adw.NavigationSplitView split_view {
sidebar-width-fraction: 0.5;
max-sidebar-width: 999999999;
sidebar: $SelectPage select_page {};
content: $PendingPage pending_page {};
}
}
}

View File

@@ -12,6 +12,7 @@ class InstallPage(Adw.BreakpointBin):
break_point = gtc()
split_view = gtc()
multi_view = gtc()
select_page = gtc()
pending_page = gtc()
status_stack = gtc()
@@ -32,7 +33,7 @@ class InstallPage(Adw.BreakpointBin):
def end_loading(self):
self.select_page.end_loading()
self.status_stack.set_visible_child(self.split_view)
self.status_stack.set_visible_child(self.multi_view)
def breakpoint_handler(self, bp, is_applied):
self.select_page.results_page.action_bar.set_revealed(is_applied)