Window frames in the style of V's Flatkit Aurorae theme, the classic frame as a setting
CI / test (push) Canceled after 52s

The default frame now follows codegod100/kde aurorae (Flatkit / Flatkit Dark): the kit's
neutral title bar, a 1px outline with 10px top corners, a hairline under the title, a soft
16px shadow all round, a centred title and 24px flat buttons with hover and pressed fills
(close turns red). 38px title bar, 1px border. Maximized: no shadow, square corners.

- scene: WindowStyle (frame sizes, button layout, hit test) and build_window_decoration;
  the shadow is part of the decoration ops, so the three rasterisers lost their own offset
  shadow and redraw 18px around a changed window.
- host: the frame size follows the style (work area, wm title-bar room, CSD client boxes,
  hit zones, screenshots); title-bar buttons track hover, show pressed, act on release.
- Settings > Session > Flat window frames (off: the old Breeze-like frame), saved as
  :window-style :breeze; an unknown value is logged.
- docs/window-frames.md; tests for both styles' pixels, button states and switching.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hmKDDLLES2aBrrnPxT
This commit is contained in:
Claude committed 2026-11-26 04:09:38 +00:00
1 parent 2c2ce3f913
commit 14acc5d42e
20 files changed
+1005 -142

No files matched your search

+14 -10
View File
@@ -37,6 +37,16 @@ fn new_comp(tag : String) -> @host.ChandraCompositor {
comp
}
///| Centre of title-bar button `n` (1 minimize, 2 maximize, 3 close) of window `wid`, in the
/// default (flat) window style.
fn button_centre(comp : @host.ChandraCompositor, wid : UInt64, n : Int) -> (Int, Int) {
let style = @scene.WindowStyle::Flat
let g = comp.windows.get(wid).unwrap().geometry
let (ox, oy) = (g.x - style.frame_side(), g.y - style.frame_top())
let r = style.buttons(g.w + 2 * style.frame_side())[n - 1].1
(ox + r.x + r.w / 2, oy + r.y + r.h / 2)
}
///| Drain everything the compositor sent this client as (object, opcode) pairs.
fn drain_msgs(c : TestWaylandClient) -> Array[(UInt, UInt)] {
let scratch : FixedArray[Byte] = FixedArray::make(65536, b'\x00')
@@ -223,14 +233,8 @@ test "title-bar buttons minimize, maximize and close windows" {
let (c, _shm, _surf, _xdg, tl, _deco) = open_and_configure_client(comp, socket_path, "A", "a")
let _b = open_and_configure_client(comp, socket_path, "B", "b")
ignore(comp.compose_frame())
// Button centres, from the decoration layout (18px buttons, 10px from the right edge).
let btn = fn(wid : UInt64, n : Int) {
let g = comp.windows.get(wid).unwrap().geometry
let outer_w = g.w + 4
let x = g.x - 2 + outer_w - 10 - 9 - (3 - n) * 26
let y = g.y - 32 + 16
(x, y)
}
// Button centres, from the flat frame's layout (24px buttons, 8px from the right edge).
let btn = fn(wid : UInt64, n : Int) { button_centre(comp, wid, n) }
let click = fn(p : (Int, Int), t : UInt) {
click_at(comp, p.0, p.1, t)
}
@@ -1694,8 +1698,8 @@ test "open_settings opens the settings module on the tab asked for" {
assert_eq(pr.h, 40 + (1 + 5 + 6) * 28 + 6)
assert_true(comp.shell.open_settings(Session))
ignore(comp.compose_frame())
// The five settings, then Face unlock (a heading; chandra-face isn't installed in tests).
assert_eq(comp.shell.slot_popup_rect(slot).h, 40 + 7 * 28 + 6)
// The six settings, then Face unlock (a heading; chandra-face isn't installed in tests).
assert_eq(comp.shell.slot_popup_rect(slot).h, 40 + 8 * 28 + 6)
assert_true(
comp.shell.slot_popup_texts(slot).iter().any(t => t.0.has_prefix("Lighter animations (")),
)