Settings

gtk.settings.Settings provides a mechanism to share global settings between applications.

On the X window system, this sharing is realized by an XSettings

manager that is usually part of the desktop environment, along with utilities that let the user change these settings.

On Wayland, the settings are obtained either via a settings portal, or by reading desktop settings from DConf.

On macOS, the settings are obtained from NSUserDefaults.

In the absence of these sharing mechanisms, GTK reads default values for settings from settings.ini files in /etc/gtk-4.0, $XDG_CONFIG_DIRS/gtk-4.0 and $XDG_CONFIG_HOME/gtk-4.0. These files must be valid key files (see glib.key_file.KeyFile), and have a section called Settings. Themes can also provide default values for settings by installing a settings.ini file next to their gtk.css file.

Applications can override system-wide settings by setting the property of the gtk.settings.Settings object with gobject.object.ObjectWrap.set. This should be restricted to special cases though; gtk.settings.Settings are not meant as an application configuration facility.

There is one gtk.settings.Settings instance per display. It can be obtained with gtk.settings.Settings.getForDisplay, but in many cases, it is more convenient to use gtk.widget.Widget.getSettings.

class Settings : ObjectWrap , StyleProvider {}

Constructors

this
this(void* ptr, Flag!"Take" take)

Members

Functions

resetProperty
void resetProperty(string name)

Undoes the effect of calling gobject.object.ObjectWrap.set to install an application-specific value for a setting.

self
Settings self()

Returns this, for use in with statements.

Properties

gType
GType gType [@property getter]
gtkAlternativeButtonOrder
bool gtkAlternativeButtonOrder [@property getter]

Get gtkAlternativeButtonOrder property.

gtkAlternativeButtonOrder
bool gtkAlternativeButtonOrder [@property setter]

Set gtkAlternativeButtonOrder property.

gtkAlternativeSortArrows
bool gtkAlternativeSortArrows [@property getter]

Get gtkAlternativeSortArrows property.

gtkAlternativeSortArrows
bool gtkAlternativeSortArrows [@property setter]

Set gtkAlternativeSortArrows property.

gtkApplicationPreferDarkTheme
bool gtkApplicationPreferDarkTheme [@property getter]

Get gtkApplicationPreferDarkTheme property.

gtkApplicationPreferDarkTheme
bool gtkApplicationPreferDarkTheme [@property setter]

Set gtkApplicationPreferDarkTheme property.

gtkCursorAspectRatio
double gtkCursorAspectRatio [@property getter]

Get gtkCursorAspectRatio property.

gtkCursorAspectRatio
double gtkCursorAspectRatio [@property setter]

Set gtkCursorAspectRatio property.

gtkCursorBlink
bool gtkCursorBlink [@property getter]

Get gtkCursorBlink property.

gtkCursorBlink
bool gtkCursorBlink [@property setter]

Set gtkCursorBlink property.

gtkCursorBlinkTime
int gtkCursorBlinkTime [@property getter]

Get gtkCursorBlinkTime property.

gtkCursorBlinkTime
int gtkCursorBlinkTime [@property setter]

Set gtkCursorBlinkTime property.

gtkCursorBlinkTimeout
int gtkCursorBlinkTimeout [@property getter]

Get gtkCursorBlinkTimeout property.

gtkCursorBlinkTimeout
int gtkCursorBlinkTimeout [@property setter]

Set gtkCursorBlinkTimeout property.

gtkCursorThemeName
string gtkCursorThemeName [@property getter]

Get gtkCursorThemeName property.

gtkCursorThemeName
string gtkCursorThemeName [@property setter]

Set gtkCursorThemeName property.

gtkCursorThemeSize
int gtkCursorThemeSize [@property getter]

Get gtkCursorThemeSize property.

gtkCursorThemeSize
int gtkCursorThemeSize [@property setter]

Set gtkCursorThemeSize property.

gtkDecorationLayout
string gtkDecorationLayout [@property getter]

Get gtkDecorationLayout property.

gtkDecorationLayout
string gtkDecorationLayout [@property setter]

Set gtkDecorationLayout property.

gtkDialogsUseHeader
bool gtkDialogsUseHeader [@property getter]

Get gtkDialogsUseHeader property.

gtkDialogsUseHeader
bool gtkDialogsUseHeader [@property setter]

Set gtkDialogsUseHeader property.

gtkDndDragThreshold
int gtkDndDragThreshold [@property getter]

Get gtkDndDragThreshold property.

gtkDndDragThreshold
int gtkDndDragThreshold [@property setter]

Set gtkDndDragThreshold property.

gtkDoubleClickDistance
int gtkDoubleClickDistance [@property getter]

Get gtkDoubleClickDistance property.

gtkDoubleClickDistance
int gtkDoubleClickDistance [@property setter]

Set gtkDoubleClickDistance property.

gtkDoubleClickTime
int gtkDoubleClickTime [@property getter]

Get gtkDoubleClickTime property.

gtkDoubleClickTime
int gtkDoubleClickTime [@property setter]

Set gtkDoubleClickTime property.

gtkEnableAccels
bool gtkEnableAccels [@property getter]

Get gtkEnableAccels property.

gtkEnableAccels
bool gtkEnableAccels [@property setter]

Set gtkEnableAccels property.

gtkEnableAnimations
bool gtkEnableAnimations [@property getter]

Get gtkEnableAnimations property.

gtkEnableAnimations
bool gtkEnableAnimations [@property setter]

Set gtkEnableAnimations property.

gtkEnableEventSounds
bool gtkEnableEventSounds [@property getter]

Get gtkEnableEventSounds property.

gtkEnableEventSounds
bool gtkEnableEventSounds [@property setter]

Set gtkEnableEventSounds property.

gtkEnableInputFeedbackSounds
bool gtkEnableInputFeedbackSounds [@property getter]

Get gtkEnableInputFeedbackSounds property.

gtkEnableInputFeedbackSounds
bool gtkEnableInputFeedbackSounds [@property setter]

Set gtkEnableInputFeedbackSounds property.

gtkEnablePrimaryPaste
bool gtkEnablePrimaryPaste [@property getter]

Get gtkEnablePrimaryPaste property.

gtkEnablePrimaryPaste
bool gtkEnablePrimaryPaste [@property setter]

Set gtkEnablePrimaryPaste property.

gtkEntryPasswordHintTimeout
uint gtkEntryPasswordHintTimeout [@property getter]

Get gtkEntryPasswordHintTimeout property.

gtkEntryPasswordHintTimeout
uint gtkEntryPasswordHintTimeout [@property setter]

Set gtkEntryPasswordHintTimeout property.

gtkEntrySelectOnFocus
bool gtkEntrySelectOnFocus [@property getter]

Get gtkEntrySelectOnFocus property.

gtkEntrySelectOnFocus
bool gtkEntrySelectOnFocus [@property setter]

Set gtkEntrySelectOnFocus property.

gtkErrorBell
bool gtkErrorBell [@property getter]

Get gtkErrorBell property.

gtkErrorBell
bool gtkErrorBell [@property setter]

Set gtkErrorBell property.

gtkFontName
string gtkFontName [@property getter]

Get gtkFontName property.

gtkFontName
string gtkFontName [@property setter]

Set gtkFontName property.

gtkFontconfigTimestamp
uint gtkFontconfigTimestamp [@property getter]

Get gtkFontconfigTimestamp property.

gtkFontconfigTimestamp
uint gtkFontconfigTimestamp [@property setter]

Set gtkFontconfigTimestamp property.

gtkHintFontMetrics
bool gtkHintFontMetrics [@property getter]

Get gtkHintFontMetrics property.

gtkHintFontMetrics
bool gtkHintFontMetrics [@property setter]

Set gtkHintFontMetrics property.

gtkIconThemeName
string gtkIconThemeName [@property getter]

Get gtkIconThemeName property.

gtkIconThemeName
string gtkIconThemeName [@property setter]

Set gtkIconThemeName property.

gtkImModule
string gtkImModule [@property getter]

Get gtkImModule property.

gtkImModule
string gtkImModule [@property setter]

Set gtkImModule property.

gtkKeynavUseCaret
bool gtkKeynavUseCaret [@property getter]

Get gtkKeynavUseCaret property.

gtkKeynavUseCaret
bool gtkKeynavUseCaret [@property setter]

Set gtkKeynavUseCaret property.

gtkLabelSelectOnFocus
bool gtkLabelSelectOnFocus [@property getter]

Get gtkLabelSelectOnFocus property.

gtkLabelSelectOnFocus
bool gtkLabelSelectOnFocus [@property setter]

Set gtkLabelSelectOnFocus property.

gtkLongPressTime
uint gtkLongPressTime [@property getter]

Get gtkLongPressTime property.

gtkLongPressTime
uint gtkLongPressTime [@property setter]

Set gtkLongPressTime property.

gtkOverlayScrolling
bool gtkOverlayScrolling [@property getter]

Get gtkOverlayScrolling property.

gtkOverlayScrolling
bool gtkOverlayScrolling [@property setter]

Set gtkOverlayScrolling property.

gtkPrimaryButtonWarpsSlider
bool gtkPrimaryButtonWarpsSlider [@property getter]

Get gtkPrimaryButtonWarpsSlider property.

gtkPrimaryButtonWarpsSlider
bool gtkPrimaryButtonWarpsSlider [@property setter]

Set gtkPrimaryButtonWarpsSlider property.

gtkPrintBackends
string gtkPrintBackends [@property getter]

Get gtkPrintBackends property.

gtkPrintBackends
string gtkPrintBackends [@property setter]

Set gtkPrintBackends property.

gtkPrintPreviewCommand
string gtkPrintPreviewCommand [@property getter]

Get gtkPrintPreviewCommand property.

gtkPrintPreviewCommand
string gtkPrintPreviewCommand [@property setter]

Set gtkPrintPreviewCommand property.

gtkRecentFilesEnabled
bool gtkRecentFilesEnabled [@property getter]

Get gtkRecentFilesEnabled property.

gtkRecentFilesEnabled
bool gtkRecentFilesEnabled [@property setter]

Set gtkRecentFilesEnabled property.

gtkRecentFilesMaxAge
int gtkRecentFilesMaxAge [@property getter]

Get gtkRecentFilesMaxAge property.

gtkRecentFilesMaxAge
int gtkRecentFilesMaxAge [@property setter]

Set gtkRecentFilesMaxAge property.

gtkShellShowsAppMenu
bool gtkShellShowsAppMenu [@property getter]

Get gtkShellShowsAppMenu property.

gtkShellShowsAppMenu
bool gtkShellShowsAppMenu [@property setter]

Set gtkShellShowsAppMenu property.

gtkShellShowsDesktop
bool gtkShellShowsDesktop [@property getter]

Get gtkShellShowsDesktop property.

gtkShellShowsDesktop
bool gtkShellShowsDesktop [@property setter]

Set gtkShellShowsDesktop property.

gtkShellShowsMenubar
bool gtkShellShowsMenubar [@property getter]

Get gtkShellShowsMenubar property.

gtkShellShowsMenubar
bool gtkShellShowsMenubar [@property setter]

Set gtkShellShowsMenubar property.

gtkShowStatusShapes
bool gtkShowStatusShapes [@property getter]

Get gtkShowStatusShapes property.

gtkShowStatusShapes
bool gtkShowStatusShapes [@property setter]

Set gtkShowStatusShapes property.

gtkSoundThemeName
string gtkSoundThemeName [@property getter]

Get gtkSoundThemeName property.

gtkSoundThemeName
string gtkSoundThemeName [@property setter]

Set gtkSoundThemeName property.

gtkSplitCursor
bool gtkSplitCursor [@property getter]

Get gtkSplitCursor property.

gtkSplitCursor
bool gtkSplitCursor [@property setter]

Set gtkSplitCursor property.

gtkThemeName
string gtkThemeName [@property getter]

Get gtkThemeName property.

gtkThemeName
string gtkThemeName [@property setter]

Set gtkThemeName property.

gtkTitlebarDoubleClick
string gtkTitlebarDoubleClick [@property getter]

Get gtkTitlebarDoubleClick property.

gtkTitlebarDoubleClick
string gtkTitlebarDoubleClick [@property setter]

Set gtkTitlebarDoubleClick property.

gtkTitlebarMiddleClick
string gtkTitlebarMiddleClick [@property getter]

Get gtkTitlebarMiddleClick property.

gtkTitlebarMiddleClick
string gtkTitlebarMiddleClick [@property setter]

Set gtkTitlebarMiddleClick property.

gtkTitlebarRightClick
string gtkTitlebarRightClick [@property getter]

Get gtkTitlebarRightClick property.

gtkTitlebarRightClick
string gtkTitlebarRightClick [@property setter]

Set gtkTitlebarRightClick property.

gtkXftAntialias
int gtkXftAntialias [@property getter]

Get gtkXftAntialias property.

gtkXftAntialias
int gtkXftAntialias [@property setter]

Set gtkXftAntialias property.

gtkXftDpi
int gtkXftDpi [@property getter]

Get gtkXftDpi property.

gtkXftDpi
int gtkXftDpi [@property setter]

Set gtkXftDpi property.

gtkXftHinting
int gtkXftHinting [@property getter]

Get gtkXftHinting property.

gtkXftHinting
int gtkXftHinting [@property setter]

Set gtkXftHinting property.

gtkXftHintstyle
string gtkXftHintstyle [@property getter]

Get gtkXftHintstyle property.

gtkXftHintstyle
string gtkXftHintstyle [@property setter]

Set gtkXftHintstyle property.

gtkXftRgba
string gtkXftRgba [@property getter]

Get gtkXftRgba property.

gtkXftRgba
string gtkXftRgba [@property setter]

Set gtkXftRgba property.

Static functions

getDefault
gtk.settings.Settings getDefault()

Gets the gtk.settings.Settings object for the default display, creating it if necessary.

getForDisplay
gtk.settings.Settings getForDisplay(gdk.display.Display display)

Gets the gtk.settings.Settings object for display, creating it if necessary.

getGType
GType getGType()

Mixed In Members

From mixin StyleProviderT!()

connectGtkPrivateChanged
ulong connectGtkPrivateChanged(T callback, Flag!"After" after)

Connect to GtkPrivateChanged signal.

Inherited Members

From ObjectWrap

setGObject
void setGObject(void* cObj, Flag!"Take" take)

Set the GObject of a D ObjectWrap wrapper.

cPtr
void* cPtr(Flag!"Dup" dup)

Get a pointer to the underlying C object.

ref_
void* ref_(void* gObj)

Calls g_object_ref() on a GObject.

unref
unref(void* gObj)

Calls g_object_unref() on a GObject.

getType
GType getType()

Get the GType of an object.

gType
GType gType [@property getter]

GObject GType property.

self
ObjectWrap self()

Convenience method to return this cast to a type. For use in D with statements.

getDObject
T getDObject(void* cptr, Flag!"Take" take)

Template to get the D object from a C GObject and cast it to the given D object type.

connectSignalClosure
ulong connectSignalClosure(string signalDetail, DClosure closure, Flag!"After" after)

Connect a D closure to an object signal.

setProperty
void setProperty(string propertyName, T val)

Template for setting a GObject property.

getProperty
T getProperty(string propertyName)

Template for getting a GObject property.

compatControl
size_t compatControl(size_t what, void* data)
bindProperty
gobject.binding.Binding bindProperty(string sourceProperty, gobject.object.ObjectWrap target, string targetProperty, gobject.types.BindingFlags flags)

Creates a binding between source_property on source and target_property on target.

bindPropertyFull
gobject.binding.Binding bindPropertyFull(string sourceProperty, gobject.object.ObjectWrap target, string targetProperty, gobject.types.BindingFlags flags, gobject.closure.Closure transformTo, gobject.closure.Closure transformFrom)

Creates a binding between source_property on source and target_property on target, allowing you to set the transformation functions to be used by the binding.

forceFloating
void forceFloating()

This function is intended for #GObject implementations to re-enforce a floating[floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling gobject.object.ObjectWrap.refSink.

freezeNotify
void freezeNotify()

Increases the freeze count on object. If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen.

getData
void* getData(string key)

Gets a named field from the objects table of associations (see gobject.object.ObjectWrap.setData).

getProperty
void getProperty(string propertyName, gobject.value.Value value)

Gets a property of an object.

getQdata
void* getQdata(glib.types.Quark quark)

This function gets back user data pointers stored via gobject.object.ObjectWrap.setQdata.

getv
void getv(string[] names, gobject.value.Value[] values)

Gets n_properties properties for an object. Obtained properties will be set to values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.

isFloating
bool isFloating()

Checks whether object has a floating[floating-ref] reference.

notify
void notify(string propertyName)

Emits a "notify" signal for the property property_name on object.

notifyByPspec
void notifyByPspec(gobject.param_spec.ParamSpec pspec)

Emits a "notify" signal for the property specified by pspec on object.

refSink
gobject.object.ObjectWrap refSink()

Increase the reference count of object, and possibly remove the floating[floating-ref] reference, if object has a floating reference.

runDispose
void runDispose()

Releases all references to other objects. This can be used to break reference cycles.

setData
void setData(string key, void* data)

Each object carries around a table of associations from strings to pointers. This function lets you set an association.

setProperty
void setProperty(string propertyName, gobject.value.Value value)

Sets a property on an object.

stealData
void* stealData(string key)

Remove a specified datum from the object's data associations, without invoking the association's destroy handler.

stealQdata
void* stealQdata(glib.types.Quark quark)

This function gets back user data pointers stored via gobject.object.ObjectWrap.setQdata and removes the data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example:

thawNotify
void thawNotify()

Reverts the effect of a previous call to gobject.object.ObjectWrap.freezeNotify. The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.

watchClosure
void watchClosure(gobject.closure.Closure closure)

This function essentially limits the life time of the closure to the life time of the object. That is, when the object is finalized, the closure is invalidated by calling gobject.closure.Closure.invalidate on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, gobject.object.ObjectWrap.ref_ and gobject.object.ObjectWrap.unref are added as marshal guards to the closure, to ensure that an extra reference count is held on object during invocation of the closure. Usually, this function will be called on closures that use this object as closure data.

connectNotify
ulong connectNotify(string detail, T callback, Flag!"After" after)

Connect to Notify signal.

From StyleProvider

getGType
GType getGType()
connectGtkPrivateChanged
ulong connectGtkPrivateChanged(T callback, Flag!"After" after)

Connect to GtkPrivateChanged signal.