Class

GtkSettings

Description [src]

class Gtk.Settings : GObject.Object {
  parent_instance: GObject
}

GtkSettings 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. In the absence of an Xsettings manager, GTK+ reads default values for settings from settings.ini files in /etc/gtk-3.0, $XDG_CONFIG_DIRS/gtk-3.0 and $XDG_CONFIG_HOME/gtk-3.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. When doing so, you need to be aware that settings that are specific to individual widgets may not be available before the widget type has been realized at least once. The following example demonstrates a way to do this:

  gtk_init (&argc, &argv);

  // make sure the type is realized
  g_type_class_unref (g_type_class_ref (GTK_TYPE_IMAGE_MENU_ITEM));

  g_object_set (gtk_settings_get_default (), "gtk-enable-animations", FALSE, NULL);

There is one GtkSettings instance per screen. It can be obtained with gtk_settings_get_for_screen(), but in many cases, it is more convenient to use gtk_widget_get_settings(). gtk_settings_get_default() returns the GtkSettings instance for the default screen.

Hierarchy

hierarchy this GtkSettings implements_0 GtkStyleProvider this--implements_0 ancestor_0 GObject ancestor_0--this

Ancestors

Implements

Functions

gtk_settings_get_default

Gets the GtkSettings object for the default GDK screen, creating it if necessary. See gtk_settings_get_for_screen().

gtk_settings_get_for_screen

Gets the GtkSettings object for screen, creating it if necessary.

Available since: 2.2

gtk_settings_install_property
No description available.

Deprecated since: 3.16

gtk_settings_install_property_parser
No description available.

Deprecated since: 3.16

Instance methods

gtk_settings_reset_property

Undoes the effect of calling g_object_set() to install an application-specific value for a setting. After this call, the setting will again follow the session-wide value for this setting.

Available since: 3.20

gtk_settings_set_double_property
No description available.

Deprecated since: 3.16

gtk_settings_set_long_property
No description available.

Deprecated since: 3.16

gtk_settings_set_property_value
No description available.

Deprecated since: 3.16

gtk_settings_set_string_property
No description available.

Deprecated since: 3.16

Methods inherited from GObject (42)
Methods inherited from GtkStyleProvider (3)
gtk_style_provider_get_icon_factory

Returns the GtkIconFactory defined to be in use for path, or NULL if none is defined.

Available since: 3.0

Deprecated since: 3.8

gtk_style_provider_get_style

Returns the style settings affecting a widget defined by path, or NULL if provider doesn’t contemplate styling path.

Available since: 3.0

Deprecated since: 3.8

gtk_style_provider_get_style_property

Looks up a widget style property as defined by provider for the widget represented by path.

Available since: 3.0

Properties

Gtk.Settings:color-hash

Holds a hash table representation of the GtkSettings:gtk-color-scheme setting, mapping color names to GdkColors.

Available since: 2.10

Deprecated since: 3.8

Gtk.Settings:gtk-alternative-button-order
No description available.
Gtk.Settings:gtk-alternative-sort-arrows

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.

Available since: 2.12

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

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.

Available since: 3.0

Gtk.Settings:gtk-auto-mnemonics

Whether mnemonics should be automatically shown and hidden when the user presses the mnemonic activator.

Available since: 2.20

Deprecated since: 3.10

Gtk.Settings:gtk-button-images

Whether images should be shown on buttons.

Available since: 2.4

Deprecated since: 3.10

Gtk.Settings:gtk-can-change-accels

Whether menu accelerators can be changed by pressing a key over the menu item.

Deprecated since: 3.10

Gtk.Settings:gtk-color-palette

Palette to use in the deprecated color selector.

Deprecated since: 3.10

Gtk.Settings:gtk-color-scheme

A palette of named colors for use in themes. The format of the string is

name1: color1
name2: color2
...

Color names must be acceptable as identifiers in the [gtkrc][gtk3-Resource-Files] syntax, and color specifications must be in the format accepted by gdk_color_parse().

Available since: 2.10

Deprecated since: 3.8

Gtk.Settings:gtk-cursor-aspect-ratio
No description available.
Gtk.Settings:gtk-cursor-blink

Whether the cursor should blink.

Gtk.Settings:gtk-cursor-blink-time
No description available.
Gtk.Settings:gtk-cursor-blink-timeout

Time after which the cursor stops blinking, in seconds. The timer is reset after each user interaction.

Available since: 2.12

Gtk.Settings:gtk-cursor-theme-name
No description available.
Gtk.Settings:gtk-cursor-theme-size
No description available.
Gtk.Settings:gtk-decoration-layout

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 of right.

Available since: 3.12

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.

Available since: 3.12

Gtk.Settings:gtk-dnd-drag-threshold
No description available.
Gtk.Settings:gtk-double-click-distance
No description available.
Gtk.Settings:gtk-double-click-time
No description available.
Gtk.Settings:gtk-enable-accels

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

Available since: 2.12

Gtk.Settings:gtk-enable-animations
No description available.
Gtk.Settings:gtk-enable-event-sounds

Whether to play any event sounds at all.

Available since: 2.14

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

Whether to play event sounds as feedback to user input.

Available since: 2.14

Gtk.Settings:gtk-enable-mnemonics

Whether labels and menu items should have visible mnemonics which can be activated.

Available since: 2.12

Deprecated since: 3.10

Gtk.Settings:gtk-enable-primary-paste

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

Available since: 3.4

Gtk.Settings:gtk-enable-tooltips

Whether tooltips should be shown on widgets.

Available since: 2.14

Deprecated since: 3.10

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

How long to show the last input character in hidden entries. This value is in milliseconds. 0 disables showing the last char. 600 is a good value for enabling it.

Available since: 2.10

Gtk.Settings:gtk-entry-select-on-focus
No description available.
Gtk.Settings:gtk-error-bell

When TRUE, keyboard navigation and other input-related errors will cause a beep. Since the error bell is implemented using gdk_window_beep(), the windowing system may offer ways to configure the error bell in many ways, such as flashing the window or similar visual effects.

Available since: 2.12

Gtk.Settings:gtk-fallback-icon-theme

Name of a icon theme to fall back to.

Deprecated since: 3.10

Gtk.Settings:gtk-file-chooser-backend

Name of the GtkFileChooser backend to use by default.

Deprecated since: 3.10

Gtk.Settings:gtk-font-name

The default font to use. GTK+ uses the family name and size from this string.

Gtk.Settings:gtk-fontconfig-timestamp
No description available.
Gtk.Settings:gtk-icon-sizes

A list of icon sizes. The list is separated by colons, and item has the form:

Deprecated since: 3.10

Gtk.Settings:gtk-icon-theme-name
No description available.
Gtk.Settings:gtk-im-module

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.

Gtk.Settings:gtk-im-preedit-style

How to draw the input method preedit string.

Deprecated since: 3.10

Gtk.Settings:gtk-im-status-style

How to draw the input method statusbar.

Deprecated since: 3.10

Gtk.Settings:gtk-key-theme-name
No description available.
Gtk.Settings:gtk-keynav-cursor-only

When TRUE, keyboard navigation should be able to reach all widgets by using the cursor keys only. Tab, Shift etc. keys can’t be expected to be present on the used input device.

Available since: 2.12

Deprecated since: 3.10

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. This is useful when using a screen reader.

Available since: 3.20

Gtk.Settings:gtk-keynav-wrap-around

When TRUE, some widgets will wrap around when doing keyboard navigation, such as menus, menubars and notebooks.

Available since: 2.12

Deprecated since: 3.10

Gtk.Settings:gtk-label-select-on-focus
No description available.
Gtk.Settings:gtk-long-press-time

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

Available since: 3.14

Gtk.Settings:gtk-menu-bar-accel

Keybinding to activate the menu bar.

Deprecated since: 3.10

Gtk.Settings:gtk-menu-bar-popup-delay

Delay before the submenus of a menu bar appear.

Deprecated since: 3.10

Gtk.Settings:gtk-menu-images

Whether images should be shown in menu items.

Deprecated since: 3.10

Gtk.Settings:gtk-menu-popdown-delay

The time before hiding a submenu when the pointer is moving towards the submenu.

Deprecated since: 3.10

Gtk.Settings:gtk-menu-popup-delay

Minimum time the pointer must stay over a menu item before the submenu appear.

Deprecated since: 3.10

Gtk.Settings:gtk-modules
No description available.
Gtk.Settings:gtk-overlay-scrolling

Whether scrolled windows may use overlayed scrolling indicators. If this is set to FALSE, scrolled windows will have permanent scrollbars.

Available since: 3.24.9

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. If it is FALSE, a primary click will cause the slider/value to move by the range’s page-size towards the point clicked.

Available since: 3.6

Gtk.Settings:gtk-print-backends

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

Available since: 2.10

Gtk.Settings:gtk-print-preview-command

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 gtk_print_settings_to_file().

Available since: 2.10

Gtk.Settings:gtk-recent-files-enabled

Whether GTK+ should keep track of items inside the recently used resources list. If set to FALSE, the list will always be empty.

Available since: 3.8

Gtk.Settings:gtk-recent-files-limit

The number of recently used files that should be displayed by default by GtkRecentChooser implementations and by the GtkFileChooser. A value of -1 means every recently used file stored.

Available since: 2.12

Deprecated since: 3.10

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

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.

Available since: 2.14

Gtk.Settings:gtk-scrolled-window-placement

Where the contents of scrolled windows are located with respect to the scrollbars, if not overridden by the scrolled window’s own placement.

Available since: 2.10

Deprecated since: 3.10

Gtk.Settings:gtk-shell-shows-app-menu
No description available.
Gtk.Settings:gtk-shell-shows-desktop
No description available.
Gtk.Settings:gtk-shell-shows-menubar
No description available.
Gtk.Settings:gtk-show-input-method-menu
No description available.

Deprecated since: 3.10

Gtk.Settings:gtk-show-unicode-menu
No description available.

Deprecated since: 3.10

Gtk.Settings:gtk-sound-theme-name

The XDG sound theme to use for event sounds.

Available since: 2.14

Gtk.Settings:gtk-split-cursor
No description available.
Gtk.Settings:gtk-theme-name
No description available.
Gtk.Settings:gtk-timeout-expand
No description available.

Deprecated since: 3.10

Gtk.Settings:gtk-timeout-initial
No description available.

Deprecated since: 3.10

Gtk.Settings:gtk-timeout-repeat
No description available.

Deprecated since: 3.10

Gtk.Settings:gtk-titlebar-double-click

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

Available since: 3.14

Gtk.Settings:gtk-titlebar-middle-click

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

Available since: 3.14

Gtk.Settings:gtk-titlebar-right-click

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

Available since: 3.14

Gtk.Settings:gtk-toolbar-icon-size

The size of icons in default toolbars.

Deprecated since: 3.10

Gtk.Settings:gtk-toolbar-style

The size of icons in default toolbars.

Deprecated since: 3.10

Gtk.Settings:gtk-tooltip-browse-mode-timeout

Amount of time, in milliseconds, after which the browse mode will be disabled.

Available since: 2.12

Deprecated since: 3.10

Gtk.Settings:gtk-tooltip-browse-timeout

Controls the time after which tooltips will appear when browse mode is enabled, in milliseconds.

Available since: 2.12

Deprecated since: 3.10

Gtk.Settings:gtk-tooltip-timeout

Time, in milliseconds, after which a tooltip could appear if the cursor is hovering on top of a widget.

Available since: 2.12

Deprecated since: 3.10

Gtk.Settings:gtk-touchscreen-mode

When TRUE, there are no motion notify events delivered on this screen, and widgets can’t use the pointer hovering them for any essential functionality.

Available since: 2.10

Deprecated since: 3.4.

Gtk.Settings:gtk-visible-focus

Whether ‘focus rectangles’ should be always visible, never visible, or hidden until the user starts to use the keyboard.

Available since: 3.2

Deprecated since: 3.10

Gtk.Settings:gtk-xft-antialias
No description available.
Gtk.Settings:gtk-xft-dpi
No description available.
Gtk.Settings:gtk-xft-hinting
No description available.
Gtk.Settings:gtk-xft-hintstyle
No description available.
Gtk.Settings:gtk-xft-rgba
No description available.

Signals

Signals inherited from GObject (1)

Class structure

struct GtkSettingsClass {
  GObjectClass parent_class;
  void (* _gtk_reserved1) (
void
  );
  void (* _gtk_reserved2) (
void
  );
  void (* _gtk_reserved3) (
void
  );
  void (* _gtk_reserved4) (
void
  );
  
}
Class members
parent_class
GObjectClass
  No description available.
_gtk_reserved1
void (* _gtk_reserved1) (
void
  )
  No description available.
_gtk_reserved2
void (* _gtk_reserved2) (
void
  )
  No description available.
_gtk_reserved3
void (* _gtk_reserved3) (
void
  )
  No description available.
_gtk_reserved4
void (* _gtk_reserved4) (
void
  )
  No description available.