Appearance

Information about user's appearance preferences.

Header#include "nativeui/appearance.h"
Namespacenamespace nu
Typeclass

This class can not be created by user, you must create State first and then receive an instance of Appearance via Appearance::GetCurrent.

nu::State state;
nu::Appearance* appearance = nu::Appearance::GetCurrent();

Class methods

Appearance* GetCurrent()

Return current Appearance instance.

Return

Appearance*

Methods

void SetDarkModeEnabled(bool enable) Windows

Enable Windows 10 dark mode for current app.

The dark mode of Windows 10 does not support Win32 apps officially and this API makes use of private APIs to force enabling dark mode for current app.

Note that this API can only enable dark mode for window titlebars, all the views and colors are still using light color schemes. You should only use this API when developing custom-drawn apps.

Parameters

bool IsDarkScheme() const

Return whether this app is using a dark color scheme.

Note that on Windows the dark mode does not support Win32 apps, and this method will always return false unless dark mode is explicitly enabled with SetDarkModeEnabled.

Return

bool

Events

void on_color_scheme_change()

Emitted when user has changed system color scheme preferences.

Preventable

No.