diff --git a/crates/cp-panel/src/app.rs b/crates/cp-panel/src/app.rs index 19cfda3d..057b3b1d 100644 --- a/crates/cp-panel/src/app.rs +++ b/crates/cp-panel/src/app.rs @@ -119,9 +119,6 @@ impl App { ui: panel.as_weak(), state, }; - if app.state.borrow().options.flat { - panel.global::().set_shadow_blur(0.0); - } app.wire(&panel); dress_theme(&panel, kept.light(here::system_is_light()), kept.look); refresh(&panel, &app.state); diff --git a/crates/cp-panel/src/main.rs b/crates/cp-panel/src/main.rs index 5d456782..9223efa9 100644 --- a/crates/cp-panel/src/main.rs +++ b/crates/cp-panel/src/main.rs @@ -132,7 +132,6 @@ pub struct Options { pub serve: bool, pub signals: Option, pub backdrop: String, - pub flat: bool, } impl Options { @@ -140,7 +139,6 @@ impl Options { let mut db = None; let mut measure = false; let mut serve = false; - let mut flat = false; let mut backdrop = "none".to_owned(); let mut args = std::env::args().skip(1); while let Some(arg) = args.next() { @@ -148,7 +146,6 @@ impl Options { "--db" => db = args.next().map(PathBuf::from), "--measure" => measure = true, "--serve" => serve = true, - "--flat" => flat = true, "--backdrop" => backdrop = args.next().unwrap_or_default(), other => eprintln!("argument ignored: {other}"), } @@ -164,7 +161,6 @@ impl Options { serve, signals: std::env::var_os("CP_PANEL_SIGNALS").map(PathBuf::from), backdrop, - flat, }) } } diff --git a/crates/cp-panel/src/main_test.rs b/crates/cp-panel/src/main_test.rs index 8a067d17..6ad55e9c 100644 --- a/crates/cp-panel/src/main_test.rs +++ b/crates/cp-panel/src/main_test.rs @@ -110,7 +110,7 @@ fn centre_of(bench: &Bench, index: usize) -> LogicalPosition { } else { 0.0 }; - let list_top = panel.global::().get_margin() + panel.get_list_top(); + let list_top = panel.get_list_top(); let y = list_top + panel.get_scroll_y() + top + head + (span - head - GAP) / 2.0; LogicalPosition::new(200.0, y) } @@ -151,9 +151,7 @@ fn a_double_click_pastes_the_card_under_it_whatever_was_open_and_however_slow() } bench.moved.borrow_mut().clear(); let at = centre_of(&bench, target); - let floor = bench.panel.global::().get_margin() - + bench.panel.get_list_top() - + bench.panel.get_viewport_height(); + let floor = bench.panel.get_list_top() + bench.panel.get_viewport_height(); assert!(at.y < floor, "card {target} is out of sight at {}", at.y); click(&bench.panel, at, 90); tick(gap); diff --git a/crates/cp-panel/src/showing.rs b/crates/cp-panel/src/showing.rs index 211426bb..33ec289b 100644 --- a/crates/cp-panel/src/showing.rs +++ b/crates/cp-panel/src/showing.rs @@ -20,8 +20,8 @@ pub fn place(panel: &Panel) { }; let theme = panel.global::(); let zoom = f64::from(theme.get_zoom()); - let width = f64::from(theme.get_width() + theme.get_margin() * 2.0) * zoom; - let height = f64::from(theme.get_height() + theme.get_margin() * 2.0) * zoom; + let width = f64::from(theme.get_width()) * zoom; + let height = f64::from(theme.get_height()) * zoom; let window = panel.window(); let scale = pointer.scale; if pointer.physical { @@ -60,10 +60,7 @@ pub fn zoom(panel: &Panel) { }); let side = |logical: f32| (logical * wanted).round().max(1.0) as u32; #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] - let size = slint::PhysicalSize::new( - side(theme.get_width() + theme.get_margin() * 2.0), - side(theme.get_height() + theme.get_margin() * 2.0), - ); + let size = slint::PhysicalSize::new(side(theme.get_width()), side(theme.get_height())); let bound = i_slint_backend_winit::winit::dpi::PhysicalSize::new(size.width, size.height); window.with_winit_window(|winit| { winit.set_min_inner_size(Some(bound)); diff --git a/crates/cp-panel/ui/panel.slint b/crates/cp-panel/ui/panel.slint index 56b331ed..ac1581ad 100644 --- a/crates/cp-panel/ui/panel.slint +++ b/crates/cp-panel/ui/panel.slint @@ -9,8 +9,8 @@ import { NewerStrip } from "newer.slint"; export { Card, Chip, FormRow, Theme, Words } export component Panel inherits Window { - width: Theme.width + Theme.margin * 2; - height: Theme.height + Theme.margin * 2; + width: Theme.width; + height: Theme.height; no-frame: true; always-on-top: true; background: Theme.apple ? Theme.panel : transparent; @@ -126,8 +126,6 @@ export component Panel inherits Window { panel := Rectangle { property sheet-top: root.list-top + root.sheet-anchor + root.sheet-span + list.content-y + 4px; - x: Theme.margin; - y: Theme.margin + (1.0 - root.shown) * (Theme.apple ? 0px : 8px); width: Theme.width; height: Theme.height; border-radius: Theme.radius; @@ -135,12 +133,8 @@ export component Panel inherits Window { border-color: Theme.panel-border; background: Theme.panel; opacity: Theme.apple ? 1.0 : root.shown; - drop-shadow-blur: Theme.shadow-blur; - drop-shadow-color: Theme.shadow; - drop-shadow-offset-y: Theme.apple ? 0px : 10px; clip: true; animate opacity { duration: Theme.appear; easing: ease-out; } - animate y { duration: Theme.appear; easing: ease-out; } VerticalLayout { padding: 0px; diff --git a/crates/cp-panel/ui/theme.slint b/crates/cp-panel/ui/theme.slint index 6bd38645..e83db50e 100644 --- a/crates/cp-panel/ui/theme.slint +++ b/crates/cp-panel/ui/theme.slint @@ -31,10 +31,7 @@ export global Theme { out property alert-back: light ? #FDE9B5 : #46351C; out property alert-ink: light ? #7A4E07 : #FCD34D; out property scrim: #000000A6; - out property shadow: light ? #0000002E : #00000099; - in-out property shadow-blur: apple ? 0px : 22px; out property radius: apple ? 0px : 8px; - out property margin: apple ? 0px : 18px; out property radius-card: 10px; out property radius-control: 8px; out property radius-inset: 6px;