Tells LispWorks whether to display in dark mode (GTK+ only).
capi
force-dark-mode value &key screen
value⇩ | :yes , :no or nil . |
screen⇩ |
A screen, or any argument accepted by convert-to-screen. |
The function force-dark-mode
can be used to tell LispWorks on GTK+ to display as if in dark or not in dark mode.
By default, LispWorks tries to detect whether to use dark mode or not. force-dark-mode
is intended to be used in setups when LispWorks does not detect the mode correctly, to force using or not using dark mode.
If value is nil
, force-dark-mode
sets the state back to the default. If value is :yes
, force-dark-mode
forces dark mode, and if :no
forces light mode.
If screen is not supplied, force-dark-mode
sets the default initial state of any CAPI screen that is created after the call. This state is persistent, including over saving an image by save-image or delivering by deliver. A call without screen does not require any previous initialization, so can be used in initialization files and in scripts used for building applications.
When screen is supplied, it must be a screen, or any argument accepted by convert-to-screen. force-dark-mode
sets the state for the result of convert-to-screen.
force-dark-mode
has an effect only on GTK+. It can work successfully only if the user's desktop is set up correctly to switch between modes.
In general, force-dark-mode
is intended to be used to match the actual mode of the desktop that LispWorks displays on. For force-dark-mode
to work without matching the desktop, you will need to set the colors of the panes in your application.
By default, most of the colors in CAPI are chosen from the underlying GTK+ interface:
force-dark-mode
does not affect these colors at all. It only affects colors that are mode-dependent inside LispWorks, for example colors created by create-light-dark-switchable-color, and colors from the settings of editor panes in the IDE via Preferences... > Environment > Styles."gtk-application-prefer-dark-mode"
to True or False as appropriate. This should affect the colors supplied to CAPI from the underlying GTK+ interface, so makes it work with a desktop that is set up properly.
On GTK+ 3, LispWorks uses the color-scheme from the gsettings object with schema_id
"org.gnome.desktop.interface"
to check for the mode, which gives the setting on the machine that LispWorks runs on. A typical use case of force-dark-mode
is when LispWorks is displaying on another machine that has a different color-scheme.
After using force-dark-mode
on a screen, newly created windows should be colored according to value. Windows that already exist may or may not switch correctly.
create-light-dark-switchable-color
top-level-interface-dark-mode-p
CAPI User Guide and Reference Manual (Unix version) - 18 Feb 2025 15:34:22