Skip to content

ui::FrameColor

Header: winui/ui/themes/Theme.hpp.

A color for a part of the system-drawn window frame. It holds one of four answers, where std::optional<Color> could hold only two:

follow() - no opinion, the default. In ChromeHints it leaves the system's color. In ChromeOverrides it uses the theme's. system_default() - the system's own color, even over a theme that sets one. none() - draw nothing. Windows 11 and the border only. A caption color of none() is treated as system_default(). a Color - that color. The conversion is implicit, so chrome.caption_color = palette.selection works.

Example:

ui::ChromeOverrides chrome;
chrome.caption_color      = ui::Color::from_argb(0xFF1E1E1E); // a custom color
chrome.caption_text_color = ui::FrameColor::system_default(); // the OS's, over the theme's
chrome.border_color       = ui::FrameColor::none();           // no border line (Windows 11)
window.set_chrome(chrome);

FrameColor

constexpr FrameColor() = default

follow(): no opinion.

FrameColor

constexpr FrameColor(Color color)

A custom color; implicit so a plain Color can be assigned.

kind

FrameColorKind kind() const

Which answer this holds.

has_value

bool has_value() const

True only for a custom color, the one case where * means anything.

operator*

const Color& operator*() const

The custom color; meaningful only when has_value().

reset

void reset()

Back to follow().

follow

static FrameColor follow()

No opinion: ChromeHints leaves the OS default, ChromeOverrides uses the theme's.

system_default

static FrameColor system_default()

Forces the OS's own color, even over a theme that sets one.

none

static FrameColor none()

Draws nothing. Windows 11 and the border only; a caption of none() acts as system_default().