Remove the signer page's state banner

This commit is contained in:
raucao committed 2026-11-24 15:44:16 +04:00
1 parent a775805564
commit 3c196afa0c
4 files changed
+5 -34

No files matched your search

-6
View File
@@ -9,11 +9,5 @@ Adw.ApplicationWindow window {
content: Adw.ToolbarView toolbar_view {
[top]
Adw.HeaderBar header_bar {}
[bottom]
Adw.Banner banner {
title: "The signer is not running";
revealed: true;
}
};
}
+2 -7
View File
@@ -1,7 +1,7 @@
//! Adwaita widgets that default to Pango markup, built as plain text.
//!
//! `AdwActionRow` subtitles (`AdwPreferencesRow:use-markup`), `AdwBanner` titles
//! and `AdwAlertDialog` heading/body all default to **Pango markup**. Feeding
//! `AdwActionRow` subtitles (`AdwPreferencesRow:use-markup`) and
//! `AdwAlertDialog` heading/body both default to **Pango markup**. Feeding
//! them dynamic text — a `bunker://…&secret=…` connection string, an error
//! message, a client-supplied name — fails to parse at best (a bare `&` is an
//! entity error, and the text silently does not render) and, worse, lets that
@@ -40,11 +40,6 @@ pub fn expander(title: &str, subtitle: &str) -> adw::ExpanderRow {
row
}
/// Turn off markup on a banner, whose title defaults to markup.
pub fn banner(banner: &adw::Banner) {
banner.set_use_markup(false);
}
/// `value` shortened to `head…tail` characters, for one-line subtitles.
pub fn shorten(value: &str, head: usize, tail: usize) -> String {
let chars: Vec<char> = value.chars().collect();
+1 -14
View File
@@ -26,7 +26,6 @@ use crate::ui::qr;
#[derive(Clone)]
struct Handles {
stack: gtk::Stack,
banner: adw::Banner,
status: adw::ActionRow,
uri: adw::ActionRow,
device: adw::ActionRow,
@@ -58,7 +57,7 @@ pub struct SignerView {
}
impl SignerView {
pub fn new(state: Rc<AppState>, banner: adw::Banner) -> Self {
pub fn new(state: Rc<AppState>) -> Self {
let stack = gtk::Stack::builder().vexpand(true).build();
let empty = adw::StatusPage::builder()
@@ -142,7 +141,6 @@ impl SignerView {
let handles = Handles {
stack,
banner,
status,
uri,
device,
@@ -278,8 +276,6 @@ fn show_empty(handles: &Handles) {
handles.uri.set_subtitle("—");
handles.device.set_subtitle("—");
handles.toggle.set_label("Start");
handles.banner.set_title("No identity key yet — create or import one on the Keys page");
handles.banner.set_revealed(true);
}
fn start(
@@ -357,8 +353,6 @@ fn stop(handles: Handles, running: Running) {
handles.uri.set_subtitle("—");
handles.device.set_subtitle("—");
handles.toggle.set_label("Start");
handles.banner.set_title("The signer is not running");
handles.banner.set_revealed(true);
}
fn show_running(handles: &Handles, signer: &Signer) {
@@ -383,13 +377,6 @@ fn show_running(handles: &Handles, signer: &Signer) {
Ok(texture) => handles.picture.set_paintable(Some(&texture)),
Err(error) => handles.status.set_subtitle(&format!("QR failed: {error}")),
}
// Every sensitive request is put to the user; "allow always" only silences
// the exact thing it was granted for.
handles
.banner
.set_title("Regent will ask you before signing, encrypting or decrypting anything");
handles.banner.set_revealed(true);
}
/// Ask for the client's `nostrconnect://` string.
+2 -7
View File
@@ -1,4 +1,4 @@
//! The main window: a view switcher over the pages, with a state banner.
//! The main window: a view switcher over the pages.
//!
//! Pages are composed in Rust because they are built in code; Blueprint only
//! provides the window chrome.
@@ -13,7 +13,6 @@ use crate::state::AppState;
use crate::ui::activity_view::ActivityView;
use crate::ui::apps_view::AppsView;
use crate::ui::keys_view::KeysView;
use crate::ui::plain;
use crate::ui::signer_view::SignerView;
use crate::ui::switcher::IdentitySwitcher;
use crate::RESOURCE_PATH;
@@ -37,13 +36,9 @@ impl Window {
let header_bar: adw::HeaderBar = builder
.object("header_bar")
.expect("ui/window.blp must contain an object with id \"header_bar\"");
let banner: adw::Banner = builder
.object("banner")
.expect("ui/window.blp must contain an object with id \"banner\"");
plain::banner(&banner);
let keys_view = KeysView::new(Rc::clone(&state));
let signer_view = SignerView::new(Rc::clone(&state), banner);
let signer_view = SignerView::new(Rc::clone(&state));
let apps_view = AppsView::new(Rc::clone(&state));
let activity_view = ActivityView::new(Rc::clone(&state));