Gtk.Settings
const Gtk = imports.gi.Gtk;
let settings = new Gtk.Settings({
gtk_alternative_button_order: value,
gtk_alternative_sort_arrows: value,
gtk_application_prefer_dark_theme: value,
gtk_auto_mnemonics: value,
gtk_button_images: value,
gtk_can_change_accels: value,
gtk_color_palette: value,
gtk_color_scheme: value,
gtk_cursor_blink: value,
gtk_cursor_blink_time: value,
gtk_cursor_blink_timeout: value,
gtk_cursor_theme_name: value,
gtk_cursor_theme_size: value,
gtk_dnd_drag_threshold: value,
gtk_double_click_distance: value,
gtk_double_click_time: value,
gtk_enable_accels: value,
gtk_enable_animations: value,
gtk_enable_event_sounds: value,
gtk_enable_input_feedback_sounds: value,
gtk_enable_mnemonics: value,
gtk_enable_primary_paste: value,
gtk_enable_tooltips: value,
gtk_entry_password_hint_timeout: value,
gtk_entry_select_on_focus: value,
gtk_error_bell: value,
gtk_fallback_icon_theme: value,
gtk_file_chooser_backend: value,
gtk_font_name: value,
gtk_fontconfig_timestamp: value,
gtk_icon_sizes: value,
gtk_icon_theme_name: value,
gtk_im_module: value,
gtk_im_preedit_style: value,
gtk_im_status_style: value,
gtk_key_theme_name: value,
gtk_keynav_cursor_only: value,
gtk_keynav_wrap_around: value,
gtk_label_select_on_focus: value,
gtk_menu_bar_accel: value,
gtk_menu_bar_popup_delay: value,
gtk_menu_images: value,
gtk_menu_popdown_delay: value,
gtk_menu_popup_delay: value,
gtk_modules: value,
gtk_primary_button_warps_slider: value,
gtk_print_backends: value,
gtk_print_preview_command: value,
gtk_recent_files_enabled: value,
gtk_recent_files_limit: value,
gtk_recent_files_max_age: value,
gtk_scrolled_window_placement: value,
gtk_shell_shows_app_menu: value,
gtk_shell_shows_menubar: value,
gtk_show_input_method_menu: value,
gtk_show_unicode_menu: value,
gtk_sound_theme_name: value,
gtk_split_cursor: value,
gtk_theme_name: value,
gtk_timeout_expand: value,
gtk_timeout_initial: value,
gtk_timeout_repeat: value,
gtk_toolbar_icon_size: value,
gtk_toolbar_style: value,
gtk_tooltip_browse_mode_timeout: value,
gtk_tooltip_browse_timeout: value,
gtk_tooltip_timeout: value,
gtk_touchscreen_mode: value,
gtk_visible_focus: value,
gtk_xft_antialias: value,
gtk_xft_dpi: value,
gtk_xft_hinting: value,
gtk_xft_hintstyle: value,
gtk_xft_rgba: value,
});
GtkSettings provide a mechanism to share global settings between applications.
On the X window system, this sharing is realized by an <ulink url="http://www.freedesktop.org/wiki/Specifications/xsettings-spec">XSettings</ulink> manager that is usually part of the desktop environment, along with utilities that let the user change these settings. In the absence of an Xsettings manager, GTK+ reads default values for settings from <filename>settings.ini</filename> files in <filename>/etc/gtk-3.0</filename>, <filename>$XDG_CONFIG_DIRS/gtk-3.0</filename> and <filename>$XDG_CONFIG_HOME/gtk-3.0</filename>. These files must be valid key files (see GLib.KeyFile), and have a section called Settings. Themes can also provide default values for settings by installing a <filename>settings.ini</filename> file next to their <filename>gtk.css</filename> file.
Applications can override system-wide settings with Gtk.set_string_property, Gtk.set_long_property, etc. This should be restricted to special cases though; GtkSettings are not meant as an application configuration facility. When doing so, you need to be aware that settings that are specific to individual widgets may not be available before the widget type has been realized at least once. The following example demonstrates a way to do this: <informalexample><programlisting> gtk_init (&argc, &argv);
/* make sure the type is realized */ g_type_class_unref (g_type_class_ref (GTK_TYPE_IMAGE_MENU_ITEM));
g_object_set (gtk_settings_get_default (), "gtk-menu-images", FALSE, NULL); </programlisting></informalexample>
There is one GtkSettings instance per screen. It can be obtained with Gtk.get_for_screen, but in many cases, it is more convenient to use Gtk.get_settings. Gtk.get_default returns the GtkSettings instance for the default screen.
Hierarchy
-
GObject.Object
- Gtk.Settings
Properties
- color-hash
- gtk-alternative-button-order
- gtk-alternative-sort-arrows
- gtk-application-prefer-dark-theme
- gtk-auto-mnemonics
- gtk-button-images
- gtk-can-change-accels
- gtk-color-palette
- gtk-color-scheme
- gtk-cursor-blink
- gtk-cursor-blink-time
- gtk-cursor-blink-timeout
- gtk-cursor-theme-name
- gtk-cursor-theme-size
- gtk-dnd-drag-threshold
- gtk-double-click-distance
- gtk-double-click-time
- gtk-enable-accels
- gtk-enable-animations
- gtk-enable-event-sounds
- gtk-enable-input-feedback-sounds
- gtk-enable-mnemonics
- gtk-enable-primary-paste
- gtk-enable-tooltips
- gtk-entry-password-hint-timeout
- gtk-entry-select-on-focus
- gtk-error-bell
- gtk-fallback-icon-theme
- gtk-file-chooser-backend
- gtk-font-name
- gtk-fontconfig-timestamp
- gtk-icon-sizes
- gtk-icon-theme-name
- gtk-im-module
- gtk-im-preedit-style
- gtk-im-status-style
- gtk-key-theme-name
- gtk-keynav-cursor-only
- gtk-keynav-wrap-around
- gtk-label-select-on-focus
- gtk-menu-bar-accel
- gtk-menu-bar-popup-delay
- gtk-menu-images
- gtk-menu-popdown-delay
- gtk-menu-popup-delay
- gtk-modules
- gtk-primary-button-warps-slider
- gtk-print-backends
- gtk-print-preview-command
- gtk-recent-files-enabled
- gtk-recent-files-limit
- gtk-recent-files-max-age
- gtk-scrolled-window-placement
- gtk-shell-shows-app-menu
- gtk-shell-shows-menubar
- gtk-show-input-method-menu
- gtk-show-unicode-menu
- gtk-sound-theme-name
- gtk-split-cursor
- gtk-theme-name
- gtk-timeout-expand
- gtk-timeout-initial
- gtk-timeout-repeat
- gtk-toolbar-icon-size
- gtk-toolbar-style
- gtk-tooltip-browse-mode-timeout
- gtk-tooltip-browse-timeout
- gtk-tooltip-timeout
- gtk-touchscreen-mode
- gtk-visible-focus
- gtk-xft-antialias
- gtk-xft-dpi
- gtk-xft-hinting
- gtk-xft-hintstyle
- gtk-xft-rgba