class Gtk::Settings
- Gtk::Settings
- GObject::Object
- Reference
- Object
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.crConstructors
-
.new
Initialize a new
Settings
. - .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)
Class Method Summary
-
.default : Gtk::Settings | Nil
Gets the
Gtk::Settings
object for the default display, creating it if necessary. -
.for_display(display : Gdk::Display) : Gtk::Settings
Gets the
Gtk::Settings
object for display, creating it if necessary. -
.g_type : UInt64
Returns the type id (GType) registered in GLib type system.
Instance Method Summary
-
#==(other : self)
Returns
true
if this reference is the same as other. - #gtk_alternative_button_order=(value : Bool) : Bool
- #gtk_alternative_button_order? : Bool
- #gtk_alternative_sort_arrows=(value : Bool) : Bool
- #gtk_alternative_sort_arrows? : Bool
- #gtk_application_prefer_dark_theme=(value : Bool) : Bool
- #gtk_application_prefer_dark_theme? : Bool
- #gtk_cursor_aspect_ratio : Float64
- #gtk_cursor_aspect_ratio=(value : Float64) : Float64
- #gtk_cursor_blink=(value : Bool) : Bool
- #gtk_cursor_blink? : Bool
- #gtk_cursor_blink_time : Int32
- #gtk_cursor_blink_time=(value : Int32) : Int32
- #gtk_cursor_blink_timeout : Int32
- #gtk_cursor_blink_timeout=(value : Int32) : Int32
- #gtk_cursor_theme_name : String
- #gtk_cursor_theme_name=(value : String) : String
-
#gtk_cursor_theme_name=(value : Nil) : Nil
Set
#gtk_cursor_theme_name
property to nil. -
#gtk_cursor_theme_name? : String | Nil
Same as
#gtk_cursor_theme_name
, but can return nil. - #gtk_cursor_theme_size : Int32
- #gtk_cursor_theme_size=(value : Int32) : Int32
- #gtk_decoration_layout : String
- #gtk_decoration_layout=(value : String) : String
-
#gtk_decoration_layout=(value : Nil) : Nil
Set
#gtk_decoration_layout
property to nil. -
#gtk_decoration_layout? : String | Nil
Same as
#gtk_decoration_layout
, but can return nil. - #gtk_dialogs_use_header=(value : Bool) : Bool
- #gtk_dialogs_use_header? : Bool
- #gtk_dnd_drag_threshold : Int32
- #gtk_dnd_drag_threshold=(value : Int32) : Int32
- #gtk_double_click_distance : Int32
- #gtk_double_click_distance=(value : Int32) : Int32
- #gtk_double_click_time : Int32
- #gtk_double_click_time=(value : Int32) : Int32
- #gtk_enable_accels=(value : Bool) : Bool
- #gtk_enable_accels? : Bool
- #gtk_enable_animations=(value : Bool) : Bool
- #gtk_enable_animations? : Bool
- #gtk_enable_event_sounds=(value : Bool) : Bool
- #gtk_enable_event_sounds? : Bool
- #gtk_enable_input_feedback_sounds=(value : Bool) : Bool
- #gtk_enable_input_feedback_sounds? : Bool
- #gtk_enable_primary_paste=(value : Bool) : Bool
- #gtk_enable_primary_paste? : Bool
- #gtk_entry_password_hint_timeout : UInt32
- #gtk_entry_password_hint_timeout=(value : UInt32) : UInt32
- #gtk_entry_select_on_focus=(value : Bool) : Bool
- #gtk_entry_select_on_focus? : Bool
- #gtk_error_bell=(value : Bool) : Bool
- #gtk_error_bell? : Bool
- #gtk_font_name : String
- #gtk_font_name=(value : String) : String
-
#gtk_font_name=(value : Nil) : Nil
Set
#gtk_font_name
property to nil. -
#gtk_font_name? : String | Nil
Same as
#gtk_font_name
, but can return nil. - #gtk_fontconfig_timestamp : UInt32
- #gtk_fontconfig_timestamp=(value : UInt32) : UInt32
- #gtk_hint_font_metrics=(value : Bool) : Bool
- #gtk_hint_font_metrics? : Bool
- #gtk_icon_theme_name : String
- #gtk_icon_theme_name=(value : String) : String
-
#gtk_icon_theme_name=(value : Nil) : Nil
Set
#gtk_icon_theme_name
property to nil. -
#gtk_icon_theme_name? : String | Nil
Same as
#gtk_icon_theme_name
, but can return nil. - #gtk_im_module : String
- #gtk_im_module=(value : String) : String
-
#gtk_im_module=(value : Nil) : Nil
Set
#gtk_im_module
property to nil. -
#gtk_im_module? : String | Nil
Same as
#gtk_im_module
, but can return nil. - #gtk_keynav_use_caret=(value : Bool) : Bool
- #gtk_keynav_use_caret? : Bool
- #gtk_label_select_on_focus=(value : Bool) : Bool
- #gtk_label_select_on_focus? : Bool
- #gtk_long_press_time : UInt32
- #gtk_long_press_time=(value : UInt32) : UInt32
- #gtk_overlay_scrolling=(value : Bool) : Bool
- #gtk_overlay_scrolling? : Bool
- #gtk_primary_button_warps_slider=(value : Bool) : Bool
- #gtk_primary_button_warps_slider? : Bool
- #gtk_print_backends : String
- #gtk_print_backends=(value : String) : String
-
#gtk_print_backends=(value : Nil) : Nil
Set
#gtk_print_backends
property to nil. -
#gtk_print_backends? : String | Nil
Same as
#gtk_print_backends
, but can return nil. - #gtk_print_preview_command : String
- #gtk_print_preview_command=(value : String) : String
-
#gtk_print_preview_command=(value : Nil) : Nil
Set
#gtk_print_preview_command
property to nil. -
#gtk_print_preview_command? : String | Nil
Same as
#gtk_print_preview_command
, but can return nil. - #gtk_recent_files_enabled=(value : Bool) : Bool
- #gtk_recent_files_enabled? : Bool
- #gtk_recent_files_max_age : Int32
- #gtk_recent_files_max_age=(value : Int32) : Int32
- #gtk_shell_shows_app_menu=(value : Bool) : Bool
- #gtk_shell_shows_app_menu? : Bool
- #gtk_shell_shows_desktop=(value : Bool) : Bool
- #gtk_shell_shows_desktop? : Bool
- #gtk_shell_shows_menubar=(value : Bool) : Bool
- #gtk_shell_shows_menubar? : Bool
- #gtk_sound_theme_name : String
- #gtk_sound_theme_name=(value : String) : String
-
#gtk_sound_theme_name=(value : Nil) : Nil
Set
#gtk_sound_theme_name
property to nil. -
#gtk_sound_theme_name? : String | Nil
Same as
#gtk_sound_theme_name
, but can return nil. - #gtk_split_cursor=(value : Bool) : Bool
- #gtk_split_cursor? : Bool
- #gtk_theme_name : String
- #gtk_theme_name=(value : String) : String
-
#gtk_theme_name=(value : Nil) : Nil
Set
#gtk_theme_name
property to nil. -
#gtk_theme_name? : String | Nil
Same as
#gtk_theme_name
, but can return nil. - #gtk_titlebar_double_click : String
- #gtk_titlebar_double_click=(value : String) : String
-
#gtk_titlebar_double_click=(value : Nil) : Nil
Set
#gtk_titlebar_double_click
property to nil. -
#gtk_titlebar_double_click? : String | Nil
Same as
#gtk_titlebar_double_click
, but can return nil. - #gtk_titlebar_middle_click : String
- #gtk_titlebar_middle_click=(value : String) : String
-
#gtk_titlebar_middle_click=(value : Nil) : Nil
Set
#gtk_titlebar_middle_click
property to nil. -
#gtk_titlebar_middle_click? : String | Nil
Same as
#gtk_titlebar_middle_click
, but can return nil. - #gtk_titlebar_right_click : String
- #gtk_titlebar_right_click=(value : String) : String
-
#gtk_titlebar_right_click=(value : Nil) : Nil
Set
#gtk_titlebar_right_click
property to nil. -
#gtk_titlebar_right_click? : String | Nil
Same as
#gtk_titlebar_right_click
, but can return nil. - #gtk_xft_antialias : Int32
- #gtk_xft_antialias=(value : Int32) : Int32
- #gtk_xft_dpi : Int32
- #gtk_xft_dpi=(value : Int32) : Int32
- #gtk_xft_hinting : Int32
- #gtk_xft_hinting=(value : Int32) : Int32
- #gtk_xft_hintstyle : String
- #gtk_xft_hintstyle=(value : String) : String
-
#gtk_xft_hintstyle=(value : Nil) : Nil
Set
#gtk_xft_hintstyle
property to nil. -
#gtk_xft_hintstyle? : String | Nil
Same as
#gtk_xft_hintstyle
, but can return nil. - #gtk_xft_rgba : String
- #gtk_xft_rgba=(value : String) : String
-
#gtk_xft_rgba=(value : Nil) : Nil
Set
#gtk_xft_rgba
property to nil. -
#gtk_xft_rgba? : String | Nil
Same as
#gtk_xft_rgba
, but can return nil. -
#hash(hasher)
See
Object#hash(hasher)
-
#reset_property(name : String) : Nil
Undoes the effect of calling g_object_set() to install an application-specific value for a setting.
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
Macros inherited from class GObject::Object
previous_vfunc(*args)
previous_vfunc,
previous_vfunc!(*args)
previous_vfunc!,
signal(signature)
signal
Constructor Detail
Class Method Detail
Gets the Gtk::Settings
object for the default display, creating
it if necessary.
Gets the Gtk::Settings
object for display, creating it if necessary.
Returns the type id (GType) registered in GLib type system.
Instance Method Detail
Returns true
if this reference is the same as other. Invokes same?
.
Same as #gtk_cursor_theme_name
, but can return nil.
Same as #gtk_decoration_layout
, but can return nil.
Same as #gtk_icon_theme_name
, but can return nil.
Same as #gtk_print_backends
, but can return nil.
Same as #gtk_print_preview_command
, but can return nil.
Same as #gtk_sound_theme_name
, but can return nil.
Same as #gtk_titlebar_double_click
, but can return nil.
Same as #gtk_titlebar_middle_click
, but can return nil.
Same as #gtk_titlebar_right_click
, but can return nil.
Same as #gtk_xft_hintstyle
, but can return 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.