:right-sidebar: True Settings =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: Settings(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.StyleProvider` ``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 :obj:`~gi.repository.Gio.Settings`\. 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 :func:`~gi.repository.GObject.GObject.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 :obj:`~gi.repository.Gtk.Settings.get_for_display`\, but in many cases, it is more convenient to use :obj:`~gi.repository.Gtk.Widget.get_settings`\. Methods ------- .. rst-class:: interim-class .. class:: Settings :no-index: .. classmethod:: get_default() -> ~gi.repository.Gtk.Settings | None Gets the ``GtkSettings`` object for the default display, creating it if necessary. See :obj:`~gi.repository.Gtk.Settings.get_for_display`\. .. classmethod:: get_for_display() -> ~gi.repository.Gtk.Settings Gets the ``GtkSettings`` object for ``display``\, creating it if necessary. .. method:: reset_property(name: str) -> None Undoes the effect of calling :func:`~gi.repository.GObject.GObject.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. :param name: the name of the setting to reset Properties ---------- .. rst-class:: interim-class .. class:: Settings :no-index: .. attribute:: props.gtk_alternative_button_order :type: bool The type of the None singleton. .. attribute:: props.gtk_alternative_sort_arrows :type: bool The type of the None singleton. .. attribute:: props.gtk_application_prefer_dark_theme :type: bool The type of the None singleton. .. attribute:: props.gtk_cursor_aspect_ratio :type: float The type of the None singleton. .. attribute:: props.gtk_cursor_blink :type: bool The type of the None singleton. .. attribute:: props.gtk_cursor_blink_time :type: int The type of the None singleton. .. attribute:: props.gtk_cursor_blink_timeout :type: int The type of the None singleton. .. attribute:: props.gtk_cursor_theme_name :type: str The type of the None singleton. .. attribute:: props.gtk_cursor_theme_size :type: int The type of the None singleton. .. attribute:: props.gtk_decoration_layout :type: str The type of the None singleton. .. attribute:: props.gtk_dialogs_use_header :type: bool The type of the None singleton. .. attribute:: props.gtk_dnd_drag_threshold :type: int The type of the None singleton. .. attribute:: props.gtk_double_click_distance :type: int The type of the None singleton. .. attribute:: props.gtk_double_click_time :type: int The type of the None singleton. .. attribute:: props.gtk_enable_accels :type: bool The type of the None singleton. .. attribute:: props.gtk_enable_animations :type: bool The type of the None singleton. .. attribute:: props.gtk_enable_event_sounds :type: bool The type of the None singleton. .. attribute:: props.gtk_enable_input_feedback_sounds :type: bool The type of the None singleton. .. attribute:: props.gtk_enable_primary_paste :type: bool The type of the None singleton. .. attribute:: props.gtk_entry_password_hint_timeout :type: int The type of the None singleton. .. attribute:: props.gtk_entry_select_on_focus :type: bool The type of the None singleton. .. attribute:: props.gtk_error_bell :type: bool The type of the None singleton. .. attribute:: props.gtk_font_name :type: str The type of the None singleton. .. attribute:: props.gtk_font_rendering :type: ~gi.repository.Gtk.FontRendering The type of the None singleton. .. versionadded:: 4.16 .. attribute:: props.gtk_fontconfig_timestamp :type: int The type of the None singleton. .. attribute:: props.gtk_hint_font_metrics :type: bool The type of the None singleton. .. versionadded:: 4.6 .. attribute:: props.gtk_icon_theme_name :type: str The type of the None singleton. .. attribute:: props.gtk_im_module :type: str The type of the None singleton. .. attribute:: props.gtk_keynav_use_caret :type: bool The type of the None singleton. .. attribute:: props.gtk_label_select_on_focus :type: bool The type of the None singleton. .. attribute:: props.gtk_long_press_time :type: int The type of the None singleton. .. attribute:: props.gtk_overlay_scrolling :type: bool The type of the None singleton. .. attribute:: props.gtk_primary_button_warps_slider :type: bool The type of the None singleton. .. attribute:: props.gtk_print_backends :type: str The type of the None singleton. .. attribute:: props.gtk_print_preview_command :type: str The type of the None singleton. .. attribute:: props.gtk_recent_files_enabled :type: bool The type of the None singleton. .. attribute:: props.gtk_recent_files_max_age :type: int The type of the None singleton. .. attribute:: props.gtk_shell_shows_app_menu :type: bool The type of the None singleton. .. attribute:: props.gtk_shell_shows_desktop :type: bool The type of the None singleton. .. attribute:: props.gtk_shell_shows_menubar :type: bool The type of the None singleton. .. attribute:: props.gtk_show_status_shapes :type: bool The type of the None singleton. .. versionadded:: 4.14 .. attribute:: props.gtk_sound_theme_name :type: str The type of the None singleton. .. attribute:: props.gtk_split_cursor :type: bool The type of the None singleton. .. attribute:: props.gtk_theme_name :type: str The type of the None singleton. .. attribute:: props.gtk_titlebar_double_click :type: str The type of the None singleton. .. attribute:: props.gtk_titlebar_middle_click :type: str The type of the None singleton. .. attribute:: props.gtk_titlebar_right_click :type: str The type of the None singleton. .. attribute:: props.gtk_xft_antialias :type: int The type of the None singleton. .. attribute:: props.gtk_xft_dpi :type: int The type of the None singleton. .. attribute:: props.gtk_xft_hinting :type: int The type of the None singleton. .. attribute:: props.gtk_xft_hintstyle :type: str The type of the None singleton. .. attribute:: props.gtk_xft_rgba :type: str The type of the None singleton.