ui::ChromeHints¶
Header: winui/ui/themes/Theme.hpp.
What a theme sets on the system-drawn window frame (Theme::chrome): corner rounding, a dark title bar, the caption, border and title text colors, and whether a system backdrop is allowed. Each window applies it with its own ChromeOverrides on top (merge_chrome()), and again on every theme change. The defaults leave the system's look alone.
Example:
ui::Theme theme = ui::Theme::light();
theme.chrome.corner_preference = ui::CornerPreference::DoNotRound;
theme.chrome.caption_color = ui::Color::from_argb(0xFF000080);
theme.chrome.caption_text_color = ui::colors::White;
theme.chrome.inactive_caption_color = ui::Color::from_argb(0xFF808080);
window.pin_theme(std::move(theme)); // the host re-applies the frame attributes
| Field | Type | Default | |
|---|---|---|---|
corner_preference |
CornerPreference |
CornerPreference::Default |
How the frame's corners are rounded. Windows 11 only. |
dark_titlebar |
bool |
false |
Whether the title bar is dark. It also tells every other part of the window that the system draws, such as the native context menu, that the theme is dark, so a menu never shows light under a dark title bar. |
caption_color |
FrameColor |
The title bar background. | |
border_color |
FrameColor |
The window border. | |
caption_text_color |
FrameColor |
The title text. | |
allows_system_backdrop |
bool |
true |
Whether the page may show a system backdrop material (Mica) instead of an opaque colors.background fill, that is, whether a window that asked for Backdrop::Mica leaves its client area transparent under this theme. Only Fluent 2 leaves this true. Mica came with Windows 11, after every earlier era, and Windows 10 Fluent has only acrylic. Every other theme and high contrast turn it off. Over Mica a page paints only where its controls paint, so text in a band the app leaves bare, such as a header or a status strip, lands on the wallpaper's tint. |
inactive_caption_color |
FrameColor |
The title bar background and text colors while the window is inactive. follow() keeps the active colors in both states. |
|
inactive_caption_text_color |
FrameColor |