Add support for dark mode colours to XRC

Allow specifying a different colour to use in the dark mode in XRC
colour properties.

Closes #23571.
This commit is contained in:
Vadim Zeitlin 2023-05-26 00:55:28 +01:00
parent e1f9f8f988
commit f2f2868de5
8 changed files with 69 additions and 17 deletions

View file

@ -222,7 +222,7 @@ is "." regardless of the locale.
@subsection overview_xrcformat_type_colour Colour
Colour specification can be either any string colour representation accepted
A single colour can be either any string colour representation accepted
by wxColour::Set() or any wxSYS_COLOUR_XXX symbolic name accepted by
wxSystemSettings::GetColour(). In particular, the following forms are supported:
@ -231,11 +231,21 @@ wxSystemSettings::GetColour(). In particular, the following forms are supported:
@li CSS-style "rgb(r,g,b)" and "rgba(r,g,b,a)"
@li wxSYS_COLOUR_XXX symbolic names
Moreover, a single colour definition in XRC may contain more than one colour,
separated by `|` (pipe symbol), with the first colour used by default and the
subsequent colours in specific situations. Currently the only supported
alternative colour is the colour to be used in dark mode, which must be
prefixed with "dark:".
It is recommended to provide both light and dark values when not using system
colour names (that already adapt to the dark mode), as it's rare for the same
colour to look well in both light and dark mode.
Some examples:
@code
<fg>red</fg>
<fg>#ff0000</fg>
<fg>rgb(255,0,0)</fg>
<fg>rgb(192,192,192)|dark:#404040</fg>
<fg>wxSYS_COLOUR_HIGHLIGHT</fg>
@endcode