Class
GtkSettings
Description [src]
class Gtk.Settings : GObject.Object
implements Gtk.StyleProvider {
/* No available fields */
}
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.
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.
since: 2.2
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.
since: 3.20
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.
deprecated: 3.8 since: 3.0
gtk_style_provider_get_style
Returns the style settings affecting a widget defined by path
, or NULL
if
provider
doesn’t contemplate styling path
.
deprecated: 3.8 since: 3.0
gtk_style_provider_get_style_property
Looks up a widget style property as defined by provider
for
the widget represented by path
.
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
.
deprecated: 3.8 since: 2.10
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.
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.
since: 3.0
Gtk.Settings:gtk-auto-mnemonics
Whether mnemonics should be automatically shown and hidden when the user presses the mnemonic activator.
deprecated: 3.10 since: 2.20
Gtk.Settings:gtk-button-images
Whether images should be shown on buttons.
deprecated: 3.10 since: 2.4
Gtk.Settings:gtk-can-change-accels
Whether menu accelerators can be changed by pressing a key over the menu item.
deprecated: 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().
deprecated: 3.8 since: 2.10
Gtk.Settings:gtk-cursor-blink-timeout
Time after which the cursor stops blinking, in seconds. The timer is reset after each user interaction.
since: 2.12
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.
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.
since: 3.12
Gtk.Settings:gtk-enable-accels
Whether menu items should have visible accelerators which can be activated.
since: 2.12
Gtk.Settings:gtk-enable-input-feedback-sounds
Whether to play event sounds as feedback to user input.
since: 2.14
Gtk.Settings:gtk-enable-mnemonics
Whether labels and menu items should have visible mnemonics which can be activated.
deprecated: 3.10 since: 2.12
Gtk.Settings:gtk-enable-primary-paste
Whether a middle click on a mouse should paste the ‘PRIMARY’ clipboard content at the cursor location.
since: 3.4
Gtk.Settings:gtk-enable-tooltips
Whether tooltips should be shown on widgets.
deprecated: 3.10 since: 2.14
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.
since: 2.10
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.
since: 2.12
Gtk.Settings:gtk-file-chooser-backend
Name of the GtkFileChooser backend to use by default.
deprecated: 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-icon-sizes
A list of icon sizes. The list is separated by colons, and item has the form:.
deprecated: 3.10
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-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.
deprecated: 3.10 since: 2.12
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.
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.
deprecated: 3.10 since: 2.12
Gtk.Settings:gtk-long-press-time
The time for a button or touch press to be considered a “long press”.
since: 3.14
Gtk.Settings:gtk-menu-bar-popup-delay
Delay before the submenus of a menu bar appear.
deprecated: 3.10
Gtk.Settings:gtk-menu-popdown-delay
The time before hiding a submenu when the pointer is moving towards the submenu.
deprecated: 3.10
Gtk.Settings:gtk-menu-popup-delay
Minimum time the pointer must stay over a menu item before the submenu appear.
deprecated: 3.10
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.
unstable 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.
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”.
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().
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.
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.
deprecated: 3.10 since: 2.12
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.
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.
deprecated: 3.10 since: 2.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.
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.
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.
since: 3.14
Gtk.Settings:gtk-tooltip-browse-mode-timeout
Amount of time, in milliseconds, after which the browse mode will be disabled.
deprecated: 3.10 since: 2.12
Gtk.Settings:gtk-tooltip-browse-timeout
Controls the time after which tooltips will appear when browse mode is enabled, in milliseconds.
deprecated: 3.10 since: 2.12
Gtk.Settings:gtk-tooltip-timeout
Time, in milliseconds, after which a tooltip could appear if the cursor is hovering on top of a widget.
deprecated: 3.10 since: 2.12
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.
deprecated: 3.4. since: 2.10
Gtk.Settings:gtk-visible-focus
Whether ‘focus rectangles’ should be always visible, never visible, or hidden until the user starts to use the keyboard.
deprecated: 3.10 since: 3.2
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.
Class structure
struct GtkSettingsClass {
GObjectClass parent_class;
void (* _gtk_reserved1) (
void
);
void (* _gtk_reserved2) (
void
);
void (* _gtk_reserved3) (
void
);
void (* _gtk_reserved4) (
void
);
}
No description available.
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.