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

+6
View File
@@ -155,6 +155,8 @@ pub(all) enum ShellAction {
Logout
/// The Dark mode setting changed: the compositor swaps the theme (see `dark_mode`).
ThemeChanged
/// The Flat window frames setting changed: the compositor redraws frames in the new style.
WindowStyleChanged
/// The password dialog setting changed: the compositor registers its polkit agent or leaves.
AuthAgentChanged
/// The screenshot module asked for a screenshot or recording (code: see the compositor's
@@ -294,6 +296,9 @@ pub(all) struct DesktopShell {
mut render_choice : RenderMode?
/// Dark mode (the configured theme) or light (Moon Day); saved as `:theme :light` when off.
mut dark_mode : Bool
/// How window frames look (Flat window frames on: Flatkit's; off: the classic Breeze-like
/// one); saved as `:window-style :breeze` when off. The compositor follows it.
mut window_style : @scene.WindowStyle
/// Power: minutes without input before the login session turns the screen off / suspends
/// (0: never). Saved in state.edn as :power {:screen-off 10 :suspend 0} when not the defaults.
mut screen_off_min : Int
@@ -466,6 +471,7 @@ pub fn DesktopShell::new(display : String) -> DesktopShell {
render_forced: false,
render_choice: None,
dark_mode: true,
window_style: @scene.WindowStyle::Flat,
screen_off_min: default_screen_off_min,
suspend_min: default_suspend_min,
shortcuts: Shortcuts::defaults(),
+31 -1
View File
@@ -7,6 +7,7 @@
/// :desktop-card {:x 900 :y 24} ; where the desktop card was dragged to (absent: default spot)
/// :wallpaper :aurora ; the settings module's wallpaper (absent: :plasma-glow)
/// :theme :light ; the settings module's Dark mode switch is off (absent: dark)
/// :window-style :breeze ; Flat window frames is off: the classic frame (absent: :flat)
/// :power {:screen-off 5 :suspend 30} ; minutes without input before the screen goes off /
/// ; the computer suspends, 0 never (absent: 10 and 0)
/// :shortcuts {:show-desktop "Super+Ctrl+D" :screenshot-full ""}
@@ -53,6 +54,8 @@ pub(all) struct SavedState {
native_auth_agent : Bool?
/// From `:render`: :software or :hardware chosen in Settings (absent: as detected).
render : RenderMode?
/// From `:window-style`: :flat or :breeze (absent: flat).
window_style : @scene.WindowStyle?
}
///|
@@ -66,7 +69,7 @@ let layout_names : Array[String] = ["tiling", "monocle", "floating"]
///| The keys this build owns; everything else in the file is kept as it is.
let owned_keys : Array[String] = [
"layout", "recent", "desktop-card", "windows", "wallpaper", "restore-session", "remember-windows",
"theme", "power", "shortcuts", "terminal", "auth-agent", "render",
"theme", "power", "shortcuts", "terminal", "auth-agent", "render", "window-style",
]
///| How state.edn names each wallpaper, in `@libshell.wallpaper_names` order.
@@ -116,6 +119,7 @@ pub fn DesktopShell::load_state(self : DesktopShell) -> SavedState {
terminal: None,
native_auth_agent: None,
render: None,
window_style: None,
}
}
let entries = read_state_file()
@@ -253,6 +257,22 @@ pub fn DesktopShell::load_state(self : DesktopShell) -> SavedState {
}
_ => []
},
window_style: match lookup_key(entries, "window-style") {
None => None
Some(Keyword(k)) | Some(Text(k)) =>
match @scene.WindowStyle::parse(k) {
Some(st) => Some(st)
None => {
@sys.log("chandra: state.edn: unknown :window-style :" + k +
" (use :flat or :breeze); keeping the flat frame. Pick one in Settings > Session.")
None
}
}
Some(_) => {
@sys.log("chandra: state.edn: :window-style must be :flat or :breeze; keeping the flat frame.")
None
}
},
dark_mode: match lookup_key(entries, "theme") {
Some(Keyword("light")) => Some(false)
Some(Keyword("dark")) => Some(true)
@@ -282,6 +302,13 @@ pub fn DesktopShell::apply_state(self : DesktopShell, st : SavedState) -> Unit {
Some(b) => self.dark_mode = b
None => ()
}
match st.window_style {
Some(w) if w != self.window_style => {
self.window_style = w
self.actions.push(WindowStyleChanged)
}
_ => ()
}
match st.power.0 {
Some(m) if m >= 0 => self.screen_off_min = m
_ => ()
@@ -406,6 +433,9 @@ pub fn DesktopShell::save_state(self : DesktopShell) -> Unit {
if !self.dark_mode {
entries.insert(2, (@edn.Value::Keyword("theme"), @edn.Value::Keyword("light")))
}
if self.window_style != @scene.WindowStyle::Flat {
entries.insert(2, (@edn.Value::Keyword("window-style"), @edn.Value::Keyword(self.window_style.name())))
}
if !self.remember_windows {
entries.insert(2, (@edn.Value::Keyword("remember-windows"), @edn.Value::Bool(false)))
}
+10 -2
View File
@@ -760,7 +760,7 @@ pub fn DesktopShell::set_wallpaper(self : DesktopShell, i : Int) -> Unit {
///| The session settings the session settings module lists, in index order.
let session_setting_names : Array[String] = [
"Reopen windows at login", "Remember window positions", "Dark mode", "Chandra password dialog",
render_setting_name,
render_setting_name, "Flat window frames",
]
///| The rendering switch (its label is made by `render_setting_label`).
@@ -777,7 +777,8 @@ fn DesktopShell::session_settings_bits(self : DesktopShell) -> Int {
(if self.remember_windows { 2 } else { 0 }) |
(if self.dark_mode { 4 } else { 0 }) |
(if self.native_auth_agent { 8 } else { 0 }) |
(if self.software_render() { 16 } else { 0 })
(if self.software_render() { 16 } else { 0 }) |
(if self.window_style == @scene.WindowStyle::Flat { 32 } else { 0 })
}
///| Turn session setting `i` on or off (ignored when out of range) and remember it in state.edn.
@@ -796,6 +797,13 @@ pub fn DesktopShell::set_session_setting(self : DesktopShell, i : Int, on : Bool
self.actions.push(AuthAgentChanged)
}
4 => self.choose_software_render(on)
5 => {
let style = if on { @scene.WindowStyle::Flat } else { @scene.WindowStyle::Breeze }
if self.window_style != style {
self.window_style = style
self.actions.push(WindowStyleChanged)
}
}
_ => return
}
@wasm.publish_session_settings(self.session_settings_bits())