Package: gtk

Class gtk:settings

Superclasses

gtk:style-provider, gobject:object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

None

Direct Slots

gtk-alternative-button-order
The gtk-alternative-button-order property of type :boolean (Read / Write)
Whether buttons in dialogs should use the alternative button order.
Default value: false
gtk-alternative-sort-arrows
The gtk-alternative-sort-arrows property of type :boolean (Read / Write)
Controls the direction of the sort indicators in sorted list and tree views. By default an arrow pointing down means the column is sorted in ascending order. When set to true, this order will be inverted.
Default value: false
gtk-application-prefer-dark-theme
The gtk-application-prefer-dark-theme property of type :boolean (Read / Write)
Whether the application prefers to use a dark theme. If a GTK theme includes a dark variant, it will be used instead of the configured theme.
Default value: false
gtk-cursor-aspect-ratio
The gtk-cursor-aspect-ratio property of type :float (Read / Write)
The aspect ratio of the text caret.
Allowed values: [0.0, 1.0]
Default value: 0.04
gtk-cursor-blink
The gtk-cursor-blink property of type :boolean (Read / Write)
Whether the cursor should blink. Also see the gtk-cursor-blink-timeout setting, which allows more flexible control over cursor blinking.
Default value: true
gtk-cursor-blink-time
The gtk-cursor-blink-time property of type :int (Read / Write)
Length of the cursor blink cycle, in milliseconds.
Allowed values: >= 100
Default value: 1200
gtk-cursor-blink-timeout
The gtk-cursor-blink-timeout property of type :int (Read / Write)
Time after which the cursor stops blinking, in seconds. The timer is reset after each user interaction. Setting this to zero has the same effect as setting the gtk-cursor-blink property to false.
Allowed values: >= 1
Default value: 10
gtk-cursor-theme-name
The gtk-cursor-theme-name property of type :string (Read / Write)
Name of the cursor theme to use, or nil to use the default theme.
gtk-cursor-theme-size
The gtk-cursor-theme-size property of type :int (Read / Write)
Size to use for cursors, or 0 to use the default size.
Allowed values: [0,128]
Default value: 0
gtk-decoration-layout
The gtk-decoration-layout property of type :string (Read / Write)
This setting determines which buttons should be put in the titlebar of client-side decorated windows, and whether they should be placed at the left or right. The format of the string is button names, separated by commas. A colon separates the buttons that should appear on the left from those on the right. Recognized button names are minimize, maximize, close, icon (the window icon) and menu (a menu button for the fallback app menu). For example, "menu:minimize,maximize,close" specifies a menu on the left, and Minimize, Maximize and Close buttons on the right. Note that buttons will only be shown when they are meaningful. For example, a menu button only appears when the desktop shell does not show the application menu, and a Close button only appears on a window that can be closed. Also note that the setting can be overridden with the decoration-layout property of the header bar.
Default value: "menu:minimize,maximize,close"
gtk-dialogs-use-header
The gtk-dialogs-use-header property of type :boolean (Read / Write)
Whether built-in 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. This setting does not affect custom dialogs using the gtk:dialog widget directly, or message dialogs.
Default value: false
gtk-dnd-drag-threshold
The gtk-dnd-drag-threshold property of type :int (Read / Write)
Number of pixels the cursor can move before dragging.
Allowed values: >= 1
Default value: 8
gtk-double-click-distance
The gtk-double-click-distance property of type :int (Read / Write)
Maximum distance in pixels allowed between two clicks for them to be considered a double click.
Allowed values: >= 0
Default value: 5
gtk-double-click-time
The gtk-double-click-time property of type :int (Read / Write)
Maximum time allowed between two clicks for them to be considered a double click, in milliseconds.
Allowed values: >= 0
Default value: 250
gtk-enable-accels
The gtk-enable-accels property of type :boolean (Read / Write)
Whether menu items should have visible accelerators which can be activated.
Default value: true
gtk-enable-animations
The gtk-enable-animations property of type :boolean (Read / Write)
Whether to enable toolkit-wide animations.
Default value: true
gtk-enable-event-sounds
The gtk-enable-event-sounds property of type :boolean (Read / Write)
Whether to play any event sounds at all. See the Sound Theme specification for more information on event sounds and sound themes. GTK itself does not support event sounds, you have to use a loadable module like the one that comes with the libcanberra library.
Default value: true
gtk-enable-input-feedback-sounds
The gtk-enable-input-feedback-sounds property of type :boolean (Read / Write)
Whether to play event sounds as feedback to user input. See the Sound Theme specification for more information on event sounds and sound themes. GTK itself does not support event sounds, you have to use a loadable module like the one that comes with the libcanberra library.
Default value: true
gtk-enable-primary-paste
The gtk-enable-primary-paste property of type :boolean (Read / Write)
Whether a middle click on a mouse should paste the "PRIMARY" clipboard content at the cursor location.
Default value: true
gtk-entry-password-hint-timeout
The gtk-entry-password-hint-timeout property of type :uint (Read / Write)
How long to show the last input character in hidden entries. This value is in milliseconds. The value 0 disables showing the last char. The value 600 is a good value for enabling it.
Default value: 0
gtk-entry-select-on-focus
The gtk-entry-select-on-focus property of type :boolean (Read / Write)
Whether to select the contents of an entry when it is focused.
Default value: true
gtk-error-bell
The gtk-error-bell property of type :boolean (Read / Write)
When true, keyboard navigation and other input-related errors will cause a beep. Since the error bell is implemented using the gdk:surface-beep function, the windowing system may offer ways to configure the error bell in many ways, such as flashing the window or similar visual effects.
Default value: true
gtk-font-name
The gtk-font-name property of type :string (Read / Write)
Name of default font to use.
gtk-font-rendering
The gtk-font-rendering property of type gtk:font-rendering (Read / Write)
How GTK font rendering is set up. When set to :manual, GTK respects the low-level font-related settings (gtk-hint-font-metrics, gtk-xft-antialias, gtk-xft-hinting, gtk-xft-hintstyle and gtk-xft-rgba) as much as practical. When set to :automatic, GTK will consider factors such as screen resolution and scale in deciding how to render fonts. Since 4.16
Default value: :automatic
gtk-fontconfig-timestamp
The gtk-fontconfig-timestamp property of type :uint (Read / Write)
Timestamp of the current fontconfig configuration.
Default value: 0
gtk-hint-font-metrics
The gtk-hint-font-metrics property of type :boolean (Read / Write)
Whether hinting should be applied to font metrics. Note that this also turns off subpixel positioning of glyphs, since it conflicts with metrics hinting. Since 4.6
gtk-icon-theme-name
The gtk-icon-theme-name property of type :string (Read / Write)
Name of the icon theme to use.
gtk-im-module
The gtk-im-module property of type :string (Read / Write)
Which IM (input method) module should be used by default. This is the input method that will be used if the user has not explicitly chosen another input method from the IM context menu. This also can be a colon-separated list of input methods, which GTK will try in turn until it finds one available on the system. See the gtk:im-context class and the gtk-show-input-method-menu setting.
Default value: nil
gtk-keynav-use-caret
The gtk-keynav-use-caret property of type :boolean (Read / Write)
Whether GTK should make sure that text can be navigated with a caret, even if it is not editable. This is useful when using a screen reader.
Default value: false
gtk-label-select-on-focus
The gtk-label-select-on-focus property of type :boolean (Read / Write)
Whether to select the contents of a selectable label when it is focused.
Default value: true
gtk-long-press-time
The gtk-long-press-time property of type :uint (Read / Write)
The time for a button or touch press to be considered a "long press".
Allowed values: <= G_MAXINT
Default value: 50
gtk-overlay-scrolling
The gtk-overlay-scrolling property of type :boolean (Read / Write)
Whether scrolled windows may use overlayed scrolling indicators. If this is set to false, scrolled windows will have permanent scrollbars.
Default value: true
gtk-primary-button-warps-slider
The gtk-primary-button-warps-slider property of type :boolean (Read / Write)
Whether a click in a gtk:range widget trough should scroll to the click position or scroll by a single page in the respective direction.
Default value: true
gtk-print-backends
The gtk-print-backends property of type :string (Read / Write)
A comma-separated list of print backends to use in the print dialog. Available print backends depend on the GTK installation, and may include "file", "cups", "lpr" or "papi".
Default value: "file,cups"
gtk-print-preview-command
The gtk-print-preview-command property of type :string (Read / Write)
A command to run for displaying the print preview. The command should contain a f placeholder, which will get replaced by the path to the PDF file. The command may also contain a s placeholder, which will get replaced by the path to a file containing the print settings in the format produced by the gtk:print-settings-to-file function. The preview application is responsible for removing the PDF file and the print settings file when it is done.
Default value: "evince --unlink-tempfile --preview --print-settings %s %f"
gtk-recent-files-enabled
The gtk-recent-files-enabled property of type :boolean (Read / Write)
Whether GTK should keep track of items inside the recently used resources list. If set to false, the list will always be empty.
Default value: true
gtk-recent-files-max-age
The gtk-recent-files-max-age property of type :int (Read / Write)
The maximum age, in days, of the items inside the recently used resources list. Items older than this setting will be excised from the list. If set to 0, the list will always be empty; if set to -1, no item will be removed.
Allowed values: >= 30
Default value: 30
gtk-shell-shows-app-menu
The shell-shows-app-menu property of type :boolean (Read / Write)
Set to true if the desktop environment is displaying the application menu, false if the application should display it itself.
Default value: false
gtk-shell-shows-desktop
The gtk-shell-shows-desktop property of type :boolean (Read / Write)
Set to true if the desktop environment is displaying the desktop folder, false if not.
Default value: true
gtk-shell-shows-menubar
The gtk-shell-shows-menubar property of type :boolean (Read / Write)
Set to true if the desktop environment is displaying the menubar, false if the application should display it itself.
Default value: false
gtk-show-status-shapes
The gtk-show-status-shapes property of type :boolean (Read / Write)
If true, widgets like switches include shapes to indicate their on/off state. Since 4.14
Default value: false
gtk-sound-theme-name
The gtk-sound-theme-name property of type :string (Read / Write)
The XDG sound theme to use for event sounds. See the Sound Theme specification for more information on event sounds and sound themes. GTK itself does not support event sounds, you have to use a loadable module like the one that comes with the libcanberra library.
gtk-split-cursor
The gtk-split-cursor property of type :boolean (Read / Write)
Whether two cursors should be displayed for mixed left-to-right and right-to-left text.
Default value: true
gtk-theme-name
The gtk-theme-name property of type :string (Read / Write)
Name of the theme to load.
gtk-titlebar-double-click
The gtk-titlebar-double-click property of type :string (Read / Write)
This setting determines the action to take when a double click occures on the titlebar of client-side decorated windows. Recognized actions are "minimize", "toggle-maximize", "menu", "lower" or "none".
Default value: "toggle-maximize"
gtk-titlebar-middle-click
The gtk-titlebar-middle-click property of type :string (Read / Write)
This setting determines the action to take when a middle-click occurs on the titlebar of client-side decorated windows. Recognized actions are "minimize", "toggle-maximize", "menu", "lower" or "none".
Default value: "none"
gtk-titlebar-right-click
The gtk-titlebar-right-click property of type :string (Read / Write)
This setting determines the action to take when a right-click occurs on the titlebar of client-side decorated windows. Recognized actions are "minimize", "toggle-maximize", "menu", "lower" or "none".
Default value: "menu"
gtk-xft-antialias
The gtk-xft-antialias property of type :int (Read / Write)
Whether to antialias Xft fonts: 0 = no, 1 = yes, -1 = default.
Allowed values: [-1,1]
Default value: -1
gtk-xft-dpi
The gtk-xft-dpi property of type :int (Read / Write)
Resolution for Xft, in 1024 * dots/inch. -1 to use default value.
Allowed values: [-1,1048576]
Default value: -1
gtk-xft-hinting
The gtk-xft-hinting property of type :int (Read / Write)
Whether to hint Xft fonts: 0 = no, 1 = yes, -1 = default.
Allowed values: [-1,1]
Default value: -1
gtk-xft-hintstyle
The gtk-xft-hintstyle property of type :string (Read / Write)
What degree of hinting to use: hintnone, hintslight, hintmedium, or hintfull.
Default value: nil
gtk-xft-rgba
The gtk-xft-rgba property of type :string (Read / Write)
Type of subpixel antialiasing: none, rgb, bgr, vrgb, vbgr.
Default value: nil

Details

The gtk:settings object provide 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.

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 the g:key-file API, 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 with the accessor functions of the slots. This should be restricted to special cases though. The gtk:settings settings are not meant as an application configuration facility.

There is one gtk:settings instance per display. It can be obtained with the gtk:settings-for-display function, but in many cases, it is more convenient to use the gtk:widget-settings function.
 

Slot Access Functions

gtk:settings-gtk-alternative-button-order
gtk:settings-gtk-alternative-sort-arrows
gtk:settings-gtk-application-prefer-dark-theme
gtk:settings-gtk-cursor-aspect-ratio
gtk:settings-gtk-cursor-blink
gtk:settings-gtk-cursor-blink-time
gtk:settings-gtk-cursor-blink-timeout
gtk:settings-gtk-cursor-theme-name
gtk:settings-gtk-cursor-theme-size
gtk:settings-gtk-decoration-layout
gtk:settings-gtk-dialogs-use-header
gtk:settings-gtk-dnd-drag-threshold
gtk:settings-gtk-double-click-distance
gtk:settings-gtk-double-click-time
gtk:settings-gtk-enable-accels
gtk:settings-gtk-enable-animations
gtk:settings-gtk-enable-event-sounds
gtk:settings-gtk-enable-input-feedback-sounds
gtk:settings-gtk-enable-primary-paste
gtk:settings-gtk-entry-password-hint-timeout
gtk:settings-gtk-entry-select-on-focus
gtk:settings-gtk-error-bell
gtk:settings-gtk-font-name
gtk:settings-gtk-font-rendering
gtk:settings-gtk-fontconfig-timestamp
gtk:settings-gtk-icon-theme-name
gtk:settings-gtk-im-module
gtk:settings-gtk-keynav-use-caret
gtk:settings-gtk-label-select-on-focus
gtk:settings-gtk-long-press-time
gtk:settings-gtk-overlay-scrolling
gtk:settings-gtk-primary-button-warps-slider
gtk:settings-gtk-print-backends
gtk:settings-gtk-print-preview-command
gtk:settings-gtk-recent-files-enabled
gtk:settings-gtk-recent-files-max-age
gtk:settings-gtk-shell-shows-app-menu
gtk:settings-gtk-shell-shows-desktop
gtk:settings-gtk-shell-shows-menubar
gtk:settings-gtk-show-status-shapes
gtk:settings-gtk-sound-theme-name
gtk:settings-gtk-split-cursor
gtk:settings-gtk-theme-name
gtk:settings-gtk-titlebar-double-click
gtk:settings-gtk-titlebar-middle-click
gtk:settings-gtk-titlebar-right-click
gtk-xft-antialias
gtk:settings-gtk-xft-dpi
gtk:settings-gtk-xft-hinting
gtk:settings-gtk-xft-hintstyle
gtk:settings-gtk-xft-rgba

Inherited Slot Access Functions

See also

2024-5-25