class Gtk::Settings

Overview

Gtk::Settings 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 DConf.

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 Gtk::Settings object with g_object_set(). This should be restricted to special cases though; Gtk::Settings are not meant as an application configuration facility.

There is one Gtk::Settings instance per display. It can be obtained with Gtk::Settings#for_display, but in many cases, it is more convenient to use Gtk::Widget#settings.

Included Modules

Defined in:

lib/gi-crystal/src/auto/gtk-4.0/settings.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module Gtk::StyleProvider

gtk_private_changed_signal gtk_private_changed_signal, to_unsafe to_unsafe

Class methods inherited from module Gtk::StyleProvider

g_type : UInt64 g_type

Instance methods inherited from class GObject::Object

bind_property(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags) : GObject::Binding bind_property, bind_property_full(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags, transform_to : GObject::Closure, transform_from : GObject::Closure) : GObject::Binding bind_property_full, data(key : String) : Pointer(Void)? data, finalize finalize, freeze_notify : Nil freeze_notify, getv(names : Enumerable(String), values : Enumerable(_)) : Nil getv, notify(property_name : String) : Nil notify, notify_by_pspec(pspec : GObject::ParamSpec) : Nil notify_by_pspec, notify_signal notify_signal, property(property_name : String, value : _) : Nil property, qdata(quark : UInt32) : Pointer(Void)? qdata, ref_count : UInt32 ref_count, run_dispose : Nil run_dispose, set_data(key : String, data : Pointer(Void)?) : Nil set_data, set_property(property_name : String, value : _) : Nil set_property, steal_data(key : String) : Pointer(Void)? steal_data, steal_qdata(quark : UInt32) : Pointer(Void)? steal_qdata, thaw_notify : Nil thaw_notify, to_unsafe : Pointer(Void) to_unsafe, watch_closure(closure : GObject::Closure) : Nil watch_closure

Constructor methods inherited from class GObject::Object

cast(obj : GObject::Object) : self cast, cast?(obj : GObject::Object) : self? cast?, new(pointer : Pointer(Void), transfer : GICrystal::Transfer)
new
new
, newv(object_type : UInt64, parameters : Enumerable(GObject::Parameter)) : self newv

Class methods inherited from class GObject::Object

compat_control(what : UInt64, data : Pointer(Void)?) : UInt64 compat_control, g_type : UInt64 g_type, interface_find_property(g_iface : GObject::TypeInterface, property_name : String) : GObject::ParamSpec interface_find_property, interface_list_properties(g_iface : GObject::TypeInterface) : Enumerable(GObject::ParamSpec) interface_list_properties

Constructor Detail

def self.new #

Initialize a new Settings.


def self.new(*, gtk_alternative_button_order : Bool? = nil, gtk_alternative_sort_arrows : Bool? = nil, gtk_application_prefer_dark_theme : Bool? = nil, gtk_cursor_aspect_ratio : Float64? = nil, gtk_cursor_blink : Bool? = nil, gtk_cursor_blink_time : Int32? = nil, gtk_cursor_blink_timeout : Int32? = nil, gtk_cursor_theme_name : String? = nil, gtk_cursor_theme_size : Int32? = nil, gtk_decoration_layout : String? = nil, gtk_dialogs_use_header : Bool? = nil, gtk_dnd_drag_threshold : Int32? = nil, gtk_double_click_distance : Int32? = nil, gtk_double_click_time : Int32? = nil, gtk_enable_accels : Bool? = nil, gtk_enable_animations : Bool? = nil, gtk_enable_event_sounds : Bool? = nil, gtk_enable_input_feedback_sounds : Bool? = nil, gtk_enable_primary_paste : Bool? = nil, gtk_entry_password_hint_timeout : UInt32? = nil, gtk_entry_select_on_focus : Bool? = nil, gtk_error_bell : Bool? = nil, gtk_font_name : String? = nil, gtk_fontconfig_timestamp : UInt32? = nil, gtk_hint_font_metrics : Bool? = nil, gtk_icon_theme_name : String? = nil, gtk_im_module : String? = nil, gtk_keynav_use_caret : Bool? = nil, gtk_label_select_on_focus : Bool? = nil, gtk_long_press_time : UInt32? = nil, gtk_overlay_scrolling : Bool? = nil, gtk_primary_button_warps_slider : Bool? = nil, gtk_print_backends : String? = nil, gtk_print_preview_command : String? = nil, gtk_recent_files_enabled : Bool? = nil, gtk_recent_files_max_age : Int32? = nil, gtk_shell_shows_app_menu : Bool? = nil, gtk_shell_shows_desktop : Bool? = nil, gtk_shell_shows_menubar : Bool? = nil, gtk_sound_theme_name : String? = nil, gtk_split_cursor : Bool? = nil, gtk_theme_name : String? = nil, gtk_titlebar_double_click : String? = nil, gtk_titlebar_middle_click : String? = nil, gtk_titlebar_right_click : String? = nil, gtk_xft_antialias : Int32? = nil, gtk_xft_dpi : Int32? = nil, gtk_xft_hinting : Int32? = nil, gtk_xft_hintstyle : String? = nil, gtk_xft_rgba : String? = nil) #

Class Method Detail

def self.default : Gtk::Settings? #

Gets the Gtk::Settings object for the default display, creating it if necessary.

See Gtk::Settings#for_display.


def self.for_display(display : Gdk::Display) : Gtk::Settings #

Gets the Gtk::Settings object for @display, creating it if necessary.


def self.g_type : UInt64 #

Returns the type id (GType) registered in GLib type system.


Instance Method Detail

def gtk_alternative_button_order=(value : Bool) : Bool #

def gtk_alternative_button_order? : Bool #

def gtk_alternative_sort_arrows=(value : Bool) : Bool #

def gtk_alternative_sort_arrows? : Bool #

def gtk_application_prefer_dark_theme=(value : Bool) : Bool #

def gtk_application_prefer_dark_theme? : Bool #

def gtk_cursor_aspect_ratio : Float64 #

def gtk_cursor_aspect_ratio=(value : Float64) : Float64 #

def gtk_cursor_blink=(value : Bool) : Bool #

def gtk_cursor_blink? : Bool #

def gtk_cursor_blink_time : Int32 #

def gtk_cursor_blink_time=(value : Int32) : Int32 #

def gtk_cursor_blink_timeout : Int32 #

def gtk_cursor_blink_timeout=(value : Int32) : Int32 #

def gtk_cursor_theme_name : String #

def gtk_cursor_theme_name=(value : String) : String #

def gtk_cursor_theme_size : Int32 #

def gtk_cursor_theme_size=(value : Int32) : Int32 #

def gtk_decoration_layout : String #

def gtk_decoration_layout=(value : String) : String #

def gtk_dialogs_use_header=(value : Bool) : Bool #

def gtk_dialogs_use_header? : Bool #

def gtk_dnd_drag_threshold : Int32 #

def gtk_dnd_drag_threshold=(value : Int32) : Int32 #

def gtk_double_click_distance : Int32 #

def gtk_double_click_distance=(value : Int32) : Int32 #

def gtk_double_click_time : Int32 #

def gtk_double_click_time=(value : Int32) : Int32 #

def gtk_enable_accels=(value : Bool) : Bool #

def gtk_enable_accels? : Bool #

def gtk_enable_animations=(value : Bool) : Bool #

def gtk_enable_animations? : Bool #

def gtk_enable_event_sounds=(value : Bool) : Bool #

def gtk_enable_event_sounds? : Bool #

def gtk_enable_input_feedback_sounds=(value : Bool) : Bool #

def gtk_enable_input_feedback_sounds? : Bool #

def gtk_enable_primary_paste=(value : Bool) : Bool #

def gtk_enable_primary_paste? : Bool #

def gtk_entry_password_hint_timeout : UInt32 #

def gtk_entry_password_hint_timeout=(value : UInt32) : UInt32 #

def gtk_entry_select_on_focus=(value : Bool) : Bool #

def gtk_entry_select_on_focus? : Bool #

def gtk_error_bell=(value : Bool) : Bool #

def gtk_error_bell? : Bool #

def gtk_font_name : String #

def gtk_font_name=(value : String) : String #

def gtk_fontconfig_timestamp : UInt32 #

def gtk_fontconfig_timestamp=(value : UInt32) : UInt32 #

def gtk_hint_font_metrics=(value : Bool) : Bool #

def gtk_hint_font_metrics? : Bool #

def gtk_icon_theme_name : String #

def gtk_icon_theme_name=(value : String) : String #

def gtk_im_module : String #

def gtk_im_module=(value : String) : String #

def gtk_keynav_use_caret=(value : Bool) : Bool #

def gtk_keynav_use_caret? : Bool #

def gtk_label_select_on_focus=(value : Bool) : Bool #

def gtk_label_select_on_focus? : Bool #

def gtk_long_press_time : UInt32 #

def gtk_long_press_time=(value : UInt32) : UInt32 #

def gtk_overlay_scrolling=(value : Bool) : Bool #

def gtk_overlay_scrolling? : Bool #

def gtk_primary_button_warps_slider=(value : Bool) : Bool #

def gtk_primary_button_warps_slider? : Bool #

def gtk_print_backends : String #

def gtk_print_backends=(value : String) : String #

def gtk_print_preview_command : String #

def gtk_print_preview_command=(value : String) : String #

def gtk_recent_files_enabled=(value : Bool) : Bool #

def gtk_recent_files_enabled? : Bool #

def gtk_recent_files_max_age : Int32 #

def gtk_recent_files_max_age=(value : Int32) : Int32 #

def gtk_shell_shows_app_menu=(value : Bool) : Bool #

def gtk_shell_shows_app_menu? : Bool #

def gtk_shell_shows_desktop=(value : Bool) : Bool #

def gtk_shell_shows_desktop? : Bool #

def gtk_shell_shows_menubar=(value : Bool) : Bool #

def gtk_shell_shows_menubar? : Bool #

def gtk_sound_theme_name : String #

def gtk_sound_theme_name=(value : String) : String #

def gtk_split_cursor=(value : Bool) : Bool #

def gtk_split_cursor? : Bool #

def gtk_theme_name : String #

def gtk_theme_name=(value : String) : String #

def gtk_titlebar_double_click : String #

def gtk_titlebar_double_click=(value : String) : String #

def gtk_titlebar_middle_click : String #

def gtk_titlebar_middle_click=(value : String) : String #

def gtk_titlebar_right_click : String #

def gtk_titlebar_right_click=(value : String) : String #

def gtk_xft_antialias : Int32 #

def gtk_xft_antialias=(value : Int32) : Int32 #

def gtk_xft_dpi : Int32 #

def gtk_xft_dpi=(value : Int32) : Int32 #

def gtk_xft_hinting : Int32 #

def gtk_xft_hinting=(value : Int32) : Int32 #

def gtk_xft_hintstyle : String #

def gtk_xft_hintstyle=(value : String) : String #

def gtk_xft_rgba : String #

def gtk_xft_rgba=(value : String) : String #

def reset_property(name : String) : Nil #

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.