pub struct SettingsBuilder { /* private fields */ }
Expand description
A builder-pattern type to construct Settings
objects.
Implementations§
Source§impl SettingsBuilder
impl SettingsBuilder
Whether buttons in dialogs should use the alternative button order.
Sourcepub fn gtk_alternative_sort_arrows(
self,
gtk_alternative_sort_arrows: bool,
) -> Self
pub fn gtk_alternative_sort_arrows( self, gtk_alternative_sort_arrows: bool, ) -> Self
Controls the direction of the sort indicators in sorted list and tree views.
By default an arrow pointing down means the column is sorted
in ascending order. When set to true
, this order will be inverted.
Sourcepub fn gtk_application_prefer_dark_theme(
self,
gtk_application_prefer_dark_theme: bool,
) -> Self
pub fn gtk_application_prefer_dark_theme( self, gtk_application_prefer_dark_theme: bool, ) -> Self
Whether the application prefers to use a dark theme.
If a GTK theme includes a dark variant, it will be used instead of the configured theme.
Some applications benefit from minimizing the amount of light pollution that interferes with the content. Good candidates for dark themes are photo and video editors that make the actual content get all the attention and minimize the distraction of the chrome.
Dark themes should not be used for documents, where large spaces are white/light and the dark chrome creates too much contrast (web browser, text editor…).
Sourcepub fn gtk_cursor_aspect_ratio(self, gtk_cursor_aspect_ratio: f64) -> Self
pub fn gtk_cursor_aspect_ratio(self, gtk_cursor_aspect_ratio: f64) -> Self
The aspect ratio of the text caret.
Sourcepub fn gtk_cursor_blink(self, gtk_cursor_blink: bool) -> Self
pub fn gtk_cursor_blink(self, gtk_cursor_blink: bool) -> Self
Whether the cursor should blink.
Also see the gtk-cursor-blink-timeout
setting,
which allows more flexible control over cursor blinking.
Sourcepub fn gtk_cursor_blink_time(self, gtk_cursor_blink_time: i32) -> Self
pub fn gtk_cursor_blink_time(self, gtk_cursor_blink_time: i32) -> Self
Length of the cursor blink cycle, in milliseconds.
Sourcepub fn gtk_cursor_blink_timeout(self, gtk_cursor_blink_timeout: i32) -> Self
pub fn gtk_cursor_blink_timeout(self, gtk_cursor_blink_timeout: i32) -> Self
Time after which the cursor stops blinking, in seconds.
The timer is reset after each user interaction.
Setting this to zero has the same effect as setting
gtk-cursor-blink
to false
.
Sourcepub fn gtk_cursor_theme_name(
self,
gtk_cursor_theme_name: impl Into<GString>,
) -> Self
pub fn gtk_cursor_theme_name( self, gtk_cursor_theme_name: impl Into<GString>, ) -> Self
Name of the cursor theme to use.
Use None
to use the default theme.
Sourcepub fn gtk_cursor_theme_size(self, gtk_cursor_theme_size: i32) -> Self
pub fn gtk_cursor_theme_size(self, gtk_cursor_theme_size: i32) -> Self
The size to use for cursors.
0 means to use the default size.
Sourcepub fn gtk_decoration_layout(
self,
gtk_decoration_layout: impl Into<GString>,
) -> Self
pub fn gtk_decoration_layout( self, gtk_decoration_layout: impl Into<GString>, ) -> Self
Determines which buttons should be put in the titlebar of client-side decorated windows, and whether they should be placed on the left or right.
The format of the string is button names, separated by commas. A colon separates the buttons that should appear on the left from those on the right. Recognized button names are minimize, maximize, close, icon (the window icon) and menu (a menu button for the fallback app menu).
For example, “menu:minimize,maximize,close” specifies a menu on the left, and minimize, maximize and close buttons on the right.
Note that buttons will only be shown when they are meaningful. E.g. a menu button only appears when the desktop shell does not show the app menu, and a close button only appears on a window that can be closed.
Also note that the setting can be overridden with the
decoration-layout
property.
Sourcepub fn gtk_dialogs_use_header(self, gtk_dialogs_use_header: bool) -> Self
pub fn gtk_dialogs_use_header(self, gtk_dialogs_use_header: bool) -> Self
Whether builtin GTK dialogs such as the file chooser, the color chooser or the font chooser will use a header bar at the top to show action widgets, or an action area at the bottom.
This setting does not affect custom dialogs using Dialog
directly, or message dialogs.
Sourcepub fn gtk_dnd_drag_threshold(self, gtk_dnd_drag_threshold: i32) -> Self
pub fn gtk_dnd_drag_threshold(self, gtk_dnd_drag_threshold: i32) -> Self
The number of pixels the cursor can move before dragging.
Sourcepub fn gtk_double_click_distance(self, gtk_double_click_distance: i32) -> Self
pub fn gtk_double_click_distance(self, gtk_double_click_distance: i32) -> Self
The maximum distance allowed between two clicks for them to be considered a double click, in pixels.
Sourcepub fn gtk_double_click_time(self, gtk_double_click_time: i32) -> Self
pub fn gtk_double_click_time(self, gtk_double_click_time: i32) -> Self
The maximum time to allow between two clicks for them to be considered a double click, in milliseconds.
Sourcepub fn gtk_enable_accels(self, gtk_enable_accels: bool) -> Self
pub fn gtk_enable_accels(self, gtk_enable_accels: bool) -> Self
Whether menu items should have visible accelerators which can be activated.
Sourcepub fn gtk_enable_animations(self, gtk_enable_animations: bool) -> Self
pub fn gtk_enable_animations(self, gtk_enable_animations: bool) -> Self
Whether to enable toolkit-wide animations.
Sourcepub fn gtk_enable_event_sounds(self, gtk_enable_event_sounds: bool) -> Self
pub fn gtk_enable_event_sounds(self, gtk_enable_event_sounds: bool) -> Self
Whether to play any event sounds at all.
See the Sound Theme Specifications for more information on event sounds and sound themes.
GTK itself does not support event sounds, you have to use a loadable module like the one that comes with libcanberra.
Sourcepub fn gtk_enable_input_feedback_sounds(
self,
gtk_enable_input_feedback_sounds: bool,
) -> Self
pub fn gtk_enable_input_feedback_sounds( self, gtk_enable_input_feedback_sounds: bool, ) -> Self
Whether to play event sounds as feedback to user input.
See the Sound Theme Specifications for more information on event sounds and sound themes.
GTK itself does not support event sounds, you have to use a loadable module like the one that comes with libcanberra.
Sourcepub fn gtk_enable_primary_paste(self, gtk_enable_primary_paste: bool) -> Self
pub fn gtk_enable_primary_paste(self, gtk_enable_primary_paste: bool) -> Self
Whether a middle click on a mouse should paste the ‘PRIMARY’ clipboard content at the cursor location.
Sourcepub fn gtk_entry_password_hint_timeout(
self,
gtk_entry_password_hint_timeout: u32,
) -> Self
pub fn gtk_entry_password_hint_timeout( self, gtk_entry_password_hint_timeout: u32, ) -> Self
How long to show the last input character in hidden entries.
This value is in milliseconds. 0 disables showing the last char. 600 is a good value for enabling it.
Sourcepub fn gtk_entry_select_on_focus(self, gtk_entry_select_on_focus: bool) -> Self
pub fn gtk_entry_select_on_focus(self, gtk_entry_select_on_focus: bool) -> Self
Whether to select the contents of an entry when it is focused.
Sourcepub fn gtk_error_bell(self, gtk_error_bell: bool) -> Self
pub fn gtk_error_bell(self, gtk_error_bell: bool) -> Self
When true
, keyboard navigation and other input-related errors
will cause a beep.
Since the error bell is implemented using gdk_surface_beep(), the windowing system may offer ways to configure the error bell in many ways, such as flashing the window or similar visual effects.
Sourcepub fn gtk_font_name(self, gtk_font_name: impl Into<GString>) -> Self
pub fn gtk_font_name(self, gtk_font_name: impl Into<GString>) -> Self
The default font to use.
GTK uses the family name and size from this string.
Sourcepub fn gtk_font_rendering(self, gtk_font_rendering: FontRendering) -> Self
Available on crate feature v4_16
only.
pub fn gtk_font_rendering(self, gtk_font_rendering: FontRendering) -> Self
v4_16
only.How GTK font rendering is set up.
When set to [enum@Gtk.FontRendering.MANUAL], GTK respects the low-level
font-related settings (gtk-hint-font-metrics
,
gtk-xft-antialias
, gtk-xft-hinting
,
gtk-xft-hintstyle
and gtk-xft-rgba
)
as much as practical.
When set to [enum@Gtk.FontRendering.AUTOMATIC], GTK will consider factors such as screen resolution and scale in deciding how to render fonts.
Sourcepub fn gtk_fontconfig_timestamp(self, gtk_fontconfig_timestamp: u32) -> Self
pub fn gtk_fontconfig_timestamp(self, gtk_fontconfig_timestamp: u32) -> Self
Timestamp of the current fontconfig configuration.
Sourcepub fn gtk_hint_font_metrics(self, gtk_hint_font_metrics: bool) -> Self
Available on crate feature v4_6
only.
pub fn gtk_hint_font_metrics(self, gtk_hint_font_metrics: bool) -> Self
v4_6
only.Whether hinting should be applied to font metrics.
Note that this also turns off subpixel positioning of glyphs, since it conflicts with metrics hinting.
Sourcepub fn gtk_icon_theme_name(
self,
gtk_icon_theme_name: impl Into<GString>,
) -> Self
pub fn gtk_icon_theme_name( self, gtk_icon_theme_name: impl Into<GString>, ) -> Self
Name of the icon theme to use.
See IconTheme
for details about how
GTK handles icon themes.
Sourcepub fn gtk_im_module(self, gtk_im_module: impl Into<GString>) -> Self
pub fn gtk_im_module(self, gtk_im_module: impl Into<GString>) -> Self
Which IM (input method) module should be used by default.
This is the input method that will be used if the user has not explicitly chosen another input method from the IM context menu. This also can be a colon-separated list of input methods, which GTK will try in turn until it finds one available on the system.
See IMContext
.
Whether GTK should make sure that text can be navigated with a caret, even if it is not editable.
This is useful when using a screen reader.
Sourcepub fn gtk_label_select_on_focus(self, gtk_label_select_on_focus: bool) -> Self
pub fn gtk_label_select_on_focus(self, gtk_label_select_on_focus: bool) -> Self
Whether to select the contents of a selectable label when it is focused.
Sourcepub fn gtk_long_press_time(self, gtk_long_press_time: u32) -> Self
pub fn gtk_long_press_time(self, gtk_long_press_time: u32) -> Self
The time for a button or touch press to be considered a “long press”.
See GestureLongPress
.
Sourcepub fn gtk_overlay_scrolling(self, gtk_overlay_scrolling: bool) -> Self
pub fn gtk_overlay_scrolling(self, gtk_overlay_scrolling: bool) -> Self
Whether scrolled windows may use overlaid scrolling indicators.
If this is set to false
, scrolled windows will have permanent
scrollbars.
If the value of this setting is true
, clicking the primary button in a
Range
trough will move the slider, and hence set the range’s value, to
the point that you clicked.
If it is false
, a primary click will cause the slider/value to move
by the range’s page-size towards the point clicked.
Whichever action you choose for the primary button, the other action will be available by holding Shift and primary-clicking, or clicking the middle mouse button.
Sourcepub fn gtk_print_backends(self, gtk_print_backends: impl Into<GString>) -> Self
pub fn gtk_print_backends(self, gtk_print_backends: impl Into<GString>) -> Self
A comma-separated list of print backends to use in the print dialog.
Available print backends depend on the GTK installation, and may include “file”, “cups”, “lpr” or “papi”.
Sourcepub fn gtk_print_preview_command(
self,
gtk_print_preview_command: impl Into<GString>,
) -> Self
pub fn gtk_print_preview_command( self, gtk_print_preview_command: impl Into<GString>, ) -> Self
A command to run for displaying the print preview.
The command should contain a f
placeholder, which will get
replaced by the path to the pdf file. The command may also
contain a s
placeholder, which will get replaced by the
path to a file containing the print settings in the format
produced by PrintSettings::to_file()
.
The preview application is responsible for removing the pdf file and the print settings file when it is done.
Sourcepub fn gtk_recent_files_enabled(self, gtk_recent_files_enabled: bool) -> Self
pub fn gtk_recent_files_enabled(self, gtk_recent_files_enabled: bool) -> Self
Whether GTK should keep track of items inside the recently used resources list.
If set to false
, the list will always be empty.
Sourcepub fn gtk_recent_files_max_age(self, gtk_recent_files_max_age: i32) -> Self
pub fn gtk_recent_files_max_age(self, gtk_recent_files_max_age: i32) -> Self
The maximum age, in days, of the items inside the recently used resources list.
Items older than this setting will be excised from the list. If set to 0, the list will always be empty; if set to -1, no item will be removed.
Sourcepub fn gtk_shell_shows_desktop(self, gtk_shell_shows_desktop: bool) -> Self
pub fn gtk_shell_shows_desktop(self, gtk_shell_shows_desktop: bool) -> Self
Sourcepub fn gtk_show_status_shapes(self, gtk_show_status_shapes: bool) -> Self
Available on crate feature v4_14
only.
pub fn gtk_show_status_shapes(self, gtk_show_status_shapes: bool) -> Self
v4_14
only.When true
, widgets like switches include shapes to indicate their on/off state.
Sourcepub fn gtk_sound_theme_name(
self,
gtk_sound_theme_name: impl Into<GString>,
) -> Self
pub fn gtk_sound_theme_name( self, gtk_sound_theme_name: impl Into<GString>, ) -> Self
The XDG sound theme to use for event sounds.
See the Sound Theme Specifications for more information on event sounds and sound themes.
GTK itself does not support event sounds, you have to use a loadable module like the one that comes with libcanberra.
Sourcepub fn gtk_split_cursor(self, gtk_split_cursor: bool) -> Self
pub fn gtk_split_cursor(self, gtk_split_cursor: bool) -> Self
Whether two cursors should be displayed for mixed left-to-right and right-to-left text.
Sourcepub fn gtk_theme_name(self, gtk_theme_name: impl Into<GString>) -> Self
pub fn gtk_theme_name(self, gtk_theme_name: impl Into<GString>) -> Self
Name of the theme to load.
See CssProvider
for details about how
GTK finds the CSS stylesheet for a theme.
Sourcepub fn gtk_titlebar_double_click(
self,
gtk_titlebar_double_click: impl Into<GString>,
) -> Self
pub fn gtk_titlebar_double_click( self, gtk_titlebar_double_click: impl Into<GString>, ) -> Self
Determines the action to take when a double-click occurs on the titlebar of client-side decorated windows.
Recognized actions are minimize, toggle-maximize, menu, lower or none.
Sourcepub fn gtk_titlebar_middle_click(
self,
gtk_titlebar_middle_click: impl Into<GString>,
) -> Self
pub fn gtk_titlebar_middle_click( self, gtk_titlebar_middle_click: impl Into<GString>, ) -> Self
Determines the action to take when a middle-click occurs on the titlebar of client-side decorated windows.
Recognized actions are minimize, toggle-maximize, menu, lower or none.
Sourcepub fn gtk_titlebar_right_click(
self,
gtk_titlebar_right_click: impl Into<GString>,
) -> Self
pub fn gtk_titlebar_right_click( self, gtk_titlebar_right_click: impl Into<GString>, ) -> Self
Determines the action to take when a right-click occurs on the titlebar of client-side decorated windows.
Recognized actions are minimize, toggle-maximize, menu, lower or none.
Sourcepub fn gtk_xft_antialias(self, gtk_xft_antialias: i32) -> Self
pub fn gtk_xft_antialias(self, gtk_xft_antialias: i32) -> Self
Whether to antialias fonts.
The values are 0 for no, 1 for yes, or -1 for the system default.
Sourcepub fn gtk_xft_dpi(self, gtk_xft_dpi: i32) -> Self
pub fn gtk_xft_dpi(self, gtk_xft_dpi: i32) -> Self
The font resolution, in 1024 * dots/inch.
-1 to use the default value.
Sourcepub fn gtk_xft_hinting(self, gtk_xft_hinting: i32) -> Self
pub fn gtk_xft_hinting(self, gtk_xft_hinting: i32) -> Self
Whether to enable font hinting.
The values are 0 for no, 1 for yes, or -1 for the system default.
Sourcepub fn gtk_xft_hintstyle(self, gtk_xft_hintstyle: impl Into<GString>) -> Self
pub fn gtk_xft_hintstyle(self, gtk_xft_hintstyle: impl Into<GString>) -> Self
What degree of font hinting to use.
The possible vaues are hintnone, hintslight, hintmedium, hintfull.
Sourcepub fn gtk_xft_rgba(self, gtk_xft_rgba: impl Into<GString>) -> Self
pub fn gtk_xft_rgba(self, gtk_xft_rgba: impl Into<GString>) -> Self
The type of subpixel antialiasing to use.
The possible values are none, rgb, bgr, vrgb, vbgr.
Note that GSK does not support subpixel antialiasing, and this setting has no effect on font rendering in GTK.