From 549778a99bf1a5ba5d1dc163d321838cd4f417b3 Mon Sep 17 00:00:00 2001 From: Heliguy Date: Sun, 22 Sep 2024 01:45:38 -0400 Subject: [PATCH] Use bottom sheet and multi layout view --- src/install_page/install_page.blp | 90 ++++++++++++++++++++++++++----- src/install_page/install_page.py | 3 +- 2 files changed, 78 insertions(+), 15 deletions(-) diff --git a/src/install_page/install_page.blp b/src/install_page/install_page.blp index 127a6e1..59cdb68 100644 --- a/src/install_page/install_page.blp +++ b/src/install_page/install_page.blp @@ -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 {}; } } } diff --git a/src/install_page/install_page.py b/src/install_page/install_page.py index 40bc5be..a114426 100644 --- a/src/install_page/install_page.py +++ b/src/install_page/install_page.py @@ -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)