Gtk.Settings
Description: Reference for Gtk.Settings

### Class

# GtkSettings

#### Description [src]

    final class Gtk.Settings : GObject.Object
      implements Gtk.StyleProvider {
      /* No available fields */
    }

Provides a mechanism to share global settings between applications.

GTK relies on the platform-specific API for getting desktop-wide settings.

On Wayland, the settings are obtained via a settings portal that is part of the Linux desktop APIs for application.

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

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 `GKeyFile`), 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 `GtkSettings` object with g_object_set(). This should be restricted to special cases though; `GtkSettings` are not meant as an application configuration facility.

There is one `GtkSettings` instance per display. It can be obtained with `gtk_settings_get_for_display()`, but in many cases, it is more convenient to use `gtk_widget_get_settings()`.

#### Hierarchy

#### Ancestors

- GObject

#### Implements

- GtkStyleProvider

#### Functions

###### gtk_settings_get_default

Gets the `GtkSettings` object for the default display, creating it if necessary.

###### gtk_settings_get_for_display

Gets the `GtkSettings` object for `display`, creating it if necessary.

#### Instance methods

###### gtk_settings_reset_property

Undoes the effect of calling `g_object_set()` to install an application-specific value for a setting.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Gtk.Settings:gtk-accent-color

The desktop accent color (if available).

unstable since: 4.24

###### Gtk.Settings:gtk-alternative-button-order

Whether buttons in dialogs should use the alternative button order.

###### Gtk.Settings:gtk-alternative-sort-arrows

Controls the direction of the sort indicators in sorted list and tree views.

###### Gtk.Settings:gtk-application-prefer-dark-theme

Whether the application prefers to use a dark theme.

deprecated: 4.20

###### Gtk.Settings:gtk-cursor-aspect-ratio

The aspect ratio of the text caret.

###### Gtk.Settings:gtk-cursor-blink

Whether the cursor should blink.

###### Gtk.Settings:gtk-cursor-blink-time

Length of the cursor blink cycle, in milliseconds.

###### Gtk.Settings:gtk-cursor-blink-timeout

Time after which the cursor stops blinking, in seconds.

###### Gtk.Settings:gtk-cursor-theme-name

Name of the cursor theme to use.

###### Gtk.Settings:gtk-cursor-theme-size

The size to use for cursors.

###### Gtk.Settings:gtk-decoration-layout

Determines which buttons should be put in the titlebar of client-side decorated windows, and whether they should be placed on the left or right.

###### Gtk.Settings:gtk-dialogs-use-header

Whether builtin GTK dialogs such as the file chooser, the color chooser or the font chooser will use a header bar at the top to show action widgets, or an action area at the bottom.

###### Gtk.Settings:gtk-dnd-drag-threshold

The number of pixels the cursor can move before dragging.

###### Gtk.Settings:gtk-double-click-distance

The maximum distance allowed between two clicks for them to be considered a double click, in pixels.

###### Gtk.Settings:gtk-double-click-time

The maximum time to allow between two clicks for them to be considered a double click, in milliseconds.

###### Gtk.Settings:gtk-enable-accels

Whether menu items should have visible accelerators which can be activated.

###### Gtk.Settings:gtk-enable-animations

Whether to enable toolkit-wide animations.

###### Gtk.Settings:gtk-enable-event-sounds

Whether to play any event sounds at all.

###### Gtk.Settings:gtk-enable-input-feedback-sounds

Whether to play event sounds as feedback to user input.

###### Gtk.Settings:gtk-enable-primary-paste

Whether a middle click on a mouse should paste the ‘PRIMARY’ clipboard content at the cursor location.

###### Gtk.Settings:gtk-entry-password-hint-timeout

How long to show the last input character in hidden entries.

###### Gtk.Settings:gtk-entry-select-on-focus

Whether to select the contents of an entry when it is focused.

###### Gtk.Settings:gtk-error-bell

When `TRUE`, keyboard navigation and other input-related errors will cause a beep.

###### Gtk.Settings:gtk-font-name

The default font to use.

###### Gtk.Settings:gtk-font-rendering

How GTK font rendering is set up.

since: 4.16

###### Gtk.Settings:gtk-fontconfig-timestamp

Timestamp of the current fontconfig configuration.

###### Gtk.Settings:gtk-hint-font-metrics

Whether hinting should be applied to font metrics.

since: 4.6

###### Gtk.Settings:gtk-icon-theme-name

Name of the icon theme to use.

###### Gtk.Settings:gtk-im-module

Which IM (input method) module should be used by default.

###### Gtk.Settings:gtk-interface-color-scheme

The color scheme used for rendering the user interface.

since: 4.20

###### Gtk.Settings:gtk-interface-contrast

The level of contrast to use for the user interface.

since: 4.20

###### Gtk.Settings:gtk-interface-reduced-motion

Whether animations should be reduced to essential motions.

since: 4.22

###### Gtk.Settings:gtk-keyboard-focus-visible-timeout

Time in seconds that the focus is visible when using keyboard navigation. A zero value means “forever”, and a negative value means “toolkit default timeout”.

unstable since: 4.24

###### Gtk.Settings:gtk-keynav-use-caret

Whether GTK should make sure that text can be navigated with a caret, even if it is not editable.

###### Gtk.Settings:gtk-label-select-on-focus

Whether to select the contents of a selectable label when it is focused.

###### Gtk.Settings:gtk-long-press-time

The time for a button or touch press to be considered a “long press”.

###### Gtk.Settings:gtk-overlay-scrolling

Whether scrolled windows may use overlaid scrolling indicators.

###### Gtk.Settings:gtk-primary-button-warps-slider

If the value of this setting is `TRUE`, clicking the primary button in a `GtkRange` trough will move the slider, and hence set the range’s value, to the point that you clicked.

###### Gtk.Settings:gtk-print-backends

A comma-separated list of print backends to use in the print dialog.

###### Gtk.Settings:gtk-print-preview-command

A command to run for displaying the print preview.

###### Gtk.Settings:gtk-recent-files-enabled

Whether GTK should keep track of items inside the recently used resources list.

###### Gtk.Settings:gtk-recent-files-max-age

The maximum age, in days, of the items inside the recently used resources list.

###### Gtk.Settings:gtk-shell-shows-app-menu

Set to `TRUE` if the desktop environment is displaying the app menu, `FALSE` if the app should display it itself.

deprecated: 4.20

###### Gtk.Settings:gtk-shell-shows-desktop

Set to `TRUE` if the desktop environment is displaying the desktop folder, `FALSE` if not.

deprecated: 4.20

###### Gtk.Settings:gtk-shell-shows-menubar

Set to `TRUE` if the desktop environment is displaying the menubar, `FALSE` if the app should display it itself.

deprecated: 4.20

###### Gtk.Settings:gtk-show-status-shapes

When `TRUE`, widgets like switches include shapes to indicate their on/off state.

since: 4.14

###### Gtk.Settings:gtk-sound-theme-name

The XDG sound theme to use for event sounds.

###### Gtk.Settings:gtk-split-cursor

Whether two cursors should be displayed for mixed left-to-right and right-to-left text.

###### Gtk.Settings:gtk-theme-name

Name of the theme to load.

###### Gtk.Settings:gtk-titlebar-double-click

Determines the action to take when a double-click occurs on the titlebar of client-side decorated windows.

###### Gtk.Settings:gtk-titlebar-middle-click

Determines the action to take when a middle-click occurs on the titlebar of client-side decorated windows.

###### Gtk.Settings:gtk-titlebar-right-click

Determines the action to take when a right-click occurs on the titlebar of client-side decorated windows.

###### Gtk.Settings:gtk-xft-antialias

Whether to antialias fonts.

###### Gtk.Settings:gtk-xft-dpi

The font resolution, in 1024 * dots/inch.

###### Gtk.Settings:gtk-xft-hinting

Whether to enable font hinting.

###### Gtk.Settings:gtk-xft-hintstyle

What degree of font hinting to use.

###### Gtk.Settings:gtk-xft-rgba

The type of subpixel antialiasing to use.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.