From 33898e2519e3e91923361b0cf12fb2f3e78c8d6e Mon Sep 17 00:00:00 2001 From: Nokse22 <44558032+Nokse22@users.noreply.github.com> Date: Wed, 9 Oct 2024 00:28:07 +0200 Subject: [PATCH] Added Bottom Sheet demo --- src/Bottom Sheet/main.blp | 72 ++++++++++++++++++++++++++++++++++++++ src/Bottom Sheet/main.json | 6 ++++ 2 files changed, 78 insertions(+) create mode 100644 src/Bottom Sheet/main.blp create mode 100644 src/Bottom Sheet/main.json diff --git a/src/Bottom Sheet/main.blp b/src/Bottom Sheet/main.blp new file mode 100644 index 00000000..8152b0c0 --- /dev/null +++ b/src/Bottom Sheet/main.blp @@ -0,0 +1,72 @@ +using Gtk 4.0; +using Adw 1; + +Adw.Bin { + Adw.BottomSheet bottom_sheet { + bottom-bar: Label { + label: "Bottom Bar"; + margin-bottom: 12; + margin-end: 12; + margin-start: 12; + margin-top: 12; + }; + + content: Adw.StatusPage { + child: Box { + orientation: vertical; + spacing: 12; + halign: center; + LinkButton { + label: _("API Reference"); + uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.BottomSheet.html"; + } + Adw.Clamp { + child: Adw.PreferencesGroup { + Adw.SwitchRow { + active: bind bottom_sheet.full-width bidirectional; + title: "Full Width"; + } + + Adw.SwitchRow { + active: bind bottom_sheet.can-open bidirectional; + title: "Can Open"; + } + + Adw.SwitchRow { + active: bind bottom_sheet.open bidirectional; + title: "Open"; + } + }; + } + }; + + description: "Display content with a bottom sheet"; + title: "Bottom Sheet"; + }; + + sheet: Adw.StatusPage { + width-request: 360; + + child: Adw.Clamp { + child: Adw.PreferencesGroup { + Adw.SwitchRow { + active: bind bottom_sheet.can-close bidirectional; + title: "Can Close"; + } + + Adw.SwitchRow { + active: bind bottom_sheet.show-drag-handle bidirectional; + title: "Show Drag Handle"; + } + + Adw.SwitchRow { + active: bind bottom_sheet.modal bidirectional; + title: "Modal"; + } + }; + }; + + title: "Sheet"; + }; + } +} diff --git a/src/Bottom Sheet/main.json b/src/Bottom Sheet/main.json new file mode 100644 index 00000000..682ae7fb --- /dev/null +++ b/src/Bottom Sheet/main.json @@ -0,0 +1,6 @@ +{ + "category": "layout", + "description": "Display content with a bottom sheet", + "panels": ["ui", "preview"], + "autorun": true +}