### Class

# Gtk Settings

since: 4.0

#### Description [src]

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

`GtkSettings` 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 `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()`.

Available since: 4.0

#### Ancestors

- GObject

#### Implements

- GtkStyleProvider

#### Functions

###### gtk_settings_get_default

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

since: 4.0

###### gtk_settings_get_for_display

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

since: 4.0

#### Instance methods

###### gtk_settings_reset_property

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

since: 4.0

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

Please see GObject for a full list of methods.

#### Properties

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

Whether buttons in dialogs should use the alternative button order.

since: 4.0

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

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

since: 4.0

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

Whether the application prefers to use a dark theme.

since: 4.0

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

The aspect ratio of the text caret.

since: 4.0

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

Whether the cursor should blink.

since: 4.0

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

Length of the cursor blink cycle, in milliseconds.

since: 4.0

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

Time after which the cursor stops blinking, in seconds.

since: 4.0

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

Name of the cursor theme to use.

since: 4.0

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

The size to use for cursors.

since: 4.0

###### 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.

since: 4.0

###### 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.

since: 4.0

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

The number of pixels the cursor can move before dragging.

since: 4.0

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

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

since: 4.0

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

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

since: 4.0

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

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

since: 4.0

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

Whether to enable toolkit-wide animations.

since: 4.0

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

Whether to play any event sounds at all.

since: 4.0

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

Whether to play event sounds as feedback to user input.

since: 4.0

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

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

since: 4.0

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

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

since: 4.0

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

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

since: 4.0

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

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

since: 4.0

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

The default font to use.

since: 4.0

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

Timestamp of the current fontconfig configuration.

since: 4.0

###### 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.

since: 4.0

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

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

since: 4.0

###### 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.

since: 4.0

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

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

since: 4.0

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

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

since: 4.0

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

Whether scrolled windows may use overlaid scrolling indicators.

since: 4.0

###### 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.

since: 4.0

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

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

since: 4.0

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

A command to run for displaying the print preview.

since: 4.0

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

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

since: 4.0

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

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

since: 4.0

###### 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.

since: 4.0

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

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

since: 4.0

###### 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.

since: 4.0

###### 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.

since: 4.0

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

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

since: 4.0

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

Name of the theme to load.

since: 4.0

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

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

since: 4.0

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

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

since: 4.0

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

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

since: 4.0

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

Whether to antialias fonts.

since: 4.0

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

The font resolution, in 1024 * dots/inch.

since: 4.0

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

Whether to enable font hinting.

since: 4.0

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

What degree of font hinting to use.

since: 4.0

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

The type of subpixel antialiasing to use.

since: 4.0

#### 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.

since: 2.0

##### Signals inherited from GtkStyleProvider (1)

###### GtkStyleProvider::gtk-private-changed

No description available.

since: 4.0