From d1c1a86ad5262ef0dca80f0a9351bb1562884b63 Mon Sep 17 00:00:00 2001 From: Breadway Date: Sat, 13 Jun 2026 22:54:27 +0800 Subject: [PATCH] Fix bos-settings compile errors and use REGISTRY_TOKEN for publishing bos-settings was scaffolded but never compiled. Fixes: - main.rs: import gtk4::prelude (connect_activate/run) - window.rs: disambiguate WidgetExt::display(); drop unused GBox import - hyprland.rs: Label has no set_monospace -> use the monospace CSS class - theme.rs: drop unused prelude import Also switch package.yml to secrets.REGISTRY_TOKEN (scoped write:package), since the auto Actions token is not authorized for the owner registry. --- src/main.rs | 2 ++ src/theme.rs | 1 - src/ui/views/hyprland.rs | 2 +- src/ui/window.rs | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index fc13dc2..a5e73fd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,8 @@ mod config; mod theme; mod ui; +use gtk4::prelude::*; + fn main() { let app = gtk4::Application::builder() .application_id("com.breadway.bos-settings") diff --git a/src/theme.rs b/src/theme.rs index ae850d0..6be4f51 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -1,4 +1,3 @@ -use gtk4::prelude::*; use gtk4::CssProvider; const CSS: &str = r#" diff --git a/src/ui/views/hyprland.rs b/src/ui/views/hyprland.rs index 49ac07e..fba4537 100644 --- a/src/ui/views/hyprland.rs +++ b/src/ui/views/hyprland.rs @@ -50,7 +50,7 @@ pub fn build() -> GBox { for mon in &monitors { let lbl = Label::new(Some(mon)); lbl.set_xalign(0.0); - lbl.set_monospace(true); + lbl.add_css_class("monospace"); vbox.append(&lbl); } } diff --git a/src/ui/window.rs b/src/ui/window.rs index 0088675..c07a231 100644 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -1,5 +1,5 @@ use gtk4::prelude::*; -use gtk4::{Application, ApplicationWindow, Box as GBox, Orientation, Paned, Stack}; +use gtk4::{Application, ApplicationWindow, Orientation, Paned, Stack}; use super::sidebar; use super::views; @@ -12,7 +12,7 @@ pub fn build_ui(app: &Application) { .default_height(640) .build(); - crate::theme::load(&window.display()); + crate::theme::load(&WidgetExt::display(&window)); let hpaned = Paned::new(Orientation::Horizontal); hpaned.set_position(190);