gnome.pages.gitlab.gnome.org

Gtk.Settings

Class

GtkSettings

Description [src]

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

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

Instance methods

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

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.

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.