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

Constructor methods inherited from module Gtk::StyleProvider

cast(obj : GObject::Object) : self cast

Class methods inherited from module Gtk::StyleProvider

cast?(obj : GObject::Object) : self | Nil cast?, g_type : UInt64 g_type

Instance methods inherited from class GObject::Object

==(other : self) ==, 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) | Nil data, finalize finalize, freeze_notify : Nil freeze_notify, getv(names : Enumerable(String), values : Enumerable(_)) : Nil getv, hash(hasher) hash, 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) | Nil qdata, ref_count : UInt32 ref_count, run_dispose : Nil run_dispose, set_data(key : String, data : Pointer(Void) | Nil) : Nil set_data, set_property(property_name : String, value : _) : Nil set_property, steal_data(key : String) : Pointer(Void) | Nil steal_data, steal_qdata(quark : UInt32) : Pointer(Void) | Nil 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, 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

cast?(obj : GObject::Object) : self | Nil cast?, compat_control(what : UInt64, data : Pointer(Void) | Nil) : 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.


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

[View source]

Class Method Detail

def self.default : Gtk::Settings | Nil #

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

See Gtk::Settings#for_display.


[View source]
def self.for_display(display : Gdk::Display) : Gtk::Settings #

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


[View source]
def self.g_type : UInt64 #

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


[View source]

Instance Method Detail

def ==(other : self) #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


def gtk_alternative_button_order=(value : Bool) : Bool #

[View source]
def gtk_alternative_button_order? : Bool #

[View source]
def gtk_alternative_sort_arrows=(value : Bool) : Bool #

[View source]
def gtk_alternative_sort_arrows? : Bool #

[View source]
def gtk_application_prefer_dark_theme=(value : Bool) : Bool #

[View source]
def gtk_application_prefer_dark_theme? : Bool #

[View source]
def gtk_cursor_aspect_ratio : Float64 #

[View source]
def gtk_cursor_aspect_ratio=(value : Float64) : Float64 #

[View source]
def gtk_cursor_blink=(value : Bool) : Bool #

[View source]
def gtk_cursor_blink? : Bool #

[View source]
def gtk_cursor_blink_time : Int32 #

[View source]
def gtk_cursor_blink_time=(value : Int32) : Int32 #

[View source]
def gtk_cursor_blink_timeout : Int32 #

[View source]
def gtk_cursor_blink_timeout=(value : Int32) : Int32 #

[View source]
def gtk_cursor_theme_name : String #

[View source]
def gtk_cursor_theme_name=(value : String) : String #

[View source]
def gtk_cursor_theme_size : Int32 #

[View source]
def gtk_cursor_theme_size=(value : Int32) : Int32 #

[View source]
def gtk_decoration_layout : String #

[View source]
def gtk_decoration_layout=(value : String) : String #

[View source]
def gtk_dialogs_use_header=(value : Bool) : Bool #

[View source]
def gtk_dialogs_use_header? : Bool #

[View source]
def gtk_dnd_drag_threshold : Int32 #

[View source]
def gtk_dnd_drag_threshold=(value : Int32) : Int32 #

[View source]
def gtk_double_click_distance : Int32 #

[View source]
def gtk_double_click_distance=(value : Int32) : Int32 #

[View source]
def gtk_double_click_time : Int32 #

[View source]
def gtk_double_click_time=(value : Int32) : Int32 #

[View source]
def gtk_enable_accels=(value : Bool) : Bool #

[View source]
def gtk_enable_accels? : Bool #

[View source]
def gtk_enable_animations=(value : Bool) : Bool #

[View source]
def gtk_enable_animations? : Bool #

[View source]
def gtk_enable_event_sounds=(value : Bool) : Bool #

[View source]
def gtk_enable_event_sounds? : Bool #

[View source]
def gtk_enable_input_feedback_sounds=(value : Bool) : Bool #

[View source]
def gtk_enable_input_feedback_sounds? : Bool #

[View source]
def gtk_enable_primary_paste=(value : Bool) : Bool #

[View source]
def gtk_enable_primary_paste? : Bool #

[View source]
def gtk_entry_password_hint_timeout : UInt32 #

[View source]
def gtk_entry_password_hint_timeout=(value : UInt32) : UInt32 #

[View source]
def gtk_entry_select_on_focus=(value : Bool) : Bool #

[View source]
def gtk_entry_select_on_focus? : Bool #

[View source]
def gtk_error_bell=(value : Bool) : Bool #

[View source]
def gtk_error_bell? : Bool #

[View source]
def gtk_font_name : String #

[View source]
def gtk_font_name=(value : String) : String #

[View source]
def gtk_fontconfig_timestamp : UInt32 #

[View source]
def gtk_fontconfig_timestamp=(value : UInt32) : UInt32 #

[View source]
def gtk_hint_font_metrics=(value : Bool) : Bool #

[View source]
def gtk_hint_font_metrics? : Bool #

[View source]
def gtk_icon_theme_name : String #

[View source]
def gtk_icon_theme_name=(value : String) : String #

[View source]
def gtk_im_module : String #

[View source]
def gtk_im_module=(value : String) : String #

[View source]
def gtk_keynav_use_caret=(value : Bool) : Bool #

[View source]
def gtk_keynav_use_caret? : Bool #

[View source]
def gtk_label_select_on_focus=(value : Bool) : Bool #

[View source]
def gtk_label_select_on_focus? : Bool #

[View source]
def gtk_long_press_time : UInt32 #

[View source]
def gtk_long_press_time=(value : UInt32) : UInt32 #

[View source]
def gtk_overlay_scrolling=(value : Bool) : Bool #

[View source]
def gtk_overlay_scrolling? : Bool #

[View source]
def gtk_primary_button_warps_slider=(value : Bool) : Bool #

[View source]
def gtk_primary_button_warps_slider? : Bool #

[View source]
def gtk_print_backends : String #

[View source]
def gtk_print_backends=(value : String) : String #

[View source]
def gtk_print_preview_command : String #

[View source]
def gtk_print_preview_command=(value : String) : String #

[View source]
def gtk_recent_files_enabled=(value : Bool) : Bool #

[View source]
def gtk_recent_files_enabled? : Bool #

[View source]
def gtk_recent_files_max_age : Int32 #

[View source]
def gtk_recent_files_max_age=(value : Int32) : Int32 #

[View source]
def gtk_shell_shows_app_menu=(value : Bool) : Bool #

[View source]
def gtk_shell_shows_app_menu? : Bool #

[View source]
def gtk_shell_shows_desktop=(value : Bool) : Bool #

[View source]
def gtk_shell_shows_desktop? : Bool #

[View source]
def gtk_shell_shows_menubar=(value : Bool) : Bool #

[View source]
def gtk_shell_shows_menubar? : Bool #

[View source]
def gtk_sound_theme_name : String #

[View source]
def gtk_sound_theme_name=(value : String) : String #

[View source]
def gtk_split_cursor=(value : Bool) : Bool #

[View source]
def gtk_split_cursor? : Bool #

[View source]
def gtk_theme_name : String #

[View source]
def gtk_theme_name=(value : String) : String #

[View source]
def gtk_titlebar_double_click : String #

[View source]
def gtk_titlebar_double_click=(value : String) : String #

[View source]
def gtk_titlebar_middle_click : String #

[View source]
def gtk_titlebar_middle_click=(value : String) : String #

[View source]
def gtk_titlebar_right_click : String #

[View source]
def gtk_titlebar_right_click=(value : String) : String #

[View source]
def gtk_xft_antialias : Int32 #

[View source]
def gtk_xft_antialias=(value : Int32) : Int32 #

[View source]
def gtk_xft_dpi : Int32 #

[View source]
def gtk_xft_dpi=(value : Int32) : Int32 #

[View source]
def gtk_xft_hinting : Int32 #

[View source]
def gtk_xft_hinting=(value : Int32) : Int32 #

[View source]
def gtk_xft_hintstyle : String #

[View source]
def gtk_xft_hintstyle=(value : String) : String #

[View source]
def gtk_xft_rgba : String #

[View source]
def gtk_xft_rgba=(value : String) : String #

[View source]
def hash(hasher) #
Description copied from class Reference

See Object#hash(hasher)


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.


[View source]