Class: Handy::StyleManager
- Inherits:
-
Object
- Object
- Handy::StyleManager
- Defined in:
- (unknown)
Class Method Summary collapse
-
.default ⇒ Handy::StyleManager
Gets the default [classStyleManager] instance.
-
.get_for_display(display) ⇒ Handy::StyleManager
Gets the [classStyleManager] instance managing display.
Instance Method Summary collapse
-
#color_scheme ⇒ Handy::ColorScheme
The requested application color scheme.
-
#color_scheme=(color_scheme) ⇒ Handy::ColorScheme
The requested application color scheme.
-
#dark ⇒ Boolean
Gets whether the application is using dark appearance.
-
#dark=(dark) ⇒ Boolean
Whether the application is using dark appearance.
-
#dark? ⇒ Boolean
Whether the application is using dark appearance.
-
#display ⇒ Gdk::Display
The display the style manager is associated with.
-
#display=(display) ⇒ Gdk::Display
The display the style manager is associated with.
-
#high_contrast ⇒ Boolean
Gets whether the application is using high contrast appearance.
-
#high_contrast=(high_contrast) ⇒ Boolean
Whether the application is using high contrast appearance.
-
#high_contrast? ⇒ Boolean
Whether the application is using high contrast appearance.
-
#system_supports_color_schemes ⇒ Boolean
Gets whether the system supports color schemes.
-
#system_supports_color_schemes=(system_supports_color_schemes) ⇒ Boolean
Whether the system supports color schemes.
-
#system_supports_color_schemes? ⇒ Boolean
Whether the system supports color schemes.
Class Method Details
.default ⇒ Handy::StyleManager
Gets the default [classStyleManager] instance.
It manages all [classGdk.Display] instances unless the style manager for that display has an override.
See [funcStyleManager.get_for_display].
.get_for_display(display) ⇒ Handy::StyleManager
Gets the [classStyleManager] instance managing display.
It can be used to override styles for that specific display instead of the whole application.
Most applications should use [funcStyleManager.get_default] instead.
Instance Method Details
#color_scheme ⇒ Handy::ColorScheme
The requested application color scheme.
The effective appearance will be decided based on the application color scheme and the system preferred color scheme. The [propertyStyleManager:dark] property can be used to query the current effective appearance.
The HDY_COLOR_SCHEME_PREFER_LIGHT color scheme results in the application
using light appearance unless the system prefers dark colors. This is the
default value.
The HDY_COLOR_SCHEME_PREFER_DARK color scheme results in the application
using dark appearance, but can still switch to the light appearance if the
system can prefers it, for example, when the high contrast preference is
enabled.
The HDY_COLOR_SCHEME_FORCE_LIGHT and HDY_COLOR_SCHEME_FORCE_DARK values
ignore the system preference entirely, they are useful if the application
wants to match its UI to its content or to provide a separate color scheme
switcher.
If a per-[classGdk.Display] style manager has its color scheme set to
HDY_COLOR_SCHEME_DEFAULT, it will inherit the color scheme from the
default style manager.
For the default style manager, HDY_COLOR_SCHEME_DEFAULT is equivalent to
HDY_COLOR_SCHEME_FORCE_LIGHT.
The [propertyStyleManager:system-supports-color-schemes] property can be used to check if the current environment provides a color scheme preference.
#color_scheme=(color_scheme) ⇒ Handy::ColorScheme
The requested application color scheme.
The effective appearance will be decided based on the application color scheme and the system preferred color scheme. The [propertyStyleManager:dark] property can be used to query the current effective appearance.
The HDY_COLOR_SCHEME_PREFER_LIGHT color scheme results in the application
using light appearance unless the system prefers dark colors. This is the
default value.
The HDY_COLOR_SCHEME_PREFER_DARK color scheme results in the application
using dark appearance, but can still switch to the light appearance if the
system can prefers it, for example, when the high contrast preference is
enabled.
The HDY_COLOR_SCHEME_FORCE_LIGHT and HDY_COLOR_SCHEME_FORCE_DARK values
ignore the system preference entirely, they are useful if the application
wants to match its UI to its content or to provide a separate color scheme
switcher.
If a per-[classGdk.Display] style manager has its color scheme set to
HDY_COLOR_SCHEME_DEFAULT, it will inherit the color scheme from the
default style manager.
For the default style manager, HDY_COLOR_SCHEME_DEFAULT is equivalent to
HDY_COLOR_SCHEME_FORCE_LIGHT.
The [propertyStyleManager:system-supports-color-schemes] property can be used to check if the current environment provides a color scheme preference.
#dark ⇒ Boolean
Gets whether the application is using dark appearance.
#dark=(dark) ⇒ Boolean
Whether the application is using dark appearance.
This property can be used to query the current appearance, as requested via [propertyStyleManager:color-scheme].
#dark? ⇒ Boolean
Whether the application is using dark appearance.
This property can be used to query the current appearance, as requested via [propertyStyleManager:color-scheme].
#display ⇒ Gdk::Display
The display the style manager is associated with.
The display will be NULL for the style manager returned by
[funcStyleManager.get_default].
#display=(display) ⇒ Gdk::Display
The display the style manager is associated with.
The display will be NULL for the style manager returned by
[funcStyleManager.get_default].
#high_contrast ⇒ Boolean
Gets whether the application is using high contrast appearance.
#high_contrast=(high_contrast) ⇒ Boolean
Whether the application is using high contrast appearance.
This cannot be overridden by applications.
#high_contrast? ⇒ Boolean
Whether the application is using high contrast appearance.
This cannot be overridden by applications.
#system_supports_color_schemes ⇒ Boolean
Gets whether the system supports color schemes.
#system_supports_color_schemes=(system_supports_color_schemes) ⇒ Boolean
Whether the system supports color schemes.
This property can be used to check if the current environment provides a
color scheme preference. For example, applications might want to show a
separate appearance switcher if it's set to FALSE.
It's only set at startup and cannot change its value later.
See [propertyStyleManager:color-scheme].
#system_supports_color_schemes? ⇒ Boolean
Whether the system supports color schemes.
This property can be used to check if the current environment provides a
color scheme preference. For example, applications might want to show a
separate appearance switcher if it's set to FALSE.
It's only set at startup and cannot change its value later.
See [propertyStyleManager:color-scheme].