| Version: 3.3.1

Public Member Functions | List of all members
wxSystemAppearance Class Reference

`#include <wx/settings.h>`

## Detailed Description

Provides information about the current system appearance.

An object of this class can be retrieved using wxSystemSettings::GetAppearance() and can then be queried for some aspects of the current system appearance, notably whether the system is using a dark theme, i.e. a theme with predominantly dark background.

This is useful for custom controls that don't use the standard system colours, as they need to adjust the colours used for drawing them to fit in the system look.

Note that this class is only used to query the current appearance, see wxApp::SetAppearance() for changing it.

Since
  3.1.3

## Public Member Functions
bool | AreAppsDark () const
| Return true if the applications on this system use dark theme by default. More...
wxString | GetName () const
| Return the name if available or empty string otherwise. More...
bool | IsDark () const
| Return true if the current system there is explicitly recognized as being a dark theme or if the default window background is dark. More...
bool | IsSystemDark () const
| Return true if the system UI uses dark theme. More...
bool | IsUsingDarkBackground () const
| Return true if the default window background is significantly darker than foreground. More...

## Member Function Documentation

## ◆ AreAppsDark()

bool wxSystemAppearance::AreAppsDark | ( |  | ) | const

Return true if the applications on this system use dark theme by default.

This function returns true if dark mode is enabled for the applications system-wide, even if it's not enabled for this particular application.

Note that for non-MSW platforms this is currently the same as IsDark(), but under MSW these two functions can return different values as dark mode requires to opt-in into it specifically.

Since
  3.3.0

## ◆ GetName()

wxString wxSystemAppearance::GetName | ( |  | ) | const

Return the name if available or empty string otherwise.

This is currently only implemented for macOS and returns a not necessarily user-readable string such as "NSAppearanceNameAqua" there and an empty string under all the other platforms.

## ◆ IsDark()

bool wxSystemAppearance::IsDark | ( |  | ) | const

Return true if the current system there is explicitly recognized as being a dark theme or if the default window background is dark.

This method should be used to check whether custom colours more appropriate for the default (light) or dark appearance should be used.

Note that this checks the appearance of the current application and not the other applications on the system, so under MSW, for example, it will return false even if dark mode is used system-wide unless the application opted in using dark mode using wxApp::MSWEnableDarkMode(). You can use IsSystemDark() or AreAppsDark() to check if the system is using dark mode by default.

## ◆ IsSystemDark()

bool wxSystemAppearance::IsSystemDark | ( |  | ) | const

Return true if the system UI uses dark theme.

This is the same as AreAppsDark() on the non-MSW platforms, but can be different from the other function under MSW as it is possible to configure default "Windows mode" and "app mode" to use different colour schemes under Windows.

Since
  3.3.0

## ◆ IsUsingDarkBackground()

bool wxSystemAppearance::IsUsingDarkBackground | ( |  | ) | const

Return true if the default window background is significantly darker than foreground.

This is used by IsDark() if there is no platform-specific way to determine whether a dark mode is being used and is generally not very useful to call directly.

See also
  wxColour::GetLuminance()