Class
GtkSettings
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 GSettings
.
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()
.
Functions
gtk_settings_get_default
Gets the GtkSettings
object for the default 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.
Properties
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-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-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-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-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-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-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.
Gtk.Settings:gtk-shell-shows-desktop
Set to TRUE
if the desktop environment is displaying
the desktop folder, FALSE
if not.
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.
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-split-cursor
Whether two cursors should be displayed for mixed left-to-right and right-to-left text.
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.
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.