Package ch.bailu.gtk.adw
Klasse StyleManager
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.adw.StyleManager
- Alle implementierten Schnittstellen:
PointerInterface
A class for managing application-wide styling.
`AdwStyleManager` provides a way to query and influence the application
styles, such as whether to use dark style, the system accent color or high
contrast appearance.
It allows to set the color scheme via the
[property@StyleManager:color-scheme] property, and to query the current
appearance, as well as whether a system-wide color scheme and accent color
preferences exists.
`AdwStyleManager` provides a way to query and influence the application
styles, such as whether to use dark style, the system accent color or high
contrast appearance.
It allows to set the color scheme via the
[property@StyleManager:color-scheme] property, and to query the current
appearance, as well as whether a system-wide color scheme and accent color
preferences exists.
https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.StyleManager.html
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungint
Gets the current system accent color.Gets the current system accent color as a `GdkRGBA`.static ClassHandler
int
Gets the requested application color scheme.boolean
getDark()
Gets whether the application is using dark appearance.static StyleManager
Gets the default `AdwStyleManager` instance.Gets the display the style manager is associated with.Gets the system document font.static StyleManager
getForDisplay
(Display display) Gets the `AdwStyleManager` instance managing @display.boolean
Gets whether the application is using high contrast appearance.static int
Gets the system monospace font.static long
static TypeSystem.TypeSize
boolean
Gets whether the system supports accent colors.boolean
Gets whether the system supports color schemes.static long
static TypeSystem.TypeSize
void
setColorScheme
(int color_scheme) Sets the requested application color scheme.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
StyleManager
-
-
Methodendetails
-
getClassHandler
-
getAccentColor
public int getAccentColor()Gets the current system accent color.
See also [property@StyleManager:accent-color-rgba].- Gibt zurück:
- the current system accent color
-
getAccentColorRgba
Gets the current system accent color as a `GdkRGBA`.
Equivalent to calling [func@AccentColor.to_rgba] on the value of
[property@StyleManager:accent-color].
This is a background color. The matching foreground color is white.- Gibt zurück:
- the current system accent color
-
getColorScheme
public int getColorScheme()Gets the requested application color scheme.- Gibt zurück:
- the color scheme
-
getDark
public boolean getDark()Gets whether the application is using dark appearance.
This can be used to query the current appearance, as requested via
[property@StyleManager:color-scheme].- Gibt zurück:
- whether the application is using dark appearance
-
getDisplay
Gets the display the style manager is associated with.
The display will be `NULL` for the style manager returned by
[func@StyleManager.get_default].- Gibt zurück:
- the display
-
getDocumentFontName
Gets the system document font.
The font is in the same format as [property@Gtk.Settings:gtk-font-name],
e.g. "Adwaita Sans 11".
Use [func@Pango.FontDescription.to_string] to parse it.- Gibt zurück:
- the system document font
-
getHighContrast
public boolean getHighContrast()Gets whether the application is using high contrast appearance.
This cannot be overridden by applications.- Gibt zurück:
- whether the application is using high contrast appearance
-
getMonospaceFontName
Gets the system monospace font.
The font is in the same format as [property@Gtk.Settings:gtk-font-name],
e.g. "Adwaita Mono 11".
Use [func@Pango.FontDescription.to_string] to parse it.- Gibt zurück:
- the system monospace font
-
getSystemSupportsAccentColors
public boolean getSystemSupportsAccentColors()Gets whether the system supports accent colors.
This can be used to check if the current environment provides an accent color
preference. For example, applications might want to show a preference for
choosing accent color if it's set to `FALSE`.
See [property@StyleManager:accent-color].- Gibt zurück:
- whether the system supports accent colors
-
getSystemSupportsColorSchemes
public boolean getSystemSupportsColorSchemes()Gets whether the system supports color schemes.
This 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`.- Gibt zurück:
- whether the system supports color schemes
-
setColorScheme
public void setColorScheme(int color_scheme) Sets the requested application color scheme.
The effective appearance will be decided based on the application color
scheme and the system preferred color scheme. The
[property@StyleManager:dark] property can be used to query the current
effective appearance.
The `ADW_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 `ADW_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 `ADW_COLOR_SCHEME_FORCE_LIGHT` and `ADW_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-[class@Gdk.Display] style manager has its color scheme set to
`ADW_COLOR_SCHEME_DEFAULT`, it will inherit the color scheme from the
default style manager.
For the default style manager, `ADW_COLOR_SCHEME_DEFAULT` is equivalent to
`ADW_COLOR_SCHEME_PREFER_LIGHT`.
The [property@StyleManager:system-supports-color-schemes] property can be
used to check if the current environment provides a color scheme
preference.- Parameter:
color_scheme
- the color scheme
-
getDefault
Gets the default `AdwStyleManager` instance.
It manages all [class@Gdk.Display] instances unless the style manager for
that display has an override.
See [func@StyleManager.get_for_display].- Gibt zurück:
- the default style manager
-
getForDisplay
Gets the `AdwStyleManager` instance managing @display.
It can be used to override styles for that specific display instead of the
whole application.
Most applications should use [func@StyleManager.get_default] instead.- Parameter:
display
- a `GdkDisplay`- Gibt zurück:
- the style manager for @display
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-