Theme · Platform: caption buttons of their own height, titles that give way

Windows caption buttons take the bar's height less its hairline, a new
token, instead of their row's, so they keep their height beside caps
that wrap below them. A title bar's title is an Ellipsis: on Windows it
takes the free width before the buttons and gives way; a centered title
sits inset past the lights on both sides. The controls never shrink.
Tests hold a long Windows title's close button inside a 280px bar and
wrapped caps inside their row.
This commit is contained in:
ZacharyZhang-NY committed 2026-09-27 18:04:05 -04:00
1 parent d3cfc71ead
commit ff1e97132e
5 files changed
+80 -8

No files matched your search

+5
View File
@@ -230,6 +230,11 @@ impl Theme {
px_to_rems(46.0)
}
/// A Windows caption button's height: the title bar's, less its bottom hairline.
pub fn caption_button_height(&self) -> Pixels {
self.titlebar_height().to_pixels(self.base_rem()) - px(1.0)
}
/// Resize margin of a client-drawn window.
pub fn window_inset(&self) -> Rems {
px_to_rems(10.0)