diff --git a/blueprint-compiler b/blueprint-compiler index 402677f68..87a8ef8a3 160000 --- a/blueprint-compiler +++ b/blueprint-compiler @@ -1 +1 @@ -Subproject commit 402677f687ecdb78026864188bae50b9d85949de +Subproject commit 87a8ef8a3bdfeff5547dc6d6cc1ca41a303ce6fb diff --git a/src/Library/demos/Banner/main.blp b/src/Library/demos/Banner/main.blp new file mode 100644 index 000000000..e94272d8d --- /dev/null +++ b/src/Library/demos/Banner/main.blp @@ -0,0 +1,46 @@ +using Gtk 4.0; +using Adw 1; + +Gtk.Window window { + default-width: 800; + default-height: 600; + title: "Banner"; + titlebar: Gtk.HeaderBar { + [end] + MenuButton button_menu { + icon-name: "open-menu-symbolic"; + primary: true; + } + }; + + Adw.ToastOverlay overlay { + Adw.StatusPage { + title: "Adw Banner"; + description: "Gnome Banner Test"; + + Box { + orientation: vertical; + halign: center; + valign: center; + + Adw.Banner banner{ + button-label: "Troubleshoot"; + title: "An error occurred: Could not resolve host."; + revealed: true; + use-markup: true; + margin-bottom: 20; + } + + LinkButton { + label: "API Reference"; + uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.3/class.Banner.html"; + } + + LinkButton { + label: "Human Interface Guidelines"; + uri: "https://developer.gnome.org/hig/patterns/feedback/banners.html"; + } + } + } + } +} diff --git a/src/Library/demos/Banner/main.js b/src/Library/demos/Banner/main.js new file mode 100644 index 000000000..d570f32ce --- /dev/null +++ b/src/Library/demos/Banner/main.js @@ -0,0 +1,16 @@ +const Adw = imports.gi.Adw; + +const banner = workbench.builder.get_object("banner"); +const overlay = workbench.builder.get_object("overlay"); + +function alert() { + const toast = new Adw.Toast({ + title: "Troubleshoot successful!", + timeout: 3, + }); + + overlay.add_toast(toast); +} + +// signal called when banner button is clicked +banner.connect("button-clicked", alert); diff --git a/src/Library/demos/Banner/main.json b/src/Library/demos/Banner/main.json new file mode 100644 index 000000000..9a444b470 --- /dev/null +++ b/src/Library/demos/Banner/main.json @@ -0,0 +1,10 @@ +{ + "name": "Banner", + "category": "user_interface", + "description": "Banners is an attention-grabbing notification that is used to communicate important information.", + "panels": [ + "ui", + "preview" + ], + "autorun": true +}