Skip to content
Closed
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
2 changes: 1 addition & 1 deletion blueprint-compiler
Submodule blueprint-compiler updated from 402677 to 87a8ef
46 changes: 46 additions & 0 deletions src/Library/demos/Banner/main.blp
Original file line number Diff line number Diff line change
@@ -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";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: "Gnome Banner Test";
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;
}
Comment on lines +26 to +32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is better, but the banner should really be up at the top of the window, with no margins, right under the header bar.

Then maybe make it so clicking "Troubleshoot" hides the banner and shows the toast. Where the banner is now, add a button so the banner can be re-opened.


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";
}
}
}
}
}
16 changes: 16 additions & 0 deletions src/Library/demos/Banner/main.js
Original file line number Diff line number Diff line change
@@ -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);
10 changes: 10 additions & 0 deletions src/Library/demos/Banner/main.json
Original file line number Diff line number Diff line change
@@ -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
}