Appearance
Information about user's appearance preferences.
Module | require("yue.gui") |
Type | table |
This class can not be created by user, you can only receive its global
instance from the appearance
property of the module:
gui.appearance:isdarkscheme()
Methods
Windows
setdarkmodeenabled(enable)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
boolean
enable
isdarkscheme()
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
boolean
Events
oncolorschemechange()
Emitted when user has changed system color scheme preferences.