bos-settings 0.5.0: GNOME-Settings-style redesign + live app control

New panels: About, Network (Wi-Fi/Ethernet via nmcli), Sound (PipeWire
volume/device via pactl), Date & Time (timedatectl), and Clipboard
(breadclip previously had no bos-settings presence at all despite running
its own daemon).

Layout: every panel now shares one scaffold (6 views were hand-rolling their
own, inconsistently) with a centered, width-capped content column instead of
rows stretching edge-to-edge on a wide window with the control stranded far
from its label. Rows render as individual cards. Sidebar got human labels +
icons + task-based grouping (System/Personalization/Maintenance/About)
instead of raw binary names under "Apps"/"System".

New capability: a shared service_control() widget gives every bread app
backed by a systemd --user daemon (breadd, breadbox-sync, breadcrumbs,
breadmill, breadclipd) live status plus Start/Stop/Restart/View logs —
previously these panels only ever edited a TOML file and hoped the running
process picked it up. breadbar (no systemd unit) gets an equivalent: Save
now actually sends the SIGHUP its own reload mechanism needs, instead of
just claiming to in the hint text.

Fixed two real bugs surfaced while building About: CPU model string kept a
stray leading tab+colon (trim_start_matches was missing '\t'), and GPU
showed "unknown" on hardware whose lspci entry says "Display controller"
instead of "VGA compatible controller".

Local CSS patches (bos-settings/src/theme.rs) for two upstream bread-theme
gaps: suggested/destructive buttons and scale widgets don't clear Adwaita's
default background-image, so flat colour overrides were invisible; and
destructive-action red must not be pywal-derived (it can land on gold
depending on the wallpaper, indistinguishable from a primary action).
This commit is contained in:
Breadway 2026-07-03 23:50:26 +08:00
parent f43bfbb680
commit eb740a3724
22 changed files with 1310 additions and 250 deletions

View file

@ -32,18 +32,21 @@ fn current_wallpaper() -> Option<PathBuf> {
fn refresh_preview(preview: &Image, path_lbl: &Label) {
match current_wallpaper() {
Some(path) => {
path_lbl.set_text(&path.display().to_string());
let filename = path.file_name().map(|f| f.to_string_lossy().to_string());
path_lbl.set_text(filename.as_deref().unwrap_or("(unknown filename)"));
path_lbl.set_tooltip_text(Some(&path.display().to_string()));
preview.set_from_file(Some(&path));
}
None => {
path_lbl.set_text("No wallpaper set");
path_lbl.set_tooltip_text(None);
preview.set_icon_name(Some("image-missing"));
}
}
}
pub fn build() -> GBox {
let (outer, c) = w::view_scaffold("breadpaper");
let (outer, c) = w::view_scaffold("Wallpaper");
c.append(&w::hint(
"Sets the desktop wallpaper, generates a matching pywal palette, and \
@ -51,23 +54,30 @@ pub fn build() -> GBox {
the whole desktop's accent colors.",
));
let preview_card = GBox::new(Orientation::Vertical, 8);
preview_card.add_css_class("card");
preview_card.set_halign(gtk4::Align::Center);
preview_card.set_margin_top(8);
preview_card.set_margin_bottom(8);
let preview = Image::new();
preview.set_pixel_size(320);
preview.set_margin_top(8);
preview.set_margin_bottom(8);
c.append(&preview);
preview_card.append(&preview);
let path_lbl = Label::new(None);
path_lbl.set_wrap(true);
path_lbl.add_css_class("dim-label");
c.append(&path_lbl);
preview_card.append(&path_lbl);
c.append(&preview_card);
refresh_preview(&preview, &path_lbl);
let btn_row = GBox::new(Orientation::Horizontal, 8);
btn_row.set_margin_top(8);
btn_row.set_halign(gtk4::Align::Center);
let choose_btn = Button::with_label("Choose image...");
choose_btn.add_css_class("suggested-action");
let status = Label::new(None);
status.add_css_class("dim-label");