gtk4/auto/settings.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5#[cfg(feature = "v4_16")]
6#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
7use crate::FontRendering;
8use crate::{ffi, StyleProvider};
9#[cfg(feature = "v4_20")]
10#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
11use crate::{InterfaceColorScheme, InterfaceContrast};
12use glib::{
13 prelude::*,
14 signal::{connect_raw, SignalHandlerId},
15 translate::*,
16};
17use std::boxed::Box as Box_;
18
19glib::wrapper! {
20 /// Provides a mechanism to share global settings between applications.
21 ///
22 /// On the X window system, this sharing is realized by an
23 /// [XSettings](http://www.freedesktop.org/wiki/Specifications/xsettings-spec)
24 /// manager that is usually part of the desktop environment, along with
25 /// utilities that let the user change these settings.
26 ///
27 /// On Wayland, the settings are obtained either via a settings portal,
28 /// or by reading desktop settings from `Gio::Settings`.
29 ///
30 /// On macOS, the settings are obtained from `NSUserDefaults`.
31 ///
32 /// In the absence of these sharing mechanisms, GTK reads default values for
33 /// settings from `settings.ini` files in `/etc/gtk-4.0`, `$XDG_CONFIG_DIRS/gtk-4.0`
34 /// and `$XDG_CONFIG_HOME/gtk-4.0`. These files must be valid key files (see
35 /// `GKeyFile`), and have a section called Settings. Themes can also provide
36 /// default values for settings by installing a `settings.ini` file
37 /// next to their `gtk.css` file.
38 ///
39 /// Applications can override system-wide settings by setting the property
40 /// of the [`Settings`][crate::Settings] object with g_object_set(). This should be restricted
41 /// to special cases though; [`Settings`][crate::Settings] are not meant as an application
42 /// configuration facility.
43 ///
44 /// There is one [`Settings`][crate::Settings] instance per display. It can be obtained with
45 /// [`for_display()`][Self::for_display()], but in many cases, it is more
46 /// convenient to use [`WidgetExt::settings()`][crate::prelude::WidgetExt::settings()].
47 ///
48 /// ## Properties
49 ///
50 ///
51 /// #### `gtk-alternative-button-order`
52 /// Whether buttons in dialogs should use the alternative button order.
53 ///
54 /// Readable | Writeable
55 ///
56 ///
57 /// #### `gtk-alternative-sort-arrows`
58 /// Controls the direction of the sort indicators in sorted list and tree
59 /// views.
60 ///
61 /// By default an arrow pointing down means the column is sorted
62 /// in ascending order. When set to [`true`], this order will be inverted.
63 ///
64 /// Readable | Writeable
65 ///
66 ///
67 /// #### `gtk-application-prefer-dark-theme`
68 /// Whether the application prefers to use a dark theme.
69 ///
70 /// If a GTK theme includes a dark variant, it will be used
71 /// instead of the configured theme.
72 ///
73 /// Some applications benefit from minimizing the amount of light
74 /// pollution that interferes with the content. Good candidates for
75 /// dark themes are photo and video editors that make the actual
76 /// content get all the attention and minimize the distraction of
77 /// the chrome.
78 ///
79 /// Dark themes should not be used for documents, where large spaces
80 /// are white/light and the dark chrome creates too much contrast
81 /// (web browser, text editor...).
82 ///
83 /// Readable | Writeable
84 ///
85 ///
86 /// #### `gtk-cursor-aspect-ratio`
87 /// The aspect ratio of the text caret.
88 ///
89 /// Readable | Writeable
90 ///
91 ///
92 /// #### `gtk-cursor-blink`
93 /// Whether the cursor should blink.
94 ///
95 /// Also see the [`gtk-cursor-blink-timeout`][struct@crate::Settings#gtk-cursor-blink-timeout] setting,
96 /// which allows more flexible control over cursor blinking.
97 ///
98 /// Readable | Writeable
99 ///
100 ///
101 /// #### `gtk-cursor-blink-time`
102 /// Length of the cursor blink cycle, in milliseconds.
103 ///
104 /// Readable | Writeable
105 ///
106 ///
107 /// #### `gtk-cursor-blink-timeout`
108 /// Time after which the cursor stops blinking, in seconds.
109 ///
110 /// The timer is reset after each user interaction.
111 ///
112 /// Setting this to zero has the same effect as setting
113 /// [`gtk-cursor-blink`][struct@crate::Settings#gtk-cursor-blink] to [`false`].
114 ///
115 /// Readable | Writeable
116 ///
117 ///
118 /// #### `gtk-cursor-theme-name`
119 /// Name of the cursor theme to use.
120 ///
121 /// Use [`None`] to use the default theme.
122 ///
123 /// Readable | Writeable
124 ///
125 ///
126 /// #### `gtk-cursor-theme-size`
127 /// The size to use for cursors.
128 ///
129 /// 0 means to use the default size.
130 ///
131 /// Readable | Writeable
132 ///
133 ///
134 /// #### `gtk-decoration-layout`
135 /// Determines which buttons should be put in the
136 /// titlebar of client-side decorated windows, and whether they
137 /// should be placed on the left or right.
138 ///
139 /// The format of the string is button names, separated by commas.
140 /// A colon separates the buttons that should appear on the left
141 /// from those on the right. Recognized button names are minimize,
142 /// maximize, close, icon (the window icon) and menu (a menu button
143 /// for the fallback app menu).
144 ///
145 /// For example, "menu:minimize,maximize,close" specifies a menu
146 /// on the left, and minimize, maximize and close buttons on the right.
147 ///
148 /// Note that buttons will only be shown when they are meaningful.
149 /// E.g. a menu button only appears when the desktop shell does not
150 /// show the app menu, and a close button only appears on a window
151 /// that can be closed.
152 ///
153 /// Also note that the setting can be overridden with the
154 /// [`decoration-layout`][struct@crate::HeaderBar#decoration-layout] property.
155 ///
156 /// Readable | Writeable
157 ///
158 ///
159 /// #### `gtk-dialogs-use-header`
160 /// Whether builtin GTK dialogs such as the file chooser, the
161 /// color chooser or the font chooser will use a header bar at
162 /// the top to show action widgets, or an action area at the bottom.
163 ///
164 /// This setting does not affect custom dialogs using [`Dialog`][crate::Dialog]
165 /// directly, or message dialogs.
166 ///
167 /// Readable | Writeable
168 ///
169 ///
170 /// #### `gtk-dnd-drag-threshold`
171 /// The number of pixels the cursor can move before dragging.
172 ///
173 /// Readable | Writeable
174 ///
175 ///
176 /// #### `gtk-double-click-distance`
177 /// The maximum distance allowed between two clicks for them to be considered
178 /// a double click, in pixels.
179 ///
180 /// Readable | Writeable
181 ///
182 ///
183 /// #### `gtk-double-click-time`
184 /// The maximum time to allow between two clicks for them to be considered
185 /// a double click, in milliseconds.
186 ///
187 /// Readable | Writeable
188 ///
189 ///
190 /// #### `gtk-enable-accels`
191 /// Whether menu items should have visible accelerators which can be
192 /// activated.
193 ///
194 /// Readable | Writeable
195 ///
196 ///
197 /// #### `gtk-enable-animations`
198 /// Whether to enable toolkit-wide animations.
199 ///
200 /// Readable | Writeable
201 ///
202 ///
203 /// #### `gtk-enable-event-sounds`
204 /// Whether to play any event sounds at all.
205 ///
206 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
207 /// for more information on event sounds and sound themes.
208 ///
209 /// GTK itself does not support event sounds, you have to use a loadable
210 /// module like the one that comes with libcanberra.
211 ///
212 /// Readable | Writeable
213 ///
214 ///
215 /// #### `gtk-enable-input-feedback-sounds`
216 /// Whether to play event sounds as feedback to user input.
217 ///
218 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
219 /// for more information on event sounds and sound themes.
220 ///
221 /// GTK itself does not support event sounds, you have to use a loadable
222 /// module like the one that comes with libcanberra.
223 ///
224 /// Readable | Writeable
225 ///
226 ///
227 /// #### `gtk-enable-primary-paste`
228 /// Whether a middle click on a mouse should paste the
229 /// 'PRIMARY' clipboard content at the cursor location.
230 ///
231 /// Readable | Writeable
232 ///
233 ///
234 /// #### `gtk-entry-password-hint-timeout`
235 /// How long to show the last input character in hidden
236 /// entries.
237 ///
238 /// This value is in milliseconds. 0 disables showing the
239 /// last char. 600 is a good value for enabling it.
240 ///
241 /// Readable | Writeable
242 ///
243 ///
244 /// #### `gtk-entry-select-on-focus`
245 /// Whether to select the contents of an entry when it is focused.
246 ///
247 /// Readable | Writeable
248 ///
249 ///
250 /// #### `gtk-error-bell`
251 /// When [`true`], keyboard navigation and other input-related errors
252 /// will cause a beep.
253 ///
254 /// Since the error bell is implemented using gdk_surface_beep(), the
255 /// windowing system may offer ways to configure the error bell in many
256 /// ways, such as flashing the window or similar visual effects.
257 ///
258 /// Readable | Writeable
259 ///
260 ///
261 /// #### `gtk-font-name`
262 /// The default font to use.
263 ///
264 /// GTK uses the family name and size from this string.
265 ///
266 /// Readable | Writeable
267 ///
268 ///
269 /// #### `gtk-font-rendering`
270 /// How GTK font rendering is set up.
271 ///
272 /// When set to [enum@Gtk.FontRendering.MANUAL], GTK respects the low-level
273 /// font-related settings ([`gtk-hint-font-metrics`][struct@crate::Settings#gtk-hint-font-metrics],
274 /// [`gtk-xft-antialias`][struct@crate::Settings#gtk-xft-antialias], [`gtk-xft-hinting`][struct@crate::Settings#gtk-xft-hinting],
275 /// [`gtk-xft-hintstyle`][struct@crate::Settings#gtk-xft-hintstyle] and [`gtk-xft-rgba`][struct@crate::Settings#gtk-xft-rgba])
276 /// as much as practical.
277 ///
278 /// When set to [enum@Gtk.FontRendering.AUTOMATIC], GTK will consider factors such
279 /// as screen resolution and scale in deciding how to render fonts.
280 ///
281 /// Readable | Writeable
282 ///
283 ///
284 /// #### `gtk-fontconfig-timestamp`
285 /// Timestamp of the current fontconfig configuration.
286 ///
287 /// Readable | Writeable
288 ///
289 ///
290 /// #### `gtk-hint-font-metrics`
291 /// Whether hinting should be applied to font metrics.
292 ///
293 /// Note that this also turns off subpixel positioning of glyphs,
294 /// since it conflicts with metrics hinting.
295 ///
296 /// Readable | Writeable
297 ///
298 ///
299 /// #### `gtk-icon-theme-name`
300 /// Name of the icon theme to use.
301 ///
302 /// See [`IconTheme`][crate::IconTheme] for details about how
303 /// GTK handles icon themes.
304 ///
305 /// Readable | Writeable
306 ///
307 ///
308 /// #### `gtk-im-module`
309 /// Which IM (input method) module should be used by default.
310 ///
311 /// This is the input method that will be used if the user has not
312 /// explicitly chosen another input method from the IM context menu.
313 /// This also can be a colon-separated list of input methods, which GTK
314 /// will try in turn until it finds one available on the system.
315 ///
316 /// See [`IMContext`][crate::IMContext].
317 ///
318 /// Readable | Writeable
319 ///
320 ///
321 /// #### `gtk-interface-color-scheme`
322 /// The color scheme used for rendering the user interface.
323 ///
324 /// This setting communicates the system-wide preference.
325 /// The color scheme that is actually used when applying CSS
326 /// styles can be set with the [`prefers-color-scheme`][struct@crate::CssProvider#prefers-color-scheme]
327 /// property.
328 ///
329 /// Readable | Writeable
330 ///
331 ///
332 /// #### `gtk-interface-contrast`
333 /// The level of contrast to use for the user interface.
334 ///
335 /// This setting communicates the system-wide preference.
336 /// The contrast level that is actually used when applying CSS
337 /// styles can be set with the [`prefers-contrast`][struct@crate::CssProvider#prefers-contrast]
338 /// property.
339 ///
340 /// Readable | Writeable
341 ///
342 ///
343 /// #### `gtk-keynav-use-caret`
344 /// Whether GTK should make sure that text can be navigated with
345 /// a caret, even if it is not editable.
346 ///
347 /// This is useful when using a screen reader.
348 ///
349 /// Readable | Writeable
350 ///
351 ///
352 /// #### `gtk-label-select-on-focus`
353 /// Whether to select the contents of a selectable
354 /// label when it is focused.
355 ///
356 /// Readable | Writeable
357 ///
358 ///
359 /// #### `gtk-long-press-time`
360 /// The time for a button or touch press to be considered a “long press”.
361 ///
362 /// See [`GestureLongPress`][crate::GestureLongPress].
363 ///
364 /// Readable | Writeable
365 ///
366 ///
367 /// #### `gtk-overlay-scrolling`
368 /// Whether scrolled windows may use overlaid scrolling indicators.
369 ///
370 /// If this is set to [`false`], scrolled windows will have permanent
371 /// scrollbars.
372 ///
373 /// Readable | Writeable
374 ///
375 ///
376 /// #### `gtk-primary-button-warps-slider`
377 /// If the value of this setting is [`true`], clicking the primary button in a
378 /// [`Range`][crate::Range] trough will move the slider, and hence set the range’s value, to
379 /// the point that you clicked.
380 ///
381 /// If it is [`false`], a primary click will cause the slider/value to move
382 /// by the range’s page-size towards the point clicked.
383 ///
384 /// Whichever action you choose for the primary button, the other action will
385 /// be available by holding Shift and primary-clicking, or clicking the middle
386 /// mouse button.
387 ///
388 /// Readable | Writeable
389 ///
390 ///
391 /// #### `gtk-print-backends`
392 /// A comma-separated list of print backends to use in the print
393 /// dialog.
394 ///
395 /// Available print backends depend on the GTK installation,
396 /// and may include "file", "cups", "lpr" or "papi".
397 ///
398 /// Readable | Writeable
399 ///
400 ///
401 /// #### `gtk-print-preview-command`
402 /// A command to run for displaying the print preview.
403 ///
404 /// The command should contain a ``f`` placeholder, which will get
405 /// replaced by the path to the pdf file. The command may also
406 /// contain a ``s`` placeholder, which will get replaced by the
407 /// path to a file containing the print settings in the format
408 /// produced by [`PrintSettings::to_file()`][crate::PrintSettings::to_file()].
409 ///
410 /// The preview application is responsible for removing the pdf
411 /// file and the print settings file when it is done.
412 ///
413 /// Readable | Writeable
414 ///
415 ///
416 /// #### `gtk-recent-files-enabled`
417 /// Whether GTK should keep track of items inside the recently used
418 /// resources list.
419 ///
420 /// If set to [`false`], the list will always be empty.
421 ///
422 /// Readable | Writeable
423 ///
424 ///
425 /// #### `gtk-recent-files-max-age`
426 /// The maximum age, in days, of the items inside the recently used
427 /// resources list.
428 ///
429 /// Items older than this setting will be excised from the list.
430 /// If set to 0, the list will always be empty; if set to -1, no
431 /// item will be removed.
432 ///
433 /// Readable | Writeable
434 ///
435 ///
436 /// #### `gtk-shell-shows-app-menu`
437 /// Set to [`true`] if the desktop environment is displaying
438 /// the app menu, [`false`] if the app should display it itself.
439 ///
440 /// Readable | Writeable
441 ///
442 ///
443 /// #### `gtk-shell-shows-desktop`
444 /// Set to [`true`] if the desktop environment is displaying
445 /// the desktop folder, [`false`] if not.
446 ///
447 /// Readable | Writeable
448 ///
449 ///
450 /// #### `gtk-shell-shows-menubar`
451 /// Set to [`true`] if the desktop environment is displaying
452 /// the menubar, [`false`] if the app should display it itself.
453 ///
454 /// Readable | Writeable
455 ///
456 ///
457 /// #### `gtk-show-status-shapes`
458 /// When [`true`], widgets like switches include shapes to indicate their on/off state.
459 ///
460 /// Readable | Writeable
461 ///
462 ///
463 /// #### `gtk-sound-theme-name`
464 /// The XDG sound theme to use for event sounds.
465 ///
466 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
467 /// for more information on event sounds and sound themes.
468 ///
469 /// GTK itself does not support event sounds, you have to use
470 /// a loadable module like the one that comes with libcanberra.
471 ///
472 /// Readable | Writeable
473 ///
474 ///
475 /// #### `gtk-split-cursor`
476 /// Whether two cursors should be displayed for mixed left-to-right and
477 /// right-to-left text.
478 ///
479 /// Readable | Writeable
480 ///
481 ///
482 /// #### `gtk-theme-name`
483 /// Name of the theme to load.
484 ///
485 /// See [`CssProvider`][crate::CssProvider] for details about how
486 /// GTK finds the CSS stylesheet for a theme.
487 ///
488 /// Readable | Writeable
489 ///
490 ///
491 /// #### `gtk-titlebar-double-click`
492 /// Determines the action to take when a double-click
493 /// occurs on the titlebar of client-side decorated windows.
494 ///
495 /// Recognized actions are minimize, toggle-maximize, menu, lower
496 /// or none.
497 ///
498 /// Readable | Writeable
499 ///
500 ///
501 /// #### `gtk-titlebar-middle-click`
502 /// Determines the action to take when a middle-click
503 /// occurs on the titlebar of client-side decorated windows.
504 ///
505 /// Recognized actions are minimize, toggle-maximize, menu, lower
506 /// or none.
507 ///
508 /// Readable | Writeable
509 ///
510 ///
511 /// #### `gtk-titlebar-right-click`
512 /// Determines the action to take when a right-click
513 /// occurs on the titlebar of client-side decorated windows.
514 ///
515 /// Recognized actions are minimize, toggle-maximize, menu, lower
516 /// or none.
517 ///
518 /// Readable | Writeable
519 ///
520 ///
521 /// #### `gtk-xft-antialias`
522 /// Whether to antialias fonts.
523 ///
524 /// The values are 0 for no, 1 for yes, or -1 for the system default.
525 ///
526 /// Readable | Writeable
527 ///
528 ///
529 /// #### `gtk-xft-dpi`
530 /// The font resolution, in 1024 * dots/inch.
531 ///
532 /// -1 to use the default value.
533 ///
534 /// Readable | Writeable
535 ///
536 ///
537 /// #### `gtk-xft-hinting`
538 /// Whether to enable font hinting.
539 ///
540 /// The values are 0 for no, 1 for yes, or -1 for the system default.
541 ///
542 /// Readable | Writeable
543 ///
544 ///
545 /// #### `gtk-xft-hintstyle`
546 /// What degree of font hinting to use.
547 ///
548 /// The possible vaues are hintnone, hintslight,
549 /// hintmedium, hintfull.
550 ///
551 /// Readable | Writeable
552 ///
553 ///
554 /// #### `gtk-xft-rgba`
555 /// The type of subpixel antialiasing to use.
556 ///
557 /// The possible values are none, rgb, bgr, vrgb, vbgr.
558 ///
559 /// Note that GSK does not support subpixel antialiasing, and this
560 /// setting has no effect on font rendering in GTK.
561 ///
562 /// Readable | Writeable
563 ///
564 /// # Implements
565 ///
566 /// [`trait@glib::ObjectExt`], [`StyleProviderExt`][trait@crate::prelude::StyleProviderExt]
567 #[doc(alias = "GtkSettings")]
568 pub struct Settings(Object<ffi::GtkSettings>) @implements StyleProvider;
569
570 match fn {
571 type_ => || ffi::gtk_settings_get_type(),
572 }
573}
574
575impl Settings {
576 // rustdoc-stripper-ignore-next
577 /// Creates a new builder-pattern struct instance to construct [`Settings`] objects.
578 ///
579 /// This method returns an instance of [`SettingsBuilder`](crate::builders::SettingsBuilder) which can be used to create [`Settings`] objects.
580 pub fn builder() -> SettingsBuilder {
581 SettingsBuilder::new()
582 }
583
584 /// Undoes the effect of calling g_object_set() to install an
585 /// application-specific value for a setting.
586 ///
587 /// After this call, the setting will again follow the session-wide
588 /// value for this setting.
589 /// ## `name`
590 /// the name of the setting to reset
591 #[doc(alias = "gtk_settings_reset_property")]
592 pub fn reset_property(&self, name: &str) {
593 unsafe {
594 ffi::gtk_settings_reset_property(self.to_glib_none().0, name.to_glib_none().0);
595 }
596 }
597
598 /// Whether buttons in dialogs should use the alternative button order.
599 #[doc(alias = "gtk-alternative-button-order")]
600 pub fn is_gtk_alternative_button_order(&self) -> bool {
601 ObjectExt::property(self, "gtk-alternative-button-order")
602 }
603
604 /// Whether buttons in dialogs should use the alternative button order.
605 #[doc(alias = "gtk-alternative-button-order")]
606 pub fn set_gtk_alternative_button_order(&self, gtk_alternative_button_order: bool) {
607 ObjectExt::set_property(
608 self,
609 "gtk-alternative-button-order",
610 gtk_alternative_button_order,
611 )
612 }
613
614 /// Controls the direction of the sort indicators in sorted list and tree
615 /// views.
616 ///
617 /// By default an arrow pointing down means the column is sorted
618 /// in ascending order. When set to [`true`], this order will be inverted.
619 #[doc(alias = "gtk-alternative-sort-arrows")]
620 pub fn is_gtk_alternative_sort_arrows(&self) -> bool {
621 ObjectExt::property(self, "gtk-alternative-sort-arrows")
622 }
623
624 /// Controls the direction of the sort indicators in sorted list and tree
625 /// views.
626 ///
627 /// By default an arrow pointing down means the column is sorted
628 /// in ascending order. When set to [`true`], this order will be inverted.
629 #[doc(alias = "gtk-alternative-sort-arrows")]
630 pub fn set_gtk_alternative_sort_arrows(&self, gtk_alternative_sort_arrows: bool) {
631 ObjectExt::set_property(
632 self,
633 "gtk-alternative-sort-arrows",
634 gtk_alternative_sort_arrows,
635 )
636 }
637
638 /// Whether the application prefers to use a dark theme.
639 ///
640 /// If a GTK theme includes a dark variant, it will be used
641 /// instead of the configured theme.
642 ///
643 /// Some applications benefit from minimizing the amount of light
644 /// pollution that interferes with the content. Good candidates for
645 /// dark themes are photo and video editors that make the actual
646 /// content get all the attention and minimize the distraction of
647 /// the chrome.
648 ///
649 /// Dark themes should not be used for documents, where large spaces
650 /// are white/light and the dark chrome creates too much contrast
651 /// (web browser, text editor...).
652 ///
653 /// # Deprecated since 4.20
654 ///
655 /// Use [`CssProvider`][crate::CssProvider] properties instead
656 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
657 #[doc(alias = "gtk-application-prefer-dark-theme")]
658 pub fn is_gtk_application_prefer_dark_theme(&self) -> bool {
659 ObjectExt::property(self, "gtk-application-prefer-dark-theme")
660 }
661
662 /// Whether the application prefers to use a dark theme.
663 ///
664 /// If a GTK theme includes a dark variant, it will be used
665 /// instead of the configured theme.
666 ///
667 /// Some applications benefit from minimizing the amount of light
668 /// pollution that interferes with the content. Good candidates for
669 /// dark themes are photo and video editors that make the actual
670 /// content get all the attention and minimize the distraction of
671 /// the chrome.
672 ///
673 /// Dark themes should not be used for documents, where large spaces
674 /// are white/light and the dark chrome creates too much contrast
675 /// (web browser, text editor...).
676 ///
677 /// # Deprecated since 4.20
678 ///
679 /// Use [`CssProvider`][crate::CssProvider] properties instead
680 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
681 #[doc(alias = "gtk-application-prefer-dark-theme")]
682 pub fn set_gtk_application_prefer_dark_theme(&self, gtk_application_prefer_dark_theme: bool) {
683 ObjectExt::set_property(
684 self,
685 "gtk-application-prefer-dark-theme",
686 gtk_application_prefer_dark_theme,
687 )
688 }
689
690 /// The aspect ratio of the text caret.
691 #[doc(alias = "gtk-cursor-aspect-ratio")]
692 pub fn gtk_cursor_aspect_ratio(&self) -> f64 {
693 ObjectExt::property(self, "gtk-cursor-aspect-ratio")
694 }
695
696 /// The aspect ratio of the text caret.
697 #[doc(alias = "gtk-cursor-aspect-ratio")]
698 pub fn set_gtk_cursor_aspect_ratio(&self, gtk_cursor_aspect_ratio: f64) {
699 ObjectExt::set_property(self, "gtk-cursor-aspect-ratio", gtk_cursor_aspect_ratio)
700 }
701
702 /// Whether the cursor should blink.
703 ///
704 /// Also see the [`gtk-cursor-blink-timeout`][struct@crate::Settings#gtk-cursor-blink-timeout] setting,
705 /// which allows more flexible control over cursor blinking.
706 #[doc(alias = "gtk-cursor-blink")]
707 pub fn is_gtk_cursor_blink(&self) -> bool {
708 ObjectExt::property(self, "gtk-cursor-blink")
709 }
710
711 /// Whether the cursor should blink.
712 ///
713 /// Also see the [`gtk-cursor-blink-timeout`][struct@crate::Settings#gtk-cursor-blink-timeout] setting,
714 /// which allows more flexible control over cursor blinking.
715 #[doc(alias = "gtk-cursor-blink")]
716 pub fn set_gtk_cursor_blink(&self, gtk_cursor_blink: bool) {
717 ObjectExt::set_property(self, "gtk-cursor-blink", gtk_cursor_blink)
718 }
719
720 /// Length of the cursor blink cycle, in milliseconds.
721 #[doc(alias = "gtk-cursor-blink-time")]
722 pub fn gtk_cursor_blink_time(&self) -> i32 {
723 ObjectExt::property(self, "gtk-cursor-blink-time")
724 }
725
726 /// Length of the cursor blink cycle, in milliseconds.
727 #[doc(alias = "gtk-cursor-blink-time")]
728 pub fn set_gtk_cursor_blink_time(&self, gtk_cursor_blink_time: i32) {
729 ObjectExt::set_property(self, "gtk-cursor-blink-time", gtk_cursor_blink_time)
730 }
731
732 /// Time after which the cursor stops blinking, in seconds.
733 ///
734 /// The timer is reset after each user interaction.
735 ///
736 /// Setting this to zero has the same effect as setting
737 /// [`gtk-cursor-blink`][struct@crate::Settings#gtk-cursor-blink] to [`false`].
738 #[doc(alias = "gtk-cursor-blink-timeout")]
739 pub fn gtk_cursor_blink_timeout(&self) -> i32 {
740 ObjectExt::property(self, "gtk-cursor-blink-timeout")
741 }
742
743 /// Time after which the cursor stops blinking, in seconds.
744 ///
745 /// The timer is reset after each user interaction.
746 ///
747 /// Setting this to zero has the same effect as setting
748 /// [`gtk-cursor-blink`][struct@crate::Settings#gtk-cursor-blink] to [`false`].
749 #[doc(alias = "gtk-cursor-blink-timeout")]
750 pub fn set_gtk_cursor_blink_timeout(&self, gtk_cursor_blink_timeout: i32) {
751 ObjectExt::set_property(self, "gtk-cursor-blink-timeout", gtk_cursor_blink_timeout)
752 }
753
754 /// Name of the cursor theme to use.
755 ///
756 /// Use [`None`] to use the default theme.
757 #[doc(alias = "gtk-cursor-theme-name")]
758 pub fn gtk_cursor_theme_name(&self) -> Option<glib::GString> {
759 ObjectExt::property(self, "gtk-cursor-theme-name")
760 }
761
762 /// Name of the cursor theme to use.
763 ///
764 /// Use [`None`] to use the default theme.
765 #[doc(alias = "gtk-cursor-theme-name")]
766 pub fn set_gtk_cursor_theme_name(&self, gtk_cursor_theme_name: Option<&str>) {
767 ObjectExt::set_property(self, "gtk-cursor-theme-name", gtk_cursor_theme_name)
768 }
769
770 /// The size to use for cursors.
771 ///
772 /// 0 means to use the default size.
773 #[doc(alias = "gtk-cursor-theme-size")]
774 pub fn gtk_cursor_theme_size(&self) -> i32 {
775 ObjectExt::property(self, "gtk-cursor-theme-size")
776 }
777
778 /// The size to use for cursors.
779 ///
780 /// 0 means to use the default size.
781 #[doc(alias = "gtk-cursor-theme-size")]
782 pub fn set_gtk_cursor_theme_size(&self, gtk_cursor_theme_size: i32) {
783 ObjectExt::set_property(self, "gtk-cursor-theme-size", gtk_cursor_theme_size)
784 }
785
786 /// Determines which buttons should be put in the
787 /// titlebar of client-side decorated windows, and whether they
788 /// should be placed on the left or right.
789 ///
790 /// The format of the string is button names, separated by commas.
791 /// A colon separates the buttons that should appear on the left
792 /// from those on the right. Recognized button names are minimize,
793 /// maximize, close, icon (the window icon) and menu (a menu button
794 /// for the fallback app menu).
795 ///
796 /// For example, "menu:minimize,maximize,close" specifies a menu
797 /// on the left, and minimize, maximize and close buttons on the right.
798 ///
799 /// Note that buttons will only be shown when they are meaningful.
800 /// E.g. a menu button only appears when the desktop shell does not
801 /// show the app menu, and a close button only appears on a window
802 /// that can be closed.
803 ///
804 /// Also note that the setting can be overridden with the
805 /// [`decoration-layout`][struct@crate::HeaderBar#decoration-layout] property.
806 #[doc(alias = "gtk-decoration-layout")]
807 pub fn gtk_decoration_layout(&self) -> Option<glib::GString> {
808 ObjectExt::property(self, "gtk-decoration-layout")
809 }
810
811 /// Determines which buttons should be put in the
812 /// titlebar of client-side decorated windows, and whether they
813 /// should be placed on the left or right.
814 ///
815 /// The format of the string is button names, separated by commas.
816 /// A colon separates the buttons that should appear on the left
817 /// from those on the right. Recognized button names are minimize,
818 /// maximize, close, icon (the window icon) and menu (a menu button
819 /// for the fallback app menu).
820 ///
821 /// For example, "menu:minimize,maximize,close" specifies a menu
822 /// on the left, and minimize, maximize and close buttons on the right.
823 ///
824 /// Note that buttons will only be shown when they are meaningful.
825 /// E.g. a menu button only appears when the desktop shell does not
826 /// show the app menu, and a close button only appears on a window
827 /// that can be closed.
828 ///
829 /// Also note that the setting can be overridden with the
830 /// [`decoration-layout`][struct@crate::HeaderBar#decoration-layout] property.
831 #[doc(alias = "gtk-decoration-layout")]
832 pub fn set_gtk_decoration_layout(&self, gtk_decoration_layout: Option<&str>) {
833 ObjectExt::set_property(self, "gtk-decoration-layout", gtk_decoration_layout)
834 }
835
836 /// Whether builtin GTK dialogs such as the file chooser, the
837 /// color chooser or the font chooser will use a header bar at
838 /// the top to show action widgets, or an action area at the bottom.
839 ///
840 /// This setting does not affect custom dialogs using [`Dialog`][crate::Dialog]
841 /// directly, or message dialogs.
842 #[doc(alias = "gtk-dialogs-use-header")]
843 pub fn is_gtk_dialogs_use_header(&self) -> bool {
844 ObjectExt::property(self, "gtk-dialogs-use-header")
845 }
846
847 /// Whether builtin GTK dialogs such as the file chooser, the
848 /// color chooser or the font chooser will use a header bar at
849 /// the top to show action widgets, or an action area at the bottom.
850 ///
851 /// This setting does not affect custom dialogs using [`Dialog`][crate::Dialog]
852 /// directly, or message dialogs.
853 #[doc(alias = "gtk-dialogs-use-header")]
854 pub fn set_gtk_dialogs_use_header(&self, gtk_dialogs_use_header: bool) {
855 ObjectExt::set_property(self, "gtk-dialogs-use-header", gtk_dialogs_use_header)
856 }
857
858 /// The number of pixels the cursor can move before dragging.
859 #[doc(alias = "gtk-dnd-drag-threshold")]
860 pub fn gtk_dnd_drag_threshold(&self) -> i32 {
861 ObjectExt::property(self, "gtk-dnd-drag-threshold")
862 }
863
864 /// The number of pixels the cursor can move before dragging.
865 #[doc(alias = "gtk-dnd-drag-threshold")]
866 pub fn set_gtk_dnd_drag_threshold(&self, gtk_dnd_drag_threshold: i32) {
867 ObjectExt::set_property(self, "gtk-dnd-drag-threshold", gtk_dnd_drag_threshold)
868 }
869
870 /// The maximum distance allowed between two clicks for them to be considered
871 /// a double click, in pixels.
872 #[doc(alias = "gtk-double-click-distance")]
873 pub fn gtk_double_click_distance(&self) -> i32 {
874 ObjectExt::property(self, "gtk-double-click-distance")
875 }
876
877 /// The maximum distance allowed between two clicks for them to be considered
878 /// a double click, in pixels.
879 #[doc(alias = "gtk-double-click-distance")]
880 pub fn set_gtk_double_click_distance(&self, gtk_double_click_distance: i32) {
881 ObjectExt::set_property(self, "gtk-double-click-distance", gtk_double_click_distance)
882 }
883
884 /// The maximum time to allow between two clicks for them to be considered
885 /// a double click, in milliseconds.
886 #[doc(alias = "gtk-double-click-time")]
887 pub fn gtk_double_click_time(&self) -> i32 {
888 ObjectExt::property(self, "gtk-double-click-time")
889 }
890
891 /// The maximum time to allow between two clicks for them to be considered
892 /// a double click, in milliseconds.
893 #[doc(alias = "gtk-double-click-time")]
894 pub fn set_gtk_double_click_time(&self, gtk_double_click_time: i32) {
895 ObjectExt::set_property(self, "gtk-double-click-time", gtk_double_click_time)
896 }
897
898 /// Whether menu items should have visible accelerators which can be
899 /// activated.
900 #[doc(alias = "gtk-enable-accels")]
901 pub fn is_gtk_enable_accels(&self) -> bool {
902 ObjectExt::property(self, "gtk-enable-accels")
903 }
904
905 /// Whether menu items should have visible accelerators which can be
906 /// activated.
907 #[doc(alias = "gtk-enable-accels")]
908 pub fn set_gtk_enable_accels(&self, gtk_enable_accels: bool) {
909 ObjectExt::set_property(self, "gtk-enable-accels", gtk_enable_accels)
910 }
911
912 /// Whether to enable toolkit-wide animations.
913 #[doc(alias = "gtk-enable-animations")]
914 pub fn is_gtk_enable_animations(&self) -> bool {
915 ObjectExt::property(self, "gtk-enable-animations")
916 }
917
918 /// Whether to enable toolkit-wide animations.
919 #[doc(alias = "gtk-enable-animations")]
920 pub fn set_gtk_enable_animations(&self, gtk_enable_animations: bool) {
921 ObjectExt::set_property(self, "gtk-enable-animations", gtk_enable_animations)
922 }
923
924 /// Whether to play any event sounds at all.
925 ///
926 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
927 /// for more information on event sounds and sound themes.
928 ///
929 /// GTK itself does not support event sounds, you have to use a loadable
930 /// module like the one that comes with libcanberra.
931 #[doc(alias = "gtk-enable-event-sounds")]
932 pub fn is_gtk_enable_event_sounds(&self) -> bool {
933 ObjectExt::property(self, "gtk-enable-event-sounds")
934 }
935
936 /// Whether to play any event sounds at all.
937 ///
938 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
939 /// for more information on event sounds and sound themes.
940 ///
941 /// GTK itself does not support event sounds, you have to use a loadable
942 /// module like the one that comes with libcanberra.
943 #[doc(alias = "gtk-enable-event-sounds")]
944 pub fn set_gtk_enable_event_sounds(&self, gtk_enable_event_sounds: bool) {
945 ObjectExt::set_property(self, "gtk-enable-event-sounds", gtk_enable_event_sounds)
946 }
947
948 /// Whether to play event sounds as feedback to user input.
949 ///
950 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
951 /// for more information on event sounds and sound themes.
952 ///
953 /// GTK itself does not support event sounds, you have to use a loadable
954 /// module like the one that comes with libcanberra.
955 #[doc(alias = "gtk-enable-input-feedback-sounds")]
956 pub fn is_gtk_enable_input_feedback_sounds(&self) -> bool {
957 ObjectExt::property(self, "gtk-enable-input-feedback-sounds")
958 }
959
960 /// Whether to play event sounds as feedback to user input.
961 ///
962 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
963 /// for more information on event sounds and sound themes.
964 ///
965 /// GTK itself does not support event sounds, you have to use a loadable
966 /// module like the one that comes with libcanberra.
967 #[doc(alias = "gtk-enable-input-feedback-sounds")]
968 pub fn set_gtk_enable_input_feedback_sounds(&self, gtk_enable_input_feedback_sounds: bool) {
969 ObjectExt::set_property(
970 self,
971 "gtk-enable-input-feedback-sounds",
972 gtk_enable_input_feedback_sounds,
973 )
974 }
975
976 /// Whether a middle click on a mouse should paste the
977 /// 'PRIMARY' clipboard content at the cursor location.
978 #[doc(alias = "gtk-enable-primary-paste")]
979 pub fn is_gtk_enable_primary_paste(&self) -> bool {
980 ObjectExt::property(self, "gtk-enable-primary-paste")
981 }
982
983 /// Whether a middle click on a mouse should paste the
984 /// 'PRIMARY' clipboard content at the cursor location.
985 #[doc(alias = "gtk-enable-primary-paste")]
986 pub fn set_gtk_enable_primary_paste(&self, gtk_enable_primary_paste: bool) {
987 ObjectExt::set_property(self, "gtk-enable-primary-paste", gtk_enable_primary_paste)
988 }
989
990 /// How long to show the last input character in hidden
991 /// entries.
992 ///
993 /// This value is in milliseconds. 0 disables showing the
994 /// last char. 600 is a good value for enabling it.
995 #[doc(alias = "gtk-entry-password-hint-timeout")]
996 pub fn gtk_entry_password_hint_timeout(&self) -> u32 {
997 ObjectExt::property(self, "gtk-entry-password-hint-timeout")
998 }
999
1000 /// How long to show the last input character in hidden
1001 /// entries.
1002 ///
1003 /// This value is in milliseconds. 0 disables showing the
1004 /// last char. 600 is a good value for enabling it.
1005 #[doc(alias = "gtk-entry-password-hint-timeout")]
1006 pub fn set_gtk_entry_password_hint_timeout(&self, gtk_entry_password_hint_timeout: u32) {
1007 ObjectExt::set_property(
1008 self,
1009 "gtk-entry-password-hint-timeout",
1010 gtk_entry_password_hint_timeout,
1011 )
1012 }
1013
1014 /// Whether to select the contents of an entry when it is focused.
1015 #[doc(alias = "gtk-entry-select-on-focus")]
1016 pub fn is_gtk_entry_select_on_focus(&self) -> bool {
1017 ObjectExt::property(self, "gtk-entry-select-on-focus")
1018 }
1019
1020 /// Whether to select the contents of an entry when it is focused.
1021 #[doc(alias = "gtk-entry-select-on-focus")]
1022 pub fn set_gtk_entry_select_on_focus(&self, gtk_entry_select_on_focus: bool) {
1023 ObjectExt::set_property(self, "gtk-entry-select-on-focus", gtk_entry_select_on_focus)
1024 }
1025
1026 /// When [`true`], keyboard navigation and other input-related errors
1027 /// will cause a beep.
1028 ///
1029 /// Since the error bell is implemented using gdk_surface_beep(), the
1030 /// windowing system may offer ways to configure the error bell in many
1031 /// ways, such as flashing the window or similar visual effects.
1032 #[doc(alias = "gtk-error-bell")]
1033 pub fn is_gtk_error_bell(&self) -> bool {
1034 ObjectExt::property(self, "gtk-error-bell")
1035 }
1036
1037 /// When [`true`], keyboard navigation and other input-related errors
1038 /// will cause a beep.
1039 ///
1040 /// Since the error bell is implemented using gdk_surface_beep(), the
1041 /// windowing system may offer ways to configure the error bell in many
1042 /// ways, such as flashing the window or similar visual effects.
1043 #[doc(alias = "gtk-error-bell")]
1044 pub fn set_gtk_error_bell(&self, gtk_error_bell: bool) {
1045 ObjectExt::set_property(self, "gtk-error-bell", gtk_error_bell)
1046 }
1047
1048 /// The default font to use.
1049 ///
1050 /// GTK uses the family name and size from this string.
1051 #[doc(alias = "gtk-font-name")]
1052 pub fn gtk_font_name(&self) -> Option<glib::GString> {
1053 ObjectExt::property(self, "gtk-font-name")
1054 }
1055
1056 /// The default font to use.
1057 ///
1058 /// GTK uses the family name and size from this string.
1059 #[doc(alias = "gtk-font-name")]
1060 pub fn set_gtk_font_name(&self, gtk_font_name: Option<&str>) {
1061 ObjectExt::set_property(self, "gtk-font-name", gtk_font_name)
1062 }
1063
1064 /// How GTK font rendering is set up.
1065 ///
1066 /// When set to [enum@Gtk.FontRendering.MANUAL], GTK respects the low-level
1067 /// font-related settings ([`gtk-hint-font-metrics`][struct@crate::Settings#gtk-hint-font-metrics],
1068 /// [`gtk-xft-antialias`][struct@crate::Settings#gtk-xft-antialias], [`gtk-xft-hinting`][struct@crate::Settings#gtk-xft-hinting],
1069 /// [`gtk-xft-hintstyle`][struct@crate::Settings#gtk-xft-hintstyle] and [`gtk-xft-rgba`][struct@crate::Settings#gtk-xft-rgba])
1070 /// as much as practical.
1071 ///
1072 /// When set to [enum@Gtk.FontRendering.AUTOMATIC], GTK will consider factors such
1073 /// as screen resolution and scale in deciding how to render fonts.
1074 #[cfg(feature = "v4_16")]
1075 #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
1076 #[doc(alias = "gtk-font-rendering")]
1077 pub fn gtk_font_rendering(&self) -> FontRendering {
1078 ObjectExt::property(self, "gtk-font-rendering")
1079 }
1080
1081 /// How GTK font rendering is set up.
1082 ///
1083 /// When set to [enum@Gtk.FontRendering.MANUAL], GTK respects the low-level
1084 /// font-related settings ([`gtk-hint-font-metrics`][struct@crate::Settings#gtk-hint-font-metrics],
1085 /// [`gtk-xft-antialias`][struct@crate::Settings#gtk-xft-antialias], [`gtk-xft-hinting`][struct@crate::Settings#gtk-xft-hinting],
1086 /// [`gtk-xft-hintstyle`][struct@crate::Settings#gtk-xft-hintstyle] and [`gtk-xft-rgba`][struct@crate::Settings#gtk-xft-rgba])
1087 /// as much as practical.
1088 ///
1089 /// When set to [enum@Gtk.FontRendering.AUTOMATIC], GTK will consider factors such
1090 /// as screen resolution and scale in deciding how to render fonts.
1091 #[cfg(feature = "v4_16")]
1092 #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
1093 #[doc(alias = "gtk-font-rendering")]
1094 pub fn set_gtk_font_rendering(&self, gtk_font_rendering: FontRendering) {
1095 ObjectExt::set_property(self, "gtk-font-rendering", gtk_font_rendering)
1096 }
1097
1098 /// Timestamp of the current fontconfig configuration.
1099 #[doc(alias = "gtk-fontconfig-timestamp")]
1100 pub fn gtk_fontconfig_timestamp(&self) -> u32 {
1101 ObjectExt::property(self, "gtk-fontconfig-timestamp")
1102 }
1103
1104 /// Timestamp of the current fontconfig configuration.
1105 #[doc(alias = "gtk-fontconfig-timestamp")]
1106 pub fn set_gtk_fontconfig_timestamp(&self, gtk_fontconfig_timestamp: u32) {
1107 ObjectExt::set_property(self, "gtk-fontconfig-timestamp", gtk_fontconfig_timestamp)
1108 }
1109
1110 /// Whether hinting should be applied to font metrics.
1111 ///
1112 /// Note that this also turns off subpixel positioning of glyphs,
1113 /// since it conflicts with metrics hinting.
1114 #[cfg(feature = "v4_6")]
1115 #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1116 #[doc(alias = "gtk-hint-font-metrics")]
1117 pub fn is_gtk_hint_font_metrics(&self) -> bool {
1118 ObjectExt::property(self, "gtk-hint-font-metrics")
1119 }
1120
1121 /// Whether hinting should be applied to font metrics.
1122 ///
1123 /// Note that this also turns off subpixel positioning of glyphs,
1124 /// since it conflicts with metrics hinting.
1125 #[cfg(feature = "v4_6")]
1126 #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1127 #[doc(alias = "gtk-hint-font-metrics")]
1128 pub fn set_gtk_hint_font_metrics(&self, gtk_hint_font_metrics: bool) {
1129 ObjectExt::set_property(self, "gtk-hint-font-metrics", gtk_hint_font_metrics)
1130 }
1131
1132 /// Name of the icon theme to use.
1133 ///
1134 /// See [`IconTheme`][crate::IconTheme] for details about how
1135 /// GTK handles icon themes.
1136 #[doc(alias = "gtk-icon-theme-name")]
1137 pub fn gtk_icon_theme_name(&self) -> Option<glib::GString> {
1138 ObjectExt::property(self, "gtk-icon-theme-name")
1139 }
1140
1141 /// Name of the icon theme to use.
1142 ///
1143 /// See [`IconTheme`][crate::IconTheme] for details about how
1144 /// GTK handles icon themes.
1145 #[doc(alias = "gtk-icon-theme-name")]
1146 pub fn set_gtk_icon_theme_name(&self, gtk_icon_theme_name: Option<&str>) {
1147 ObjectExt::set_property(self, "gtk-icon-theme-name", gtk_icon_theme_name)
1148 }
1149
1150 /// Which IM (input method) module should be used by default.
1151 ///
1152 /// This is the input method that will be used if the user has not
1153 /// explicitly chosen another input method from the IM context menu.
1154 /// This also can be a colon-separated list of input methods, which GTK
1155 /// will try in turn until it finds one available on the system.
1156 ///
1157 /// See [`IMContext`][crate::IMContext].
1158 #[doc(alias = "gtk-im-module")]
1159 pub fn gtk_im_module(&self) -> Option<glib::GString> {
1160 ObjectExt::property(self, "gtk-im-module")
1161 }
1162
1163 /// Which IM (input method) module should be used by default.
1164 ///
1165 /// This is the input method that will be used if the user has not
1166 /// explicitly chosen another input method from the IM context menu.
1167 /// This also can be a colon-separated list of input methods, which GTK
1168 /// will try in turn until it finds one available on the system.
1169 ///
1170 /// See [`IMContext`][crate::IMContext].
1171 #[doc(alias = "gtk-im-module")]
1172 pub fn set_gtk_im_module(&self, gtk_im_module: Option<&str>) {
1173 ObjectExt::set_property(self, "gtk-im-module", gtk_im_module)
1174 }
1175
1176 /// The color scheme used for rendering the user interface.
1177 ///
1178 /// This setting communicates the system-wide preference.
1179 /// The color scheme that is actually used when applying CSS
1180 /// styles can be set with the [`prefers-color-scheme`][struct@crate::CssProvider#prefers-color-scheme]
1181 /// property.
1182 #[cfg(feature = "v4_20")]
1183 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1184 #[doc(alias = "gtk-interface-color-scheme")]
1185 pub fn gtk_interface_color_scheme(&self) -> InterfaceColorScheme {
1186 ObjectExt::property(self, "gtk-interface-color-scheme")
1187 }
1188
1189 /// The color scheme used for rendering the user interface.
1190 ///
1191 /// This setting communicates the system-wide preference.
1192 /// The color scheme that is actually used when applying CSS
1193 /// styles can be set with the [`prefers-color-scheme`][struct@crate::CssProvider#prefers-color-scheme]
1194 /// property.
1195 #[cfg(feature = "v4_20")]
1196 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1197 #[doc(alias = "gtk-interface-color-scheme")]
1198 pub fn set_gtk_interface_color_scheme(&self, gtk_interface_color_scheme: InterfaceColorScheme) {
1199 ObjectExt::set_property(
1200 self,
1201 "gtk-interface-color-scheme",
1202 gtk_interface_color_scheme,
1203 )
1204 }
1205
1206 /// The level of contrast to use for the user interface.
1207 ///
1208 /// This setting communicates the system-wide preference.
1209 /// The contrast level that is actually used when applying CSS
1210 /// styles can be set with the [`prefers-contrast`][struct@crate::CssProvider#prefers-contrast]
1211 /// property.
1212 #[cfg(feature = "v4_20")]
1213 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1214 #[doc(alias = "gtk-interface-contrast")]
1215 pub fn gtk_interface_contrast(&self) -> InterfaceContrast {
1216 ObjectExt::property(self, "gtk-interface-contrast")
1217 }
1218
1219 /// The level of contrast to use for the user interface.
1220 ///
1221 /// This setting communicates the system-wide preference.
1222 /// The contrast level that is actually used when applying CSS
1223 /// styles can be set with the [`prefers-contrast`][struct@crate::CssProvider#prefers-contrast]
1224 /// property.
1225 #[cfg(feature = "v4_20")]
1226 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1227 #[doc(alias = "gtk-interface-contrast")]
1228 pub fn set_gtk_interface_contrast(&self, gtk_interface_contrast: InterfaceContrast) {
1229 ObjectExt::set_property(self, "gtk-interface-contrast", gtk_interface_contrast)
1230 }
1231
1232 /// Whether GTK should make sure that text can be navigated with
1233 /// a caret, even if it is not editable.
1234 ///
1235 /// This is useful when using a screen reader.
1236 #[doc(alias = "gtk-keynav-use-caret")]
1237 pub fn is_gtk_keynav_use_caret(&self) -> bool {
1238 ObjectExt::property(self, "gtk-keynav-use-caret")
1239 }
1240
1241 /// Whether GTK should make sure that text can be navigated with
1242 /// a caret, even if it is not editable.
1243 ///
1244 /// This is useful when using a screen reader.
1245 #[doc(alias = "gtk-keynav-use-caret")]
1246 pub fn set_gtk_keynav_use_caret(&self, gtk_keynav_use_caret: bool) {
1247 ObjectExt::set_property(self, "gtk-keynav-use-caret", gtk_keynav_use_caret)
1248 }
1249
1250 /// Whether to select the contents of a selectable
1251 /// label when it is focused.
1252 #[doc(alias = "gtk-label-select-on-focus")]
1253 pub fn is_gtk_label_select_on_focus(&self) -> bool {
1254 ObjectExt::property(self, "gtk-label-select-on-focus")
1255 }
1256
1257 /// Whether to select the contents of a selectable
1258 /// label when it is focused.
1259 #[doc(alias = "gtk-label-select-on-focus")]
1260 pub fn set_gtk_label_select_on_focus(&self, gtk_label_select_on_focus: bool) {
1261 ObjectExt::set_property(self, "gtk-label-select-on-focus", gtk_label_select_on_focus)
1262 }
1263
1264 /// The time for a button or touch press to be considered a “long press”.
1265 ///
1266 /// See [`GestureLongPress`][crate::GestureLongPress].
1267 #[doc(alias = "gtk-long-press-time")]
1268 pub fn gtk_long_press_time(&self) -> u32 {
1269 ObjectExt::property(self, "gtk-long-press-time")
1270 }
1271
1272 /// The time for a button or touch press to be considered a “long press”.
1273 ///
1274 /// See [`GestureLongPress`][crate::GestureLongPress].
1275 #[doc(alias = "gtk-long-press-time")]
1276 pub fn set_gtk_long_press_time(&self, gtk_long_press_time: u32) {
1277 ObjectExt::set_property(self, "gtk-long-press-time", gtk_long_press_time)
1278 }
1279
1280 /// Whether scrolled windows may use overlaid scrolling indicators.
1281 ///
1282 /// If this is set to [`false`], scrolled windows will have permanent
1283 /// scrollbars.
1284 #[doc(alias = "gtk-overlay-scrolling")]
1285 pub fn is_gtk_overlay_scrolling(&self) -> bool {
1286 ObjectExt::property(self, "gtk-overlay-scrolling")
1287 }
1288
1289 /// Whether scrolled windows may use overlaid scrolling indicators.
1290 ///
1291 /// If this is set to [`false`], scrolled windows will have permanent
1292 /// scrollbars.
1293 #[doc(alias = "gtk-overlay-scrolling")]
1294 pub fn set_gtk_overlay_scrolling(&self, gtk_overlay_scrolling: bool) {
1295 ObjectExt::set_property(self, "gtk-overlay-scrolling", gtk_overlay_scrolling)
1296 }
1297
1298 /// If the value of this setting is [`true`], clicking the primary button in a
1299 /// [`Range`][crate::Range] trough will move the slider, and hence set the range’s value, to
1300 /// the point that you clicked.
1301 ///
1302 /// If it is [`false`], a primary click will cause the slider/value to move
1303 /// by the range’s page-size towards the point clicked.
1304 ///
1305 /// Whichever action you choose for the primary button, the other action will
1306 /// be available by holding Shift and primary-clicking, or clicking the middle
1307 /// mouse button.
1308 #[doc(alias = "gtk-primary-button-warps-slider")]
1309 pub fn is_gtk_primary_button_warps_slider(&self) -> bool {
1310 ObjectExt::property(self, "gtk-primary-button-warps-slider")
1311 }
1312
1313 /// If the value of this setting is [`true`], clicking the primary button in a
1314 /// [`Range`][crate::Range] trough will move the slider, and hence set the range’s value, to
1315 /// the point that you clicked.
1316 ///
1317 /// If it is [`false`], a primary click will cause the slider/value to move
1318 /// by the range’s page-size towards the point clicked.
1319 ///
1320 /// Whichever action you choose for the primary button, the other action will
1321 /// be available by holding Shift and primary-clicking, or clicking the middle
1322 /// mouse button.
1323 #[doc(alias = "gtk-primary-button-warps-slider")]
1324 pub fn set_gtk_primary_button_warps_slider(&self, gtk_primary_button_warps_slider: bool) {
1325 ObjectExt::set_property(
1326 self,
1327 "gtk-primary-button-warps-slider",
1328 gtk_primary_button_warps_slider,
1329 )
1330 }
1331
1332 /// A comma-separated list of print backends to use in the print
1333 /// dialog.
1334 ///
1335 /// Available print backends depend on the GTK installation,
1336 /// and may include "file", "cups", "lpr" or "papi".
1337 #[doc(alias = "gtk-print-backends")]
1338 pub fn gtk_print_backends(&self) -> Option<glib::GString> {
1339 ObjectExt::property(self, "gtk-print-backends")
1340 }
1341
1342 /// A comma-separated list of print backends to use in the print
1343 /// dialog.
1344 ///
1345 /// Available print backends depend on the GTK installation,
1346 /// and may include "file", "cups", "lpr" or "papi".
1347 #[doc(alias = "gtk-print-backends")]
1348 pub fn set_gtk_print_backends(&self, gtk_print_backends: Option<&str>) {
1349 ObjectExt::set_property(self, "gtk-print-backends", gtk_print_backends)
1350 }
1351
1352 /// A command to run for displaying the print preview.
1353 ///
1354 /// The command should contain a ``f`` placeholder, which will get
1355 /// replaced by the path to the pdf file. The command may also
1356 /// contain a ``s`` placeholder, which will get replaced by the
1357 /// path to a file containing the print settings in the format
1358 /// produced by [`PrintSettings::to_file()`][crate::PrintSettings::to_file()].
1359 ///
1360 /// The preview application is responsible for removing the pdf
1361 /// file and the print settings file when it is done.
1362 #[doc(alias = "gtk-print-preview-command")]
1363 pub fn gtk_print_preview_command(&self) -> Option<glib::GString> {
1364 ObjectExt::property(self, "gtk-print-preview-command")
1365 }
1366
1367 /// A command to run for displaying the print preview.
1368 ///
1369 /// The command should contain a ``f`` placeholder, which will get
1370 /// replaced by the path to the pdf file. The command may also
1371 /// contain a ``s`` placeholder, which will get replaced by the
1372 /// path to a file containing the print settings in the format
1373 /// produced by [`PrintSettings::to_file()`][crate::PrintSettings::to_file()].
1374 ///
1375 /// The preview application is responsible for removing the pdf
1376 /// file and the print settings file when it is done.
1377 #[doc(alias = "gtk-print-preview-command")]
1378 pub fn set_gtk_print_preview_command(&self, gtk_print_preview_command: Option<&str>) {
1379 ObjectExt::set_property(self, "gtk-print-preview-command", gtk_print_preview_command)
1380 }
1381
1382 /// Whether GTK should keep track of items inside the recently used
1383 /// resources list.
1384 ///
1385 /// If set to [`false`], the list will always be empty.
1386 #[doc(alias = "gtk-recent-files-enabled")]
1387 pub fn is_gtk_recent_files_enabled(&self) -> bool {
1388 ObjectExt::property(self, "gtk-recent-files-enabled")
1389 }
1390
1391 /// Whether GTK should keep track of items inside the recently used
1392 /// resources list.
1393 ///
1394 /// If set to [`false`], the list will always be empty.
1395 #[doc(alias = "gtk-recent-files-enabled")]
1396 pub fn set_gtk_recent_files_enabled(&self, gtk_recent_files_enabled: bool) {
1397 ObjectExt::set_property(self, "gtk-recent-files-enabled", gtk_recent_files_enabled)
1398 }
1399
1400 /// The maximum age, in days, of the items inside the recently used
1401 /// resources list.
1402 ///
1403 /// Items older than this setting will be excised from the list.
1404 /// If set to 0, the list will always be empty; if set to -1, no
1405 /// item will be removed.
1406 #[doc(alias = "gtk-recent-files-max-age")]
1407 pub fn gtk_recent_files_max_age(&self) -> i32 {
1408 ObjectExt::property(self, "gtk-recent-files-max-age")
1409 }
1410
1411 /// The maximum age, in days, of the items inside the recently used
1412 /// resources list.
1413 ///
1414 /// Items older than this setting will be excised from the list.
1415 /// If set to 0, the list will always be empty; if set to -1, no
1416 /// item will be removed.
1417 #[doc(alias = "gtk-recent-files-max-age")]
1418 pub fn set_gtk_recent_files_max_age(&self, gtk_recent_files_max_age: i32) {
1419 ObjectExt::set_property(self, "gtk-recent-files-max-age", gtk_recent_files_max_age)
1420 }
1421
1422 /// Set to [`true`] if the desktop environment is displaying
1423 /// the app menu, [`false`] if the app should display it itself.
1424 ///
1425 /// # Deprecated since 4.20
1426 ///
1427 /// This setting is not relevant anymore
1428 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
1429 #[doc(alias = "gtk-shell-shows-app-menu")]
1430 pub fn is_gtk_shell_shows_app_menu(&self) -> bool {
1431 ObjectExt::property(self, "gtk-shell-shows-app-menu")
1432 }
1433
1434 /// Set to [`true`] if the desktop environment is displaying
1435 /// the app menu, [`false`] if the app should display it itself.
1436 ///
1437 /// # Deprecated since 4.20
1438 ///
1439 /// This setting is not relevant anymore
1440 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
1441 #[doc(alias = "gtk-shell-shows-app-menu")]
1442 pub fn set_gtk_shell_shows_app_menu(&self, gtk_shell_shows_app_menu: bool) {
1443 ObjectExt::set_property(self, "gtk-shell-shows-app-menu", gtk_shell_shows_app_menu)
1444 }
1445
1446 /// Set to [`true`] if the desktop environment is displaying
1447 /// the desktop folder, [`false`] if not.
1448 ///
1449 /// # Deprecated since 4.20
1450 ///
1451 /// This setting is not relevant anymore
1452 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
1453 #[doc(alias = "gtk-shell-shows-desktop")]
1454 pub fn is_gtk_shell_shows_desktop(&self) -> bool {
1455 ObjectExt::property(self, "gtk-shell-shows-desktop")
1456 }
1457
1458 /// Set to [`true`] if the desktop environment is displaying
1459 /// the desktop folder, [`false`] if not.
1460 ///
1461 /// # Deprecated since 4.20
1462 ///
1463 /// This setting is not relevant anymore
1464 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
1465 #[doc(alias = "gtk-shell-shows-desktop")]
1466 pub fn set_gtk_shell_shows_desktop(&self, gtk_shell_shows_desktop: bool) {
1467 ObjectExt::set_property(self, "gtk-shell-shows-desktop", gtk_shell_shows_desktop)
1468 }
1469
1470 /// Set to [`true`] if the desktop environment is displaying
1471 /// the menubar, [`false`] if the app should display it itself.
1472 ///
1473 /// # Deprecated since 4.20
1474 ///
1475 /// This setting is not relevant anymore
1476 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
1477 #[doc(alias = "gtk-shell-shows-menubar")]
1478 pub fn is_gtk_shell_shows_menubar(&self) -> bool {
1479 ObjectExt::property(self, "gtk-shell-shows-menubar")
1480 }
1481
1482 /// Set to [`true`] if the desktop environment is displaying
1483 /// the menubar, [`false`] if the app should display it itself.
1484 ///
1485 /// # Deprecated since 4.20
1486 ///
1487 /// This setting is not relevant anymore
1488 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
1489 #[doc(alias = "gtk-shell-shows-menubar")]
1490 pub fn set_gtk_shell_shows_menubar(&self, gtk_shell_shows_menubar: bool) {
1491 ObjectExt::set_property(self, "gtk-shell-shows-menubar", gtk_shell_shows_menubar)
1492 }
1493
1494 /// When [`true`], widgets like switches include shapes to indicate their on/off state.
1495 #[cfg(feature = "v4_14")]
1496 #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1497 #[doc(alias = "gtk-show-status-shapes")]
1498 pub fn is_gtk_show_status_shapes(&self) -> bool {
1499 ObjectExt::property(self, "gtk-show-status-shapes")
1500 }
1501
1502 /// When [`true`], widgets like switches include shapes to indicate their on/off state.
1503 #[cfg(feature = "v4_14")]
1504 #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1505 #[doc(alias = "gtk-show-status-shapes")]
1506 pub fn set_gtk_show_status_shapes(&self, gtk_show_status_shapes: bool) {
1507 ObjectExt::set_property(self, "gtk-show-status-shapes", gtk_show_status_shapes)
1508 }
1509
1510 /// The XDG sound theme to use for event sounds.
1511 ///
1512 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
1513 /// for more information on event sounds and sound themes.
1514 ///
1515 /// GTK itself does not support event sounds, you have to use
1516 /// a loadable module like the one that comes with libcanberra.
1517 #[doc(alias = "gtk-sound-theme-name")]
1518 pub fn gtk_sound_theme_name(&self) -> Option<glib::GString> {
1519 ObjectExt::property(self, "gtk-sound-theme-name")
1520 }
1521
1522 /// The XDG sound theme to use for event sounds.
1523 ///
1524 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
1525 /// for more information on event sounds and sound themes.
1526 ///
1527 /// GTK itself does not support event sounds, you have to use
1528 /// a loadable module like the one that comes with libcanberra.
1529 #[doc(alias = "gtk-sound-theme-name")]
1530 pub fn set_gtk_sound_theme_name(&self, gtk_sound_theme_name: Option<&str>) {
1531 ObjectExt::set_property(self, "gtk-sound-theme-name", gtk_sound_theme_name)
1532 }
1533
1534 /// Whether two cursors should be displayed for mixed left-to-right and
1535 /// right-to-left text.
1536 #[doc(alias = "gtk-split-cursor")]
1537 pub fn is_gtk_split_cursor(&self) -> bool {
1538 ObjectExt::property(self, "gtk-split-cursor")
1539 }
1540
1541 /// Whether two cursors should be displayed for mixed left-to-right and
1542 /// right-to-left text.
1543 #[doc(alias = "gtk-split-cursor")]
1544 pub fn set_gtk_split_cursor(&self, gtk_split_cursor: bool) {
1545 ObjectExt::set_property(self, "gtk-split-cursor", gtk_split_cursor)
1546 }
1547
1548 /// Name of the theme to load.
1549 ///
1550 /// See [`CssProvider`][crate::CssProvider] for details about how
1551 /// GTK finds the CSS stylesheet for a theme.
1552 #[doc(alias = "gtk-theme-name")]
1553 pub fn gtk_theme_name(&self) -> Option<glib::GString> {
1554 ObjectExt::property(self, "gtk-theme-name")
1555 }
1556
1557 /// Name of the theme to load.
1558 ///
1559 /// See [`CssProvider`][crate::CssProvider] for details about how
1560 /// GTK finds the CSS stylesheet for a theme.
1561 #[doc(alias = "gtk-theme-name")]
1562 pub fn set_gtk_theme_name(&self, gtk_theme_name: Option<&str>) {
1563 ObjectExt::set_property(self, "gtk-theme-name", gtk_theme_name)
1564 }
1565
1566 /// Determines the action to take when a double-click
1567 /// occurs on the titlebar of client-side decorated windows.
1568 ///
1569 /// Recognized actions are minimize, toggle-maximize, menu, lower
1570 /// or none.
1571 #[doc(alias = "gtk-titlebar-double-click")]
1572 pub fn gtk_titlebar_double_click(&self) -> Option<glib::GString> {
1573 ObjectExt::property(self, "gtk-titlebar-double-click")
1574 }
1575
1576 /// Determines the action to take when a double-click
1577 /// occurs on the titlebar of client-side decorated windows.
1578 ///
1579 /// Recognized actions are minimize, toggle-maximize, menu, lower
1580 /// or none.
1581 #[doc(alias = "gtk-titlebar-double-click")]
1582 pub fn set_gtk_titlebar_double_click(&self, gtk_titlebar_double_click: Option<&str>) {
1583 ObjectExt::set_property(self, "gtk-titlebar-double-click", gtk_titlebar_double_click)
1584 }
1585
1586 /// Determines the action to take when a middle-click
1587 /// occurs on the titlebar of client-side decorated windows.
1588 ///
1589 /// Recognized actions are minimize, toggle-maximize, menu, lower
1590 /// or none.
1591 #[doc(alias = "gtk-titlebar-middle-click")]
1592 pub fn gtk_titlebar_middle_click(&self) -> Option<glib::GString> {
1593 ObjectExt::property(self, "gtk-titlebar-middle-click")
1594 }
1595
1596 /// Determines the action to take when a middle-click
1597 /// occurs on the titlebar of client-side decorated windows.
1598 ///
1599 /// Recognized actions are minimize, toggle-maximize, menu, lower
1600 /// or none.
1601 #[doc(alias = "gtk-titlebar-middle-click")]
1602 pub fn set_gtk_titlebar_middle_click(&self, gtk_titlebar_middle_click: Option<&str>) {
1603 ObjectExt::set_property(self, "gtk-titlebar-middle-click", gtk_titlebar_middle_click)
1604 }
1605
1606 /// Determines the action to take when a right-click
1607 /// occurs on the titlebar of client-side decorated windows.
1608 ///
1609 /// Recognized actions are minimize, toggle-maximize, menu, lower
1610 /// or none.
1611 #[doc(alias = "gtk-titlebar-right-click")]
1612 pub fn gtk_titlebar_right_click(&self) -> Option<glib::GString> {
1613 ObjectExt::property(self, "gtk-titlebar-right-click")
1614 }
1615
1616 /// Determines the action to take when a right-click
1617 /// occurs on the titlebar of client-side decorated windows.
1618 ///
1619 /// Recognized actions are minimize, toggle-maximize, menu, lower
1620 /// or none.
1621 #[doc(alias = "gtk-titlebar-right-click")]
1622 pub fn set_gtk_titlebar_right_click(&self, gtk_titlebar_right_click: Option<&str>) {
1623 ObjectExt::set_property(self, "gtk-titlebar-right-click", gtk_titlebar_right_click)
1624 }
1625
1626 /// Whether to antialias fonts.
1627 ///
1628 /// The values are 0 for no, 1 for yes, or -1 for the system default.
1629 #[doc(alias = "gtk-xft-antialias")]
1630 pub fn gtk_xft_antialias(&self) -> i32 {
1631 ObjectExt::property(self, "gtk-xft-antialias")
1632 }
1633
1634 /// Whether to antialias fonts.
1635 ///
1636 /// The values are 0 for no, 1 for yes, or -1 for the system default.
1637 #[doc(alias = "gtk-xft-antialias")]
1638 pub fn set_gtk_xft_antialias(&self, gtk_xft_antialias: i32) {
1639 ObjectExt::set_property(self, "gtk-xft-antialias", gtk_xft_antialias)
1640 }
1641
1642 /// The font resolution, in 1024 * dots/inch.
1643 ///
1644 /// -1 to use the default value.
1645 #[doc(alias = "gtk-xft-dpi")]
1646 pub fn gtk_xft_dpi(&self) -> i32 {
1647 ObjectExt::property(self, "gtk-xft-dpi")
1648 }
1649
1650 /// The font resolution, in 1024 * dots/inch.
1651 ///
1652 /// -1 to use the default value.
1653 #[doc(alias = "gtk-xft-dpi")]
1654 pub fn set_gtk_xft_dpi(&self, gtk_xft_dpi: i32) {
1655 ObjectExt::set_property(self, "gtk-xft-dpi", gtk_xft_dpi)
1656 }
1657
1658 /// Whether to enable font hinting.
1659 ///
1660 /// The values are 0 for no, 1 for yes, or -1 for the system default.
1661 #[doc(alias = "gtk-xft-hinting")]
1662 pub fn gtk_xft_hinting(&self) -> i32 {
1663 ObjectExt::property(self, "gtk-xft-hinting")
1664 }
1665
1666 /// Whether to enable font hinting.
1667 ///
1668 /// The values are 0 for no, 1 for yes, or -1 for the system default.
1669 #[doc(alias = "gtk-xft-hinting")]
1670 pub fn set_gtk_xft_hinting(&self, gtk_xft_hinting: i32) {
1671 ObjectExt::set_property(self, "gtk-xft-hinting", gtk_xft_hinting)
1672 }
1673
1674 /// What degree of font hinting to use.
1675 ///
1676 /// The possible vaues are hintnone, hintslight,
1677 /// hintmedium, hintfull.
1678 #[doc(alias = "gtk-xft-hintstyle")]
1679 pub fn gtk_xft_hintstyle(&self) -> Option<glib::GString> {
1680 ObjectExt::property(self, "gtk-xft-hintstyle")
1681 }
1682
1683 /// What degree of font hinting to use.
1684 ///
1685 /// The possible vaues are hintnone, hintslight,
1686 /// hintmedium, hintfull.
1687 #[doc(alias = "gtk-xft-hintstyle")]
1688 pub fn set_gtk_xft_hintstyle(&self, gtk_xft_hintstyle: Option<&str>) {
1689 ObjectExt::set_property(self, "gtk-xft-hintstyle", gtk_xft_hintstyle)
1690 }
1691
1692 /// The type of subpixel antialiasing to use.
1693 ///
1694 /// The possible values are none, rgb, bgr, vrgb, vbgr.
1695 ///
1696 /// Note that GSK does not support subpixel antialiasing, and this
1697 /// setting has no effect on font rendering in GTK.
1698 #[doc(alias = "gtk-xft-rgba")]
1699 pub fn gtk_xft_rgba(&self) -> Option<glib::GString> {
1700 ObjectExt::property(self, "gtk-xft-rgba")
1701 }
1702
1703 /// The type of subpixel antialiasing to use.
1704 ///
1705 /// The possible values are none, rgb, bgr, vrgb, vbgr.
1706 ///
1707 /// Note that GSK does not support subpixel antialiasing, and this
1708 /// setting has no effect on font rendering in GTK.
1709 #[doc(alias = "gtk-xft-rgba")]
1710 pub fn set_gtk_xft_rgba(&self, gtk_xft_rgba: Option<&str>) {
1711 ObjectExt::set_property(self, "gtk-xft-rgba", gtk_xft_rgba)
1712 }
1713
1714 /// Gets the [`Settings`][crate::Settings] object for the default display, creating
1715 /// it if necessary.
1716 ///
1717 /// See [`for_display()`][Self::for_display()].
1718 ///
1719 /// # Returns
1720 ///
1721 /// a [`Settings`][crate::Settings] object. If there is
1722 /// no default display, then returns [`None`].
1723 #[doc(alias = "gtk_settings_get_default")]
1724 #[doc(alias = "get_default")]
1725 #[allow(clippy::should_implement_trait)]
1726 pub fn default() -> Option<Settings> {
1727 assert_initialized_main_thread!();
1728 unsafe { from_glib_none(ffi::gtk_settings_get_default()) }
1729 }
1730
1731 /// Gets the [`Settings`][crate::Settings] object for @display, creating it if necessary.
1732 /// ## `display`
1733 /// a [`gdk::Display`][crate::gdk::Display]
1734 ///
1735 /// # Returns
1736 ///
1737 /// a [`Settings`][crate::Settings] object
1738 #[doc(alias = "gtk_settings_get_for_display")]
1739 #[doc(alias = "get_for_display")]
1740 pub fn for_display(display: &impl IsA<gdk::Display>) -> Settings {
1741 assert_initialized_main_thread!();
1742 unsafe {
1743 from_glib_none(ffi::gtk_settings_get_for_display(
1744 display.as_ref().to_glib_none().0,
1745 ))
1746 }
1747 }
1748
1749 #[doc(alias = "gtk-alternative-button-order")]
1750 pub fn connect_gtk_alternative_button_order_notify<F: Fn(&Self) + 'static>(
1751 &self,
1752 f: F,
1753 ) -> SignalHandlerId {
1754 unsafe extern "C" fn notify_gtk_alternative_button_order_trampoline<
1755 F: Fn(&Settings) + 'static,
1756 >(
1757 this: *mut ffi::GtkSettings,
1758 _param_spec: glib::ffi::gpointer,
1759 f: glib::ffi::gpointer,
1760 ) {
1761 let f: &F = &*(f as *const F);
1762 f(&from_glib_borrow(this))
1763 }
1764 unsafe {
1765 let f: Box_<F> = Box_::new(f);
1766 connect_raw(
1767 self.as_ptr() as *mut _,
1768 c"notify::gtk-alternative-button-order".as_ptr() as *const _,
1769 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1770 notify_gtk_alternative_button_order_trampoline::<F> as *const (),
1771 )),
1772 Box_::into_raw(f),
1773 )
1774 }
1775 }
1776
1777 #[doc(alias = "gtk-alternative-sort-arrows")]
1778 pub fn connect_gtk_alternative_sort_arrows_notify<F: Fn(&Self) + 'static>(
1779 &self,
1780 f: F,
1781 ) -> SignalHandlerId {
1782 unsafe extern "C" fn notify_gtk_alternative_sort_arrows_trampoline<
1783 F: Fn(&Settings) + 'static,
1784 >(
1785 this: *mut ffi::GtkSettings,
1786 _param_spec: glib::ffi::gpointer,
1787 f: glib::ffi::gpointer,
1788 ) {
1789 let f: &F = &*(f as *const F);
1790 f(&from_glib_borrow(this))
1791 }
1792 unsafe {
1793 let f: Box_<F> = Box_::new(f);
1794 connect_raw(
1795 self.as_ptr() as *mut _,
1796 c"notify::gtk-alternative-sort-arrows".as_ptr() as *const _,
1797 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1798 notify_gtk_alternative_sort_arrows_trampoline::<F> as *const (),
1799 )),
1800 Box_::into_raw(f),
1801 )
1802 }
1803 }
1804
1805 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
1806 #[doc(alias = "gtk-application-prefer-dark-theme")]
1807 pub fn connect_gtk_application_prefer_dark_theme_notify<F: Fn(&Self) + 'static>(
1808 &self,
1809 f: F,
1810 ) -> SignalHandlerId {
1811 unsafe extern "C" fn notify_gtk_application_prefer_dark_theme_trampoline<
1812 F: Fn(&Settings) + 'static,
1813 >(
1814 this: *mut ffi::GtkSettings,
1815 _param_spec: glib::ffi::gpointer,
1816 f: glib::ffi::gpointer,
1817 ) {
1818 let f: &F = &*(f as *const F);
1819 f(&from_glib_borrow(this))
1820 }
1821 unsafe {
1822 let f: Box_<F> = Box_::new(f);
1823 connect_raw(
1824 self.as_ptr() as *mut _,
1825 c"notify::gtk-application-prefer-dark-theme".as_ptr() as *const _,
1826 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1827 notify_gtk_application_prefer_dark_theme_trampoline::<F> as *const (),
1828 )),
1829 Box_::into_raw(f),
1830 )
1831 }
1832 }
1833
1834 #[doc(alias = "gtk-cursor-aspect-ratio")]
1835 pub fn connect_gtk_cursor_aspect_ratio_notify<F: Fn(&Self) + 'static>(
1836 &self,
1837 f: F,
1838 ) -> SignalHandlerId {
1839 unsafe extern "C" fn notify_gtk_cursor_aspect_ratio_trampoline<
1840 F: Fn(&Settings) + 'static,
1841 >(
1842 this: *mut ffi::GtkSettings,
1843 _param_spec: glib::ffi::gpointer,
1844 f: glib::ffi::gpointer,
1845 ) {
1846 let f: &F = &*(f as *const F);
1847 f(&from_glib_borrow(this))
1848 }
1849 unsafe {
1850 let f: Box_<F> = Box_::new(f);
1851 connect_raw(
1852 self.as_ptr() as *mut _,
1853 c"notify::gtk-cursor-aspect-ratio".as_ptr() as *const _,
1854 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1855 notify_gtk_cursor_aspect_ratio_trampoline::<F> as *const (),
1856 )),
1857 Box_::into_raw(f),
1858 )
1859 }
1860 }
1861
1862 #[doc(alias = "gtk-cursor-blink")]
1863 pub fn connect_gtk_cursor_blink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1864 unsafe extern "C" fn notify_gtk_cursor_blink_trampoline<F: Fn(&Settings) + 'static>(
1865 this: *mut ffi::GtkSettings,
1866 _param_spec: glib::ffi::gpointer,
1867 f: glib::ffi::gpointer,
1868 ) {
1869 let f: &F = &*(f as *const F);
1870 f(&from_glib_borrow(this))
1871 }
1872 unsafe {
1873 let f: Box_<F> = Box_::new(f);
1874 connect_raw(
1875 self.as_ptr() as *mut _,
1876 c"notify::gtk-cursor-blink".as_ptr() as *const _,
1877 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1878 notify_gtk_cursor_blink_trampoline::<F> as *const (),
1879 )),
1880 Box_::into_raw(f),
1881 )
1882 }
1883 }
1884
1885 #[doc(alias = "gtk-cursor-blink-time")]
1886 pub fn connect_gtk_cursor_blink_time_notify<F: Fn(&Self) + 'static>(
1887 &self,
1888 f: F,
1889 ) -> SignalHandlerId {
1890 unsafe extern "C" fn notify_gtk_cursor_blink_time_trampoline<F: Fn(&Settings) + 'static>(
1891 this: *mut ffi::GtkSettings,
1892 _param_spec: glib::ffi::gpointer,
1893 f: glib::ffi::gpointer,
1894 ) {
1895 let f: &F = &*(f as *const F);
1896 f(&from_glib_borrow(this))
1897 }
1898 unsafe {
1899 let f: Box_<F> = Box_::new(f);
1900 connect_raw(
1901 self.as_ptr() as *mut _,
1902 c"notify::gtk-cursor-blink-time".as_ptr() as *const _,
1903 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1904 notify_gtk_cursor_blink_time_trampoline::<F> as *const (),
1905 )),
1906 Box_::into_raw(f),
1907 )
1908 }
1909 }
1910
1911 #[doc(alias = "gtk-cursor-blink-timeout")]
1912 pub fn connect_gtk_cursor_blink_timeout_notify<F: Fn(&Self) + 'static>(
1913 &self,
1914 f: F,
1915 ) -> SignalHandlerId {
1916 unsafe extern "C" fn notify_gtk_cursor_blink_timeout_trampoline<
1917 F: Fn(&Settings) + 'static,
1918 >(
1919 this: *mut ffi::GtkSettings,
1920 _param_spec: glib::ffi::gpointer,
1921 f: glib::ffi::gpointer,
1922 ) {
1923 let f: &F = &*(f as *const F);
1924 f(&from_glib_borrow(this))
1925 }
1926 unsafe {
1927 let f: Box_<F> = Box_::new(f);
1928 connect_raw(
1929 self.as_ptr() as *mut _,
1930 c"notify::gtk-cursor-blink-timeout".as_ptr() as *const _,
1931 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1932 notify_gtk_cursor_blink_timeout_trampoline::<F> as *const (),
1933 )),
1934 Box_::into_raw(f),
1935 )
1936 }
1937 }
1938
1939 #[doc(alias = "gtk-cursor-theme-name")]
1940 pub fn connect_gtk_cursor_theme_name_notify<F: Fn(&Self) + 'static>(
1941 &self,
1942 f: F,
1943 ) -> SignalHandlerId {
1944 unsafe extern "C" fn notify_gtk_cursor_theme_name_trampoline<F: Fn(&Settings) + 'static>(
1945 this: *mut ffi::GtkSettings,
1946 _param_spec: glib::ffi::gpointer,
1947 f: glib::ffi::gpointer,
1948 ) {
1949 let f: &F = &*(f as *const F);
1950 f(&from_glib_borrow(this))
1951 }
1952 unsafe {
1953 let f: Box_<F> = Box_::new(f);
1954 connect_raw(
1955 self.as_ptr() as *mut _,
1956 c"notify::gtk-cursor-theme-name".as_ptr() as *const _,
1957 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1958 notify_gtk_cursor_theme_name_trampoline::<F> as *const (),
1959 )),
1960 Box_::into_raw(f),
1961 )
1962 }
1963 }
1964
1965 #[doc(alias = "gtk-cursor-theme-size")]
1966 pub fn connect_gtk_cursor_theme_size_notify<F: Fn(&Self) + 'static>(
1967 &self,
1968 f: F,
1969 ) -> SignalHandlerId {
1970 unsafe extern "C" fn notify_gtk_cursor_theme_size_trampoline<F: Fn(&Settings) + 'static>(
1971 this: *mut ffi::GtkSettings,
1972 _param_spec: glib::ffi::gpointer,
1973 f: glib::ffi::gpointer,
1974 ) {
1975 let f: &F = &*(f as *const F);
1976 f(&from_glib_borrow(this))
1977 }
1978 unsafe {
1979 let f: Box_<F> = Box_::new(f);
1980 connect_raw(
1981 self.as_ptr() as *mut _,
1982 c"notify::gtk-cursor-theme-size".as_ptr() as *const _,
1983 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1984 notify_gtk_cursor_theme_size_trampoline::<F> as *const (),
1985 )),
1986 Box_::into_raw(f),
1987 )
1988 }
1989 }
1990
1991 #[doc(alias = "gtk-decoration-layout")]
1992 pub fn connect_gtk_decoration_layout_notify<F: Fn(&Self) + 'static>(
1993 &self,
1994 f: F,
1995 ) -> SignalHandlerId {
1996 unsafe extern "C" fn notify_gtk_decoration_layout_trampoline<F: Fn(&Settings) + 'static>(
1997 this: *mut ffi::GtkSettings,
1998 _param_spec: glib::ffi::gpointer,
1999 f: glib::ffi::gpointer,
2000 ) {
2001 let f: &F = &*(f as *const F);
2002 f(&from_glib_borrow(this))
2003 }
2004 unsafe {
2005 let f: Box_<F> = Box_::new(f);
2006 connect_raw(
2007 self.as_ptr() as *mut _,
2008 c"notify::gtk-decoration-layout".as_ptr() as *const _,
2009 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2010 notify_gtk_decoration_layout_trampoline::<F> as *const (),
2011 )),
2012 Box_::into_raw(f),
2013 )
2014 }
2015 }
2016
2017 #[doc(alias = "gtk-dialogs-use-header")]
2018 pub fn connect_gtk_dialogs_use_header_notify<F: Fn(&Self) + 'static>(
2019 &self,
2020 f: F,
2021 ) -> SignalHandlerId {
2022 unsafe extern "C" fn notify_gtk_dialogs_use_header_trampoline<
2023 F: Fn(&Settings) + 'static,
2024 >(
2025 this: *mut ffi::GtkSettings,
2026 _param_spec: glib::ffi::gpointer,
2027 f: glib::ffi::gpointer,
2028 ) {
2029 let f: &F = &*(f as *const F);
2030 f(&from_glib_borrow(this))
2031 }
2032 unsafe {
2033 let f: Box_<F> = Box_::new(f);
2034 connect_raw(
2035 self.as_ptr() as *mut _,
2036 c"notify::gtk-dialogs-use-header".as_ptr() as *const _,
2037 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2038 notify_gtk_dialogs_use_header_trampoline::<F> as *const (),
2039 )),
2040 Box_::into_raw(f),
2041 )
2042 }
2043 }
2044
2045 #[doc(alias = "gtk-dnd-drag-threshold")]
2046 pub fn connect_gtk_dnd_drag_threshold_notify<F: Fn(&Self) + 'static>(
2047 &self,
2048 f: F,
2049 ) -> SignalHandlerId {
2050 unsafe extern "C" fn notify_gtk_dnd_drag_threshold_trampoline<
2051 F: Fn(&Settings) + 'static,
2052 >(
2053 this: *mut ffi::GtkSettings,
2054 _param_spec: glib::ffi::gpointer,
2055 f: glib::ffi::gpointer,
2056 ) {
2057 let f: &F = &*(f as *const F);
2058 f(&from_glib_borrow(this))
2059 }
2060 unsafe {
2061 let f: Box_<F> = Box_::new(f);
2062 connect_raw(
2063 self.as_ptr() as *mut _,
2064 c"notify::gtk-dnd-drag-threshold".as_ptr() as *const _,
2065 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2066 notify_gtk_dnd_drag_threshold_trampoline::<F> as *const (),
2067 )),
2068 Box_::into_raw(f),
2069 )
2070 }
2071 }
2072
2073 #[doc(alias = "gtk-double-click-distance")]
2074 pub fn connect_gtk_double_click_distance_notify<F: Fn(&Self) + 'static>(
2075 &self,
2076 f: F,
2077 ) -> SignalHandlerId {
2078 unsafe extern "C" fn notify_gtk_double_click_distance_trampoline<
2079 F: Fn(&Settings) + 'static,
2080 >(
2081 this: *mut ffi::GtkSettings,
2082 _param_spec: glib::ffi::gpointer,
2083 f: glib::ffi::gpointer,
2084 ) {
2085 let f: &F = &*(f as *const F);
2086 f(&from_glib_borrow(this))
2087 }
2088 unsafe {
2089 let f: Box_<F> = Box_::new(f);
2090 connect_raw(
2091 self.as_ptr() as *mut _,
2092 c"notify::gtk-double-click-distance".as_ptr() as *const _,
2093 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2094 notify_gtk_double_click_distance_trampoline::<F> as *const (),
2095 )),
2096 Box_::into_raw(f),
2097 )
2098 }
2099 }
2100
2101 #[doc(alias = "gtk-double-click-time")]
2102 pub fn connect_gtk_double_click_time_notify<F: Fn(&Self) + 'static>(
2103 &self,
2104 f: F,
2105 ) -> SignalHandlerId {
2106 unsafe extern "C" fn notify_gtk_double_click_time_trampoline<F: Fn(&Settings) + 'static>(
2107 this: *mut ffi::GtkSettings,
2108 _param_spec: glib::ffi::gpointer,
2109 f: glib::ffi::gpointer,
2110 ) {
2111 let f: &F = &*(f as *const F);
2112 f(&from_glib_borrow(this))
2113 }
2114 unsafe {
2115 let f: Box_<F> = Box_::new(f);
2116 connect_raw(
2117 self.as_ptr() as *mut _,
2118 c"notify::gtk-double-click-time".as_ptr() as *const _,
2119 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2120 notify_gtk_double_click_time_trampoline::<F> as *const (),
2121 )),
2122 Box_::into_raw(f),
2123 )
2124 }
2125 }
2126
2127 #[doc(alias = "gtk-enable-accels")]
2128 pub fn connect_gtk_enable_accels_notify<F: Fn(&Self) + 'static>(
2129 &self,
2130 f: F,
2131 ) -> SignalHandlerId {
2132 unsafe extern "C" fn notify_gtk_enable_accels_trampoline<F: Fn(&Settings) + 'static>(
2133 this: *mut ffi::GtkSettings,
2134 _param_spec: glib::ffi::gpointer,
2135 f: glib::ffi::gpointer,
2136 ) {
2137 let f: &F = &*(f as *const F);
2138 f(&from_glib_borrow(this))
2139 }
2140 unsafe {
2141 let f: Box_<F> = Box_::new(f);
2142 connect_raw(
2143 self.as_ptr() as *mut _,
2144 c"notify::gtk-enable-accels".as_ptr() as *const _,
2145 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2146 notify_gtk_enable_accels_trampoline::<F> as *const (),
2147 )),
2148 Box_::into_raw(f),
2149 )
2150 }
2151 }
2152
2153 #[doc(alias = "gtk-enable-animations")]
2154 pub fn connect_gtk_enable_animations_notify<F: Fn(&Self) + 'static>(
2155 &self,
2156 f: F,
2157 ) -> SignalHandlerId {
2158 unsafe extern "C" fn notify_gtk_enable_animations_trampoline<F: Fn(&Settings) + 'static>(
2159 this: *mut ffi::GtkSettings,
2160 _param_spec: glib::ffi::gpointer,
2161 f: glib::ffi::gpointer,
2162 ) {
2163 let f: &F = &*(f as *const F);
2164 f(&from_glib_borrow(this))
2165 }
2166 unsafe {
2167 let f: Box_<F> = Box_::new(f);
2168 connect_raw(
2169 self.as_ptr() as *mut _,
2170 c"notify::gtk-enable-animations".as_ptr() as *const _,
2171 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2172 notify_gtk_enable_animations_trampoline::<F> as *const (),
2173 )),
2174 Box_::into_raw(f),
2175 )
2176 }
2177 }
2178
2179 #[doc(alias = "gtk-enable-event-sounds")]
2180 pub fn connect_gtk_enable_event_sounds_notify<F: Fn(&Self) + 'static>(
2181 &self,
2182 f: F,
2183 ) -> SignalHandlerId {
2184 unsafe extern "C" fn notify_gtk_enable_event_sounds_trampoline<
2185 F: Fn(&Settings) + 'static,
2186 >(
2187 this: *mut ffi::GtkSettings,
2188 _param_spec: glib::ffi::gpointer,
2189 f: glib::ffi::gpointer,
2190 ) {
2191 let f: &F = &*(f as *const F);
2192 f(&from_glib_borrow(this))
2193 }
2194 unsafe {
2195 let f: Box_<F> = Box_::new(f);
2196 connect_raw(
2197 self.as_ptr() as *mut _,
2198 c"notify::gtk-enable-event-sounds".as_ptr() as *const _,
2199 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2200 notify_gtk_enable_event_sounds_trampoline::<F> as *const (),
2201 )),
2202 Box_::into_raw(f),
2203 )
2204 }
2205 }
2206
2207 #[doc(alias = "gtk-enable-input-feedback-sounds")]
2208 pub fn connect_gtk_enable_input_feedback_sounds_notify<F: Fn(&Self) + 'static>(
2209 &self,
2210 f: F,
2211 ) -> SignalHandlerId {
2212 unsafe extern "C" fn notify_gtk_enable_input_feedback_sounds_trampoline<
2213 F: Fn(&Settings) + 'static,
2214 >(
2215 this: *mut ffi::GtkSettings,
2216 _param_spec: glib::ffi::gpointer,
2217 f: glib::ffi::gpointer,
2218 ) {
2219 let f: &F = &*(f as *const F);
2220 f(&from_glib_borrow(this))
2221 }
2222 unsafe {
2223 let f: Box_<F> = Box_::new(f);
2224 connect_raw(
2225 self.as_ptr() as *mut _,
2226 c"notify::gtk-enable-input-feedback-sounds".as_ptr() as *const _,
2227 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2228 notify_gtk_enable_input_feedback_sounds_trampoline::<F> as *const (),
2229 )),
2230 Box_::into_raw(f),
2231 )
2232 }
2233 }
2234
2235 #[doc(alias = "gtk-enable-primary-paste")]
2236 pub fn connect_gtk_enable_primary_paste_notify<F: Fn(&Self) + 'static>(
2237 &self,
2238 f: F,
2239 ) -> SignalHandlerId {
2240 unsafe extern "C" fn notify_gtk_enable_primary_paste_trampoline<
2241 F: Fn(&Settings) + 'static,
2242 >(
2243 this: *mut ffi::GtkSettings,
2244 _param_spec: glib::ffi::gpointer,
2245 f: glib::ffi::gpointer,
2246 ) {
2247 let f: &F = &*(f as *const F);
2248 f(&from_glib_borrow(this))
2249 }
2250 unsafe {
2251 let f: Box_<F> = Box_::new(f);
2252 connect_raw(
2253 self.as_ptr() as *mut _,
2254 c"notify::gtk-enable-primary-paste".as_ptr() as *const _,
2255 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2256 notify_gtk_enable_primary_paste_trampoline::<F> as *const (),
2257 )),
2258 Box_::into_raw(f),
2259 )
2260 }
2261 }
2262
2263 #[doc(alias = "gtk-entry-password-hint-timeout")]
2264 pub fn connect_gtk_entry_password_hint_timeout_notify<F: Fn(&Self) + 'static>(
2265 &self,
2266 f: F,
2267 ) -> SignalHandlerId {
2268 unsafe extern "C" fn notify_gtk_entry_password_hint_timeout_trampoline<
2269 F: Fn(&Settings) + 'static,
2270 >(
2271 this: *mut ffi::GtkSettings,
2272 _param_spec: glib::ffi::gpointer,
2273 f: glib::ffi::gpointer,
2274 ) {
2275 let f: &F = &*(f as *const F);
2276 f(&from_glib_borrow(this))
2277 }
2278 unsafe {
2279 let f: Box_<F> = Box_::new(f);
2280 connect_raw(
2281 self.as_ptr() as *mut _,
2282 c"notify::gtk-entry-password-hint-timeout".as_ptr() as *const _,
2283 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2284 notify_gtk_entry_password_hint_timeout_trampoline::<F> as *const (),
2285 )),
2286 Box_::into_raw(f),
2287 )
2288 }
2289 }
2290
2291 #[doc(alias = "gtk-entry-select-on-focus")]
2292 pub fn connect_gtk_entry_select_on_focus_notify<F: Fn(&Self) + 'static>(
2293 &self,
2294 f: F,
2295 ) -> SignalHandlerId {
2296 unsafe extern "C" fn notify_gtk_entry_select_on_focus_trampoline<
2297 F: Fn(&Settings) + 'static,
2298 >(
2299 this: *mut ffi::GtkSettings,
2300 _param_spec: glib::ffi::gpointer,
2301 f: glib::ffi::gpointer,
2302 ) {
2303 let f: &F = &*(f as *const F);
2304 f(&from_glib_borrow(this))
2305 }
2306 unsafe {
2307 let f: Box_<F> = Box_::new(f);
2308 connect_raw(
2309 self.as_ptr() as *mut _,
2310 c"notify::gtk-entry-select-on-focus".as_ptr() as *const _,
2311 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2312 notify_gtk_entry_select_on_focus_trampoline::<F> as *const (),
2313 )),
2314 Box_::into_raw(f),
2315 )
2316 }
2317 }
2318
2319 #[doc(alias = "gtk-error-bell")]
2320 pub fn connect_gtk_error_bell_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2321 unsafe extern "C" fn notify_gtk_error_bell_trampoline<F: Fn(&Settings) + 'static>(
2322 this: *mut ffi::GtkSettings,
2323 _param_spec: glib::ffi::gpointer,
2324 f: glib::ffi::gpointer,
2325 ) {
2326 let f: &F = &*(f as *const F);
2327 f(&from_glib_borrow(this))
2328 }
2329 unsafe {
2330 let f: Box_<F> = Box_::new(f);
2331 connect_raw(
2332 self.as_ptr() as *mut _,
2333 c"notify::gtk-error-bell".as_ptr() as *const _,
2334 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2335 notify_gtk_error_bell_trampoline::<F> as *const (),
2336 )),
2337 Box_::into_raw(f),
2338 )
2339 }
2340 }
2341
2342 #[doc(alias = "gtk-font-name")]
2343 pub fn connect_gtk_font_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2344 unsafe extern "C" fn notify_gtk_font_name_trampoline<F: Fn(&Settings) + 'static>(
2345 this: *mut ffi::GtkSettings,
2346 _param_spec: glib::ffi::gpointer,
2347 f: glib::ffi::gpointer,
2348 ) {
2349 let f: &F = &*(f as *const F);
2350 f(&from_glib_borrow(this))
2351 }
2352 unsafe {
2353 let f: Box_<F> = Box_::new(f);
2354 connect_raw(
2355 self.as_ptr() as *mut _,
2356 c"notify::gtk-font-name".as_ptr() as *const _,
2357 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2358 notify_gtk_font_name_trampoline::<F> as *const (),
2359 )),
2360 Box_::into_raw(f),
2361 )
2362 }
2363 }
2364
2365 #[cfg(feature = "v4_16")]
2366 #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
2367 #[doc(alias = "gtk-font-rendering")]
2368 pub fn connect_gtk_font_rendering_notify<F: Fn(&Self) + 'static>(
2369 &self,
2370 f: F,
2371 ) -> SignalHandlerId {
2372 unsafe extern "C" fn notify_gtk_font_rendering_trampoline<F: Fn(&Settings) + 'static>(
2373 this: *mut ffi::GtkSettings,
2374 _param_spec: glib::ffi::gpointer,
2375 f: glib::ffi::gpointer,
2376 ) {
2377 let f: &F = &*(f as *const F);
2378 f(&from_glib_borrow(this))
2379 }
2380 unsafe {
2381 let f: Box_<F> = Box_::new(f);
2382 connect_raw(
2383 self.as_ptr() as *mut _,
2384 c"notify::gtk-font-rendering".as_ptr() as *const _,
2385 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2386 notify_gtk_font_rendering_trampoline::<F> as *const (),
2387 )),
2388 Box_::into_raw(f),
2389 )
2390 }
2391 }
2392
2393 #[doc(alias = "gtk-fontconfig-timestamp")]
2394 pub fn connect_gtk_fontconfig_timestamp_notify<F: Fn(&Self) + 'static>(
2395 &self,
2396 f: F,
2397 ) -> SignalHandlerId {
2398 unsafe extern "C" fn notify_gtk_fontconfig_timestamp_trampoline<
2399 F: Fn(&Settings) + 'static,
2400 >(
2401 this: *mut ffi::GtkSettings,
2402 _param_spec: glib::ffi::gpointer,
2403 f: glib::ffi::gpointer,
2404 ) {
2405 let f: &F = &*(f as *const F);
2406 f(&from_glib_borrow(this))
2407 }
2408 unsafe {
2409 let f: Box_<F> = Box_::new(f);
2410 connect_raw(
2411 self.as_ptr() as *mut _,
2412 c"notify::gtk-fontconfig-timestamp".as_ptr() as *const _,
2413 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2414 notify_gtk_fontconfig_timestamp_trampoline::<F> as *const (),
2415 )),
2416 Box_::into_raw(f),
2417 )
2418 }
2419 }
2420
2421 #[cfg(feature = "v4_6")]
2422 #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
2423 #[doc(alias = "gtk-hint-font-metrics")]
2424 pub fn connect_gtk_hint_font_metrics_notify<F: Fn(&Self) + 'static>(
2425 &self,
2426 f: F,
2427 ) -> SignalHandlerId {
2428 unsafe extern "C" fn notify_gtk_hint_font_metrics_trampoline<F: Fn(&Settings) + 'static>(
2429 this: *mut ffi::GtkSettings,
2430 _param_spec: glib::ffi::gpointer,
2431 f: glib::ffi::gpointer,
2432 ) {
2433 let f: &F = &*(f as *const F);
2434 f(&from_glib_borrow(this))
2435 }
2436 unsafe {
2437 let f: Box_<F> = Box_::new(f);
2438 connect_raw(
2439 self.as_ptr() as *mut _,
2440 c"notify::gtk-hint-font-metrics".as_ptr() as *const _,
2441 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2442 notify_gtk_hint_font_metrics_trampoline::<F> as *const (),
2443 )),
2444 Box_::into_raw(f),
2445 )
2446 }
2447 }
2448
2449 #[doc(alias = "gtk-icon-theme-name")]
2450 pub fn connect_gtk_icon_theme_name_notify<F: Fn(&Self) + 'static>(
2451 &self,
2452 f: F,
2453 ) -> SignalHandlerId {
2454 unsafe extern "C" fn notify_gtk_icon_theme_name_trampoline<F: Fn(&Settings) + 'static>(
2455 this: *mut ffi::GtkSettings,
2456 _param_spec: glib::ffi::gpointer,
2457 f: glib::ffi::gpointer,
2458 ) {
2459 let f: &F = &*(f as *const F);
2460 f(&from_glib_borrow(this))
2461 }
2462 unsafe {
2463 let f: Box_<F> = Box_::new(f);
2464 connect_raw(
2465 self.as_ptr() as *mut _,
2466 c"notify::gtk-icon-theme-name".as_ptr() as *const _,
2467 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2468 notify_gtk_icon_theme_name_trampoline::<F> as *const (),
2469 )),
2470 Box_::into_raw(f),
2471 )
2472 }
2473 }
2474
2475 #[doc(alias = "gtk-im-module")]
2476 pub fn connect_gtk_im_module_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2477 unsafe extern "C" fn notify_gtk_im_module_trampoline<F: Fn(&Settings) + 'static>(
2478 this: *mut ffi::GtkSettings,
2479 _param_spec: glib::ffi::gpointer,
2480 f: glib::ffi::gpointer,
2481 ) {
2482 let f: &F = &*(f as *const F);
2483 f(&from_glib_borrow(this))
2484 }
2485 unsafe {
2486 let f: Box_<F> = Box_::new(f);
2487 connect_raw(
2488 self.as_ptr() as *mut _,
2489 c"notify::gtk-im-module".as_ptr() as *const _,
2490 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2491 notify_gtk_im_module_trampoline::<F> as *const (),
2492 )),
2493 Box_::into_raw(f),
2494 )
2495 }
2496 }
2497
2498 #[cfg(feature = "v4_20")]
2499 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2500 #[doc(alias = "gtk-interface-color-scheme")]
2501 pub fn connect_gtk_interface_color_scheme_notify<F: Fn(&Self) + 'static>(
2502 &self,
2503 f: F,
2504 ) -> SignalHandlerId {
2505 unsafe extern "C" fn notify_gtk_interface_color_scheme_trampoline<
2506 F: Fn(&Settings) + 'static,
2507 >(
2508 this: *mut ffi::GtkSettings,
2509 _param_spec: glib::ffi::gpointer,
2510 f: glib::ffi::gpointer,
2511 ) {
2512 let f: &F = &*(f as *const F);
2513 f(&from_glib_borrow(this))
2514 }
2515 unsafe {
2516 let f: Box_<F> = Box_::new(f);
2517 connect_raw(
2518 self.as_ptr() as *mut _,
2519 c"notify::gtk-interface-color-scheme".as_ptr() as *const _,
2520 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2521 notify_gtk_interface_color_scheme_trampoline::<F> as *const (),
2522 )),
2523 Box_::into_raw(f),
2524 )
2525 }
2526 }
2527
2528 #[cfg(feature = "v4_20")]
2529 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2530 #[doc(alias = "gtk-interface-contrast")]
2531 pub fn connect_gtk_interface_contrast_notify<F: Fn(&Self) + 'static>(
2532 &self,
2533 f: F,
2534 ) -> SignalHandlerId {
2535 unsafe extern "C" fn notify_gtk_interface_contrast_trampoline<
2536 F: Fn(&Settings) + 'static,
2537 >(
2538 this: *mut ffi::GtkSettings,
2539 _param_spec: glib::ffi::gpointer,
2540 f: glib::ffi::gpointer,
2541 ) {
2542 let f: &F = &*(f as *const F);
2543 f(&from_glib_borrow(this))
2544 }
2545 unsafe {
2546 let f: Box_<F> = Box_::new(f);
2547 connect_raw(
2548 self.as_ptr() as *mut _,
2549 c"notify::gtk-interface-contrast".as_ptr() as *const _,
2550 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2551 notify_gtk_interface_contrast_trampoline::<F> as *const (),
2552 )),
2553 Box_::into_raw(f),
2554 )
2555 }
2556 }
2557
2558 #[doc(alias = "gtk-keynav-use-caret")]
2559 pub fn connect_gtk_keynav_use_caret_notify<F: Fn(&Self) + 'static>(
2560 &self,
2561 f: F,
2562 ) -> SignalHandlerId {
2563 unsafe extern "C" fn notify_gtk_keynav_use_caret_trampoline<F: Fn(&Settings) + 'static>(
2564 this: *mut ffi::GtkSettings,
2565 _param_spec: glib::ffi::gpointer,
2566 f: glib::ffi::gpointer,
2567 ) {
2568 let f: &F = &*(f as *const F);
2569 f(&from_glib_borrow(this))
2570 }
2571 unsafe {
2572 let f: Box_<F> = Box_::new(f);
2573 connect_raw(
2574 self.as_ptr() as *mut _,
2575 c"notify::gtk-keynav-use-caret".as_ptr() as *const _,
2576 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2577 notify_gtk_keynav_use_caret_trampoline::<F> as *const (),
2578 )),
2579 Box_::into_raw(f),
2580 )
2581 }
2582 }
2583
2584 #[doc(alias = "gtk-label-select-on-focus")]
2585 pub fn connect_gtk_label_select_on_focus_notify<F: Fn(&Self) + 'static>(
2586 &self,
2587 f: F,
2588 ) -> SignalHandlerId {
2589 unsafe extern "C" fn notify_gtk_label_select_on_focus_trampoline<
2590 F: Fn(&Settings) + 'static,
2591 >(
2592 this: *mut ffi::GtkSettings,
2593 _param_spec: glib::ffi::gpointer,
2594 f: glib::ffi::gpointer,
2595 ) {
2596 let f: &F = &*(f as *const F);
2597 f(&from_glib_borrow(this))
2598 }
2599 unsafe {
2600 let f: Box_<F> = Box_::new(f);
2601 connect_raw(
2602 self.as_ptr() as *mut _,
2603 c"notify::gtk-label-select-on-focus".as_ptr() as *const _,
2604 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2605 notify_gtk_label_select_on_focus_trampoline::<F> as *const (),
2606 )),
2607 Box_::into_raw(f),
2608 )
2609 }
2610 }
2611
2612 #[doc(alias = "gtk-long-press-time")]
2613 pub fn connect_gtk_long_press_time_notify<F: Fn(&Self) + 'static>(
2614 &self,
2615 f: F,
2616 ) -> SignalHandlerId {
2617 unsafe extern "C" fn notify_gtk_long_press_time_trampoline<F: Fn(&Settings) + 'static>(
2618 this: *mut ffi::GtkSettings,
2619 _param_spec: glib::ffi::gpointer,
2620 f: glib::ffi::gpointer,
2621 ) {
2622 let f: &F = &*(f as *const F);
2623 f(&from_glib_borrow(this))
2624 }
2625 unsafe {
2626 let f: Box_<F> = Box_::new(f);
2627 connect_raw(
2628 self.as_ptr() as *mut _,
2629 c"notify::gtk-long-press-time".as_ptr() as *const _,
2630 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2631 notify_gtk_long_press_time_trampoline::<F> as *const (),
2632 )),
2633 Box_::into_raw(f),
2634 )
2635 }
2636 }
2637
2638 #[doc(alias = "gtk-overlay-scrolling")]
2639 pub fn connect_gtk_overlay_scrolling_notify<F: Fn(&Self) + 'static>(
2640 &self,
2641 f: F,
2642 ) -> SignalHandlerId {
2643 unsafe extern "C" fn notify_gtk_overlay_scrolling_trampoline<F: Fn(&Settings) + 'static>(
2644 this: *mut ffi::GtkSettings,
2645 _param_spec: glib::ffi::gpointer,
2646 f: glib::ffi::gpointer,
2647 ) {
2648 let f: &F = &*(f as *const F);
2649 f(&from_glib_borrow(this))
2650 }
2651 unsafe {
2652 let f: Box_<F> = Box_::new(f);
2653 connect_raw(
2654 self.as_ptr() as *mut _,
2655 c"notify::gtk-overlay-scrolling".as_ptr() as *const _,
2656 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2657 notify_gtk_overlay_scrolling_trampoline::<F> as *const (),
2658 )),
2659 Box_::into_raw(f),
2660 )
2661 }
2662 }
2663
2664 #[doc(alias = "gtk-primary-button-warps-slider")]
2665 pub fn connect_gtk_primary_button_warps_slider_notify<F: Fn(&Self) + 'static>(
2666 &self,
2667 f: F,
2668 ) -> SignalHandlerId {
2669 unsafe extern "C" fn notify_gtk_primary_button_warps_slider_trampoline<
2670 F: Fn(&Settings) + 'static,
2671 >(
2672 this: *mut ffi::GtkSettings,
2673 _param_spec: glib::ffi::gpointer,
2674 f: glib::ffi::gpointer,
2675 ) {
2676 let f: &F = &*(f as *const F);
2677 f(&from_glib_borrow(this))
2678 }
2679 unsafe {
2680 let f: Box_<F> = Box_::new(f);
2681 connect_raw(
2682 self.as_ptr() as *mut _,
2683 c"notify::gtk-primary-button-warps-slider".as_ptr() as *const _,
2684 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2685 notify_gtk_primary_button_warps_slider_trampoline::<F> as *const (),
2686 )),
2687 Box_::into_raw(f),
2688 )
2689 }
2690 }
2691
2692 #[doc(alias = "gtk-print-backends")]
2693 pub fn connect_gtk_print_backends_notify<F: Fn(&Self) + 'static>(
2694 &self,
2695 f: F,
2696 ) -> SignalHandlerId {
2697 unsafe extern "C" fn notify_gtk_print_backends_trampoline<F: Fn(&Settings) + 'static>(
2698 this: *mut ffi::GtkSettings,
2699 _param_spec: glib::ffi::gpointer,
2700 f: glib::ffi::gpointer,
2701 ) {
2702 let f: &F = &*(f as *const F);
2703 f(&from_glib_borrow(this))
2704 }
2705 unsafe {
2706 let f: Box_<F> = Box_::new(f);
2707 connect_raw(
2708 self.as_ptr() as *mut _,
2709 c"notify::gtk-print-backends".as_ptr() as *const _,
2710 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2711 notify_gtk_print_backends_trampoline::<F> as *const (),
2712 )),
2713 Box_::into_raw(f),
2714 )
2715 }
2716 }
2717
2718 #[doc(alias = "gtk-print-preview-command")]
2719 pub fn connect_gtk_print_preview_command_notify<F: Fn(&Self) + 'static>(
2720 &self,
2721 f: F,
2722 ) -> SignalHandlerId {
2723 unsafe extern "C" fn notify_gtk_print_preview_command_trampoline<
2724 F: Fn(&Settings) + 'static,
2725 >(
2726 this: *mut ffi::GtkSettings,
2727 _param_spec: glib::ffi::gpointer,
2728 f: glib::ffi::gpointer,
2729 ) {
2730 let f: &F = &*(f as *const F);
2731 f(&from_glib_borrow(this))
2732 }
2733 unsafe {
2734 let f: Box_<F> = Box_::new(f);
2735 connect_raw(
2736 self.as_ptr() as *mut _,
2737 c"notify::gtk-print-preview-command".as_ptr() as *const _,
2738 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2739 notify_gtk_print_preview_command_trampoline::<F> as *const (),
2740 )),
2741 Box_::into_raw(f),
2742 )
2743 }
2744 }
2745
2746 #[doc(alias = "gtk-recent-files-enabled")]
2747 pub fn connect_gtk_recent_files_enabled_notify<F: Fn(&Self) + 'static>(
2748 &self,
2749 f: F,
2750 ) -> SignalHandlerId {
2751 unsafe extern "C" fn notify_gtk_recent_files_enabled_trampoline<
2752 F: Fn(&Settings) + 'static,
2753 >(
2754 this: *mut ffi::GtkSettings,
2755 _param_spec: glib::ffi::gpointer,
2756 f: glib::ffi::gpointer,
2757 ) {
2758 let f: &F = &*(f as *const F);
2759 f(&from_glib_borrow(this))
2760 }
2761 unsafe {
2762 let f: Box_<F> = Box_::new(f);
2763 connect_raw(
2764 self.as_ptr() as *mut _,
2765 c"notify::gtk-recent-files-enabled".as_ptr() as *const _,
2766 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2767 notify_gtk_recent_files_enabled_trampoline::<F> as *const (),
2768 )),
2769 Box_::into_raw(f),
2770 )
2771 }
2772 }
2773
2774 #[doc(alias = "gtk-recent-files-max-age")]
2775 pub fn connect_gtk_recent_files_max_age_notify<F: Fn(&Self) + 'static>(
2776 &self,
2777 f: F,
2778 ) -> SignalHandlerId {
2779 unsafe extern "C" fn notify_gtk_recent_files_max_age_trampoline<
2780 F: Fn(&Settings) + 'static,
2781 >(
2782 this: *mut ffi::GtkSettings,
2783 _param_spec: glib::ffi::gpointer,
2784 f: glib::ffi::gpointer,
2785 ) {
2786 let f: &F = &*(f as *const F);
2787 f(&from_glib_borrow(this))
2788 }
2789 unsafe {
2790 let f: Box_<F> = Box_::new(f);
2791 connect_raw(
2792 self.as_ptr() as *mut _,
2793 c"notify::gtk-recent-files-max-age".as_ptr() as *const _,
2794 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2795 notify_gtk_recent_files_max_age_trampoline::<F> as *const (),
2796 )),
2797 Box_::into_raw(f),
2798 )
2799 }
2800 }
2801
2802 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
2803 #[doc(alias = "gtk-shell-shows-app-menu")]
2804 pub fn connect_gtk_shell_shows_app_menu_notify<F: Fn(&Self) + 'static>(
2805 &self,
2806 f: F,
2807 ) -> SignalHandlerId {
2808 unsafe extern "C" fn notify_gtk_shell_shows_app_menu_trampoline<
2809 F: Fn(&Settings) + 'static,
2810 >(
2811 this: *mut ffi::GtkSettings,
2812 _param_spec: glib::ffi::gpointer,
2813 f: glib::ffi::gpointer,
2814 ) {
2815 let f: &F = &*(f as *const F);
2816 f(&from_glib_borrow(this))
2817 }
2818 unsafe {
2819 let f: Box_<F> = Box_::new(f);
2820 connect_raw(
2821 self.as_ptr() as *mut _,
2822 c"notify::gtk-shell-shows-app-menu".as_ptr() as *const _,
2823 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2824 notify_gtk_shell_shows_app_menu_trampoline::<F> as *const (),
2825 )),
2826 Box_::into_raw(f),
2827 )
2828 }
2829 }
2830
2831 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
2832 #[doc(alias = "gtk-shell-shows-desktop")]
2833 pub fn connect_gtk_shell_shows_desktop_notify<F: Fn(&Self) + 'static>(
2834 &self,
2835 f: F,
2836 ) -> SignalHandlerId {
2837 unsafe extern "C" fn notify_gtk_shell_shows_desktop_trampoline<
2838 F: Fn(&Settings) + 'static,
2839 >(
2840 this: *mut ffi::GtkSettings,
2841 _param_spec: glib::ffi::gpointer,
2842 f: glib::ffi::gpointer,
2843 ) {
2844 let f: &F = &*(f as *const F);
2845 f(&from_glib_borrow(this))
2846 }
2847 unsafe {
2848 let f: Box_<F> = Box_::new(f);
2849 connect_raw(
2850 self.as_ptr() as *mut _,
2851 c"notify::gtk-shell-shows-desktop".as_ptr() as *const _,
2852 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2853 notify_gtk_shell_shows_desktop_trampoline::<F> as *const (),
2854 )),
2855 Box_::into_raw(f),
2856 )
2857 }
2858 }
2859
2860 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
2861 #[doc(alias = "gtk-shell-shows-menubar")]
2862 pub fn connect_gtk_shell_shows_menubar_notify<F: Fn(&Self) + 'static>(
2863 &self,
2864 f: F,
2865 ) -> SignalHandlerId {
2866 unsafe extern "C" fn notify_gtk_shell_shows_menubar_trampoline<
2867 F: Fn(&Settings) + 'static,
2868 >(
2869 this: *mut ffi::GtkSettings,
2870 _param_spec: glib::ffi::gpointer,
2871 f: glib::ffi::gpointer,
2872 ) {
2873 let f: &F = &*(f as *const F);
2874 f(&from_glib_borrow(this))
2875 }
2876 unsafe {
2877 let f: Box_<F> = Box_::new(f);
2878 connect_raw(
2879 self.as_ptr() as *mut _,
2880 c"notify::gtk-shell-shows-menubar".as_ptr() as *const _,
2881 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2882 notify_gtk_shell_shows_menubar_trampoline::<F> as *const (),
2883 )),
2884 Box_::into_raw(f),
2885 )
2886 }
2887 }
2888
2889 #[cfg(feature = "v4_14")]
2890 #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
2891 #[doc(alias = "gtk-show-status-shapes")]
2892 pub fn connect_gtk_show_status_shapes_notify<F: Fn(&Self) + 'static>(
2893 &self,
2894 f: F,
2895 ) -> SignalHandlerId {
2896 unsafe extern "C" fn notify_gtk_show_status_shapes_trampoline<
2897 F: Fn(&Settings) + 'static,
2898 >(
2899 this: *mut ffi::GtkSettings,
2900 _param_spec: glib::ffi::gpointer,
2901 f: glib::ffi::gpointer,
2902 ) {
2903 let f: &F = &*(f as *const F);
2904 f(&from_glib_borrow(this))
2905 }
2906 unsafe {
2907 let f: Box_<F> = Box_::new(f);
2908 connect_raw(
2909 self.as_ptr() as *mut _,
2910 c"notify::gtk-show-status-shapes".as_ptr() as *const _,
2911 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2912 notify_gtk_show_status_shapes_trampoline::<F> as *const (),
2913 )),
2914 Box_::into_raw(f),
2915 )
2916 }
2917 }
2918
2919 #[doc(alias = "gtk-sound-theme-name")]
2920 pub fn connect_gtk_sound_theme_name_notify<F: Fn(&Self) + 'static>(
2921 &self,
2922 f: F,
2923 ) -> SignalHandlerId {
2924 unsafe extern "C" fn notify_gtk_sound_theme_name_trampoline<F: Fn(&Settings) + 'static>(
2925 this: *mut ffi::GtkSettings,
2926 _param_spec: glib::ffi::gpointer,
2927 f: glib::ffi::gpointer,
2928 ) {
2929 let f: &F = &*(f as *const F);
2930 f(&from_glib_borrow(this))
2931 }
2932 unsafe {
2933 let f: Box_<F> = Box_::new(f);
2934 connect_raw(
2935 self.as_ptr() as *mut _,
2936 c"notify::gtk-sound-theme-name".as_ptr() as *const _,
2937 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2938 notify_gtk_sound_theme_name_trampoline::<F> as *const (),
2939 )),
2940 Box_::into_raw(f),
2941 )
2942 }
2943 }
2944
2945 #[doc(alias = "gtk-split-cursor")]
2946 pub fn connect_gtk_split_cursor_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2947 unsafe extern "C" fn notify_gtk_split_cursor_trampoline<F: Fn(&Settings) + 'static>(
2948 this: *mut ffi::GtkSettings,
2949 _param_spec: glib::ffi::gpointer,
2950 f: glib::ffi::gpointer,
2951 ) {
2952 let f: &F = &*(f as *const F);
2953 f(&from_glib_borrow(this))
2954 }
2955 unsafe {
2956 let f: Box_<F> = Box_::new(f);
2957 connect_raw(
2958 self.as_ptr() as *mut _,
2959 c"notify::gtk-split-cursor".as_ptr() as *const _,
2960 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2961 notify_gtk_split_cursor_trampoline::<F> as *const (),
2962 )),
2963 Box_::into_raw(f),
2964 )
2965 }
2966 }
2967
2968 #[doc(alias = "gtk-theme-name")]
2969 pub fn connect_gtk_theme_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2970 unsafe extern "C" fn notify_gtk_theme_name_trampoline<F: Fn(&Settings) + 'static>(
2971 this: *mut ffi::GtkSettings,
2972 _param_spec: glib::ffi::gpointer,
2973 f: glib::ffi::gpointer,
2974 ) {
2975 let f: &F = &*(f as *const F);
2976 f(&from_glib_borrow(this))
2977 }
2978 unsafe {
2979 let f: Box_<F> = Box_::new(f);
2980 connect_raw(
2981 self.as_ptr() as *mut _,
2982 c"notify::gtk-theme-name".as_ptr() as *const _,
2983 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2984 notify_gtk_theme_name_trampoline::<F> as *const (),
2985 )),
2986 Box_::into_raw(f),
2987 )
2988 }
2989 }
2990
2991 #[doc(alias = "gtk-titlebar-double-click")]
2992 pub fn connect_gtk_titlebar_double_click_notify<F: Fn(&Self) + 'static>(
2993 &self,
2994 f: F,
2995 ) -> SignalHandlerId {
2996 unsafe extern "C" fn notify_gtk_titlebar_double_click_trampoline<
2997 F: Fn(&Settings) + 'static,
2998 >(
2999 this: *mut ffi::GtkSettings,
3000 _param_spec: glib::ffi::gpointer,
3001 f: glib::ffi::gpointer,
3002 ) {
3003 let f: &F = &*(f as *const F);
3004 f(&from_glib_borrow(this))
3005 }
3006 unsafe {
3007 let f: Box_<F> = Box_::new(f);
3008 connect_raw(
3009 self.as_ptr() as *mut _,
3010 c"notify::gtk-titlebar-double-click".as_ptr() as *const _,
3011 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3012 notify_gtk_titlebar_double_click_trampoline::<F> as *const (),
3013 )),
3014 Box_::into_raw(f),
3015 )
3016 }
3017 }
3018
3019 #[doc(alias = "gtk-titlebar-middle-click")]
3020 pub fn connect_gtk_titlebar_middle_click_notify<F: Fn(&Self) + 'static>(
3021 &self,
3022 f: F,
3023 ) -> SignalHandlerId {
3024 unsafe extern "C" fn notify_gtk_titlebar_middle_click_trampoline<
3025 F: Fn(&Settings) + 'static,
3026 >(
3027 this: *mut ffi::GtkSettings,
3028 _param_spec: glib::ffi::gpointer,
3029 f: glib::ffi::gpointer,
3030 ) {
3031 let f: &F = &*(f as *const F);
3032 f(&from_glib_borrow(this))
3033 }
3034 unsafe {
3035 let f: Box_<F> = Box_::new(f);
3036 connect_raw(
3037 self.as_ptr() as *mut _,
3038 c"notify::gtk-titlebar-middle-click".as_ptr() as *const _,
3039 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3040 notify_gtk_titlebar_middle_click_trampoline::<F> as *const (),
3041 )),
3042 Box_::into_raw(f),
3043 )
3044 }
3045 }
3046
3047 #[doc(alias = "gtk-titlebar-right-click")]
3048 pub fn connect_gtk_titlebar_right_click_notify<F: Fn(&Self) + 'static>(
3049 &self,
3050 f: F,
3051 ) -> SignalHandlerId {
3052 unsafe extern "C" fn notify_gtk_titlebar_right_click_trampoline<
3053 F: Fn(&Settings) + 'static,
3054 >(
3055 this: *mut ffi::GtkSettings,
3056 _param_spec: glib::ffi::gpointer,
3057 f: glib::ffi::gpointer,
3058 ) {
3059 let f: &F = &*(f as *const F);
3060 f(&from_glib_borrow(this))
3061 }
3062 unsafe {
3063 let f: Box_<F> = Box_::new(f);
3064 connect_raw(
3065 self.as_ptr() as *mut _,
3066 c"notify::gtk-titlebar-right-click".as_ptr() as *const _,
3067 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3068 notify_gtk_titlebar_right_click_trampoline::<F> as *const (),
3069 )),
3070 Box_::into_raw(f),
3071 )
3072 }
3073 }
3074
3075 #[doc(alias = "gtk-xft-antialias")]
3076 pub fn connect_gtk_xft_antialias_notify<F: Fn(&Self) + 'static>(
3077 &self,
3078 f: F,
3079 ) -> SignalHandlerId {
3080 unsafe extern "C" fn notify_gtk_xft_antialias_trampoline<F: Fn(&Settings) + 'static>(
3081 this: *mut ffi::GtkSettings,
3082 _param_spec: glib::ffi::gpointer,
3083 f: glib::ffi::gpointer,
3084 ) {
3085 let f: &F = &*(f as *const F);
3086 f(&from_glib_borrow(this))
3087 }
3088 unsafe {
3089 let f: Box_<F> = Box_::new(f);
3090 connect_raw(
3091 self.as_ptr() as *mut _,
3092 c"notify::gtk-xft-antialias".as_ptr() as *const _,
3093 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3094 notify_gtk_xft_antialias_trampoline::<F> as *const (),
3095 )),
3096 Box_::into_raw(f),
3097 )
3098 }
3099 }
3100
3101 #[doc(alias = "gtk-xft-dpi")]
3102 pub fn connect_gtk_xft_dpi_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3103 unsafe extern "C" fn notify_gtk_xft_dpi_trampoline<F: Fn(&Settings) + 'static>(
3104 this: *mut ffi::GtkSettings,
3105 _param_spec: glib::ffi::gpointer,
3106 f: glib::ffi::gpointer,
3107 ) {
3108 let f: &F = &*(f as *const F);
3109 f(&from_glib_borrow(this))
3110 }
3111 unsafe {
3112 let f: Box_<F> = Box_::new(f);
3113 connect_raw(
3114 self.as_ptr() as *mut _,
3115 c"notify::gtk-xft-dpi".as_ptr() as *const _,
3116 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3117 notify_gtk_xft_dpi_trampoline::<F> as *const (),
3118 )),
3119 Box_::into_raw(f),
3120 )
3121 }
3122 }
3123
3124 #[doc(alias = "gtk-xft-hinting")]
3125 pub fn connect_gtk_xft_hinting_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3126 unsafe extern "C" fn notify_gtk_xft_hinting_trampoline<F: Fn(&Settings) + 'static>(
3127 this: *mut ffi::GtkSettings,
3128 _param_spec: glib::ffi::gpointer,
3129 f: glib::ffi::gpointer,
3130 ) {
3131 let f: &F = &*(f as *const F);
3132 f(&from_glib_borrow(this))
3133 }
3134 unsafe {
3135 let f: Box_<F> = Box_::new(f);
3136 connect_raw(
3137 self.as_ptr() as *mut _,
3138 c"notify::gtk-xft-hinting".as_ptr() as *const _,
3139 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3140 notify_gtk_xft_hinting_trampoline::<F> as *const (),
3141 )),
3142 Box_::into_raw(f),
3143 )
3144 }
3145 }
3146
3147 #[doc(alias = "gtk-xft-hintstyle")]
3148 pub fn connect_gtk_xft_hintstyle_notify<F: Fn(&Self) + 'static>(
3149 &self,
3150 f: F,
3151 ) -> SignalHandlerId {
3152 unsafe extern "C" fn notify_gtk_xft_hintstyle_trampoline<F: Fn(&Settings) + 'static>(
3153 this: *mut ffi::GtkSettings,
3154 _param_spec: glib::ffi::gpointer,
3155 f: glib::ffi::gpointer,
3156 ) {
3157 let f: &F = &*(f as *const F);
3158 f(&from_glib_borrow(this))
3159 }
3160 unsafe {
3161 let f: Box_<F> = Box_::new(f);
3162 connect_raw(
3163 self.as_ptr() as *mut _,
3164 c"notify::gtk-xft-hintstyle".as_ptr() as *const _,
3165 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3166 notify_gtk_xft_hintstyle_trampoline::<F> as *const (),
3167 )),
3168 Box_::into_raw(f),
3169 )
3170 }
3171 }
3172
3173 #[doc(alias = "gtk-xft-rgba")]
3174 pub fn connect_gtk_xft_rgba_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3175 unsafe extern "C" fn notify_gtk_xft_rgba_trampoline<F: Fn(&Settings) + 'static>(
3176 this: *mut ffi::GtkSettings,
3177 _param_spec: glib::ffi::gpointer,
3178 f: glib::ffi::gpointer,
3179 ) {
3180 let f: &F = &*(f as *const F);
3181 f(&from_glib_borrow(this))
3182 }
3183 unsafe {
3184 let f: Box_<F> = Box_::new(f);
3185 connect_raw(
3186 self.as_ptr() as *mut _,
3187 c"notify::gtk-xft-rgba".as_ptr() as *const _,
3188 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3189 notify_gtk_xft_rgba_trampoline::<F> as *const (),
3190 )),
3191 Box_::into_raw(f),
3192 )
3193 }
3194 }
3195}
3196
3197// rustdoc-stripper-ignore-next
3198/// A [builder-pattern] type to construct [`Settings`] objects.
3199///
3200/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
3201#[must_use = "The builder must be built to be used"]
3202pub struct SettingsBuilder {
3203 builder: glib::object::ObjectBuilder<'static, Settings>,
3204}
3205
3206impl SettingsBuilder {
3207 fn new() -> Self {
3208 Self {
3209 builder: glib::object::Object::builder(),
3210 }
3211 }
3212
3213 /// Whether buttons in dialogs should use the alternative button order.
3214 pub fn gtk_alternative_button_order(self, gtk_alternative_button_order: bool) -> Self {
3215 Self {
3216 builder: self
3217 .builder
3218 .property("gtk-alternative-button-order", gtk_alternative_button_order),
3219 }
3220 }
3221
3222 /// Controls the direction of the sort indicators in sorted list and tree
3223 /// views.
3224 ///
3225 /// By default an arrow pointing down means the column is sorted
3226 /// in ascending order. When set to [`true`], this order will be inverted.
3227 pub fn gtk_alternative_sort_arrows(self, gtk_alternative_sort_arrows: bool) -> Self {
3228 Self {
3229 builder: self
3230 .builder
3231 .property("gtk-alternative-sort-arrows", gtk_alternative_sort_arrows),
3232 }
3233 }
3234
3235 /// Whether the application prefers to use a dark theme.
3236 ///
3237 /// If a GTK theme includes a dark variant, it will be used
3238 /// instead of the configured theme.
3239 ///
3240 /// Some applications benefit from minimizing the amount of light
3241 /// pollution that interferes with the content. Good candidates for
3242 /// dark themes are photo and video editors that make the actual
3243 /// content get all the attention and minimize the distraction of
3244 /// the chrome.
3245 ///
3246 /// Dark themes should not be used for documents, where large spaces
3247 /// are white/light and the dark chrome creates too much contrast
3248 /// (web browser, text editor...).
3249 /// Use [`CssProvider`][crate::CssProvider] properties instead
3250 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
3251 pub fn gtk_application_prefer_dark_theme(
3252 self,
3253 gtk_application_prefer_dark_theme: bool,
3254 ) -> Self {
3255 Self {
3256 builder: self.builder.property(
3257 "gtk-application-prefer-dark-theme",
3258 gtk_application_prefer_dark_theme,
3259 ),
3260 }
3261 }
3262
3263 /// The aspect ratio of the text caret.
3264 pub fn gtk_cursor_aspect_ratio(self, gtk_cursor_aspect_ratio: f64) -> Self {
3265 Self {
3266 builder: self
3267 .builder
3268 .property("gtk-cursor-aspect-ratio", gtk_cursor_aspect_ratio),
3269 }
3270 }
3271
3272 /// Whether the cursor should blink.
3273 ///
3274 /// Also see the [`gtk-cursor-blink-timeout`][struct@crate::Settings#gtk-cursor-blink-timeout] setting,
3275 /// which allows more flexible control over cursor blinking.
3276 pub fn gtk_cursor_blink(self, gtk_cursor_blink: bool) -> Self {
3277 Self {
3278 builder: self.builder.property("gtk-cursor-blink", gtk_cursor_blink),
3279 }
3280 }
3281
3282 /// Length of the cursor blink cycle, in milliseconds.
3283 pub fn gtk_cursor_blink_time(self, gtk_cursor_blink_time: i32) -> Self {
3284 Self {
3285 builder: self
3286 .builder
3287 .property("gtk-cursor-blink-time", gtk_cursor_blink_time),
3288 }
3289 }
3290
3291 /// Time after which the cursor stops blinking, in seconds.
3292 ///
3293 /// The timer is reset after each user interaction.
3294 ///
3295 /// Setting this to zero has the same effect as setting
3296 /// [`gtk-cursor-blink`][struct@crate::Settings#gtk-cursor-blink] to [`false`].
3297 pub fn gtk_cursor_blink_timeout(self, gtk_cursor_blink_timeout: i32) -> Self {
3298 Self {
3299 builder: self
3300 .builder
3301 .property("gtk-cursor-blink-timeout", gtk_cursor_blink_timeout),
3302 }
3303 }
3304
3305 /// Name of the cursor theme to use.
3306 ///
3307 /// Use [`None`] to use the default theme.
3308 pub fn gtk_cursor_theme_name(self, gtk_cursor_theme_name: impl Into<glib::GString>) -> Self {
3309 Self {
3310 builder: self
3311 .builder
3312 .property("gtk-cursor-theme-name", gtk_cursor_theme_name.into()),
3313 }
3314 }
3315
3316 /// The size to use for cursors.
3317 ///
3318 /// 0 means to use the default size.
3319 pub fn gtk_cursor_theme_size(self, gtk_cursor_theme_size: i32) -> Self {
3320 Self {
3321 builder: self
3322 .builder
3323 .property("gtk-cursor-theme-size", gtk_cursor_theme_size),
3324 }
3325 }
3326
3327 /// Determines which buttons should be put in the
3328 /// titlebar of client-side decorated windows, and whether they
3329 /// should be placed on the left or right.
3330 ///
3331 /// The format of the string is button names, separated by commas.
3332 /// A colon separates the buttons that should appear on the left
3333 /// from those on the right. Recognized button names are minimize,
3334 /// maximize, close, icon (the window icon) and menu (a menu button
3335 /// for the fallback app menu).
3336 ///
3337 /// For example, "menu:minimize,maximize,close" specifies a menu
3338 /// on the left, and minimize, maximize and close buttons on the right.
3339 ///
3340 /// Note that buttons will only be shown when they are meaningful.
3341 /// E.g. a menu button only appears when the desktop shell does not
3342 /// show the app menu, and a close button only appears on a window
3343 /// that can be closed.
3344 ///
3345 /// Also note that the setting can be overridden with the
3346 /// [`decoration-layout`][struct@crate::HeaderBar#decoration-layout] property.
3347 pub fn gtk_decoration_layout(self, gtk_decoration_layout: impl Into<glib::GString>) -> Self {
3348 Self {
3349 builder: self
3350 .builder
3351 .property("gtk-decoration-layout", gtk_decoration_layout.into()),
3352 }
3353 }
3354
3355 /// Whether builtin GTK dialogs such as the file chooser, the
3356 /// color chooser or the font chooser will use a header bar at
3357 /// the top to show action widgets, or an action area at the bottom.
3358 ///
3359 /// This setting does not affect custom dialogs using [`Dialog`][crate::Dialog]
3360 /// directly, or message dialogs.
3361 pub fn gtk_dialogs_use_header(self, gtk_dialogs_use_header: bool) -> Self {
3362 Self {
3363 builder: self
3364 .builder
3365 .property("gtk-dialogs-use-header", gtk_dialogs_use_header),
3366 }
3367 }
3368
3369 /// The number of pixels the cursor can move before dragging.
3370 pub fn gtk_dnd_drag_threshold(self, gtk_dnd_drag_threshold: i32) -> Self {
3371 Self {
3372 builder: self
3373 .builder
3374 .property("gtk-dnd-drag-threshold", gtk_dnd_drag_threshold),
3375 }
3376 }
3377
3378 /// The maximum distance allowed between two clicks for them to be considered
3379 /// a double click, in pixels.
3380 pub fn gtk_double_click_distance(self, gtk_double_click_distance: i32) -> Self {
3381 Self {
3382 builder: self
3383 .builder
3384 .property("gtk-double-click-distance", gtk_double_click_distance),
3385 }
3386 }
3387
3388 /// The maximum time to allow between two clicks for them to be considered
3389 /// a double click, in milliseconds.
3390 pub fn gtk_double_click_time(self, gtk_double_click_time: i32) -> Self {
3391 Self {
3392 builder: self
3393 .builder
3394 .property("gtk-double-click-time", gtk_double_click_time),
3395 }
3396 }
3397
3398 /// Whether menu items should have visible accelerators which can be
3399 /// activated.
3400 pub fn gtk_enable_accels(self, gtk_enable_accels: bool) -> Self {
3401 Self {
3402 builder: self
3403 .builder
3404 .property("gtk-enable-accels", gtk_enable_accels),
3405 }
3406 }
3407
3408 /// Whether to enable toolkit-wide animations.
3409 pub fn gtk_enable_animations(self, gtk_enable_animations: bool) -> Self {
3410 Self {
3411 builder: self
3412 .builder
3413 .property("gtk-enable-animations", gtk_enable_animations),
3414 }
3415 }
3416
3417 /// Whether to play any event sounds at all.
3418 ///
3419 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
3420 /// for more information on event sounds and sound themes.
3421 ///
3422 /// GTK itself does not support event sounds, you have to use a loadable
3423 /// module like the one that comes with libcanberra.
3424 pub fn gtk_enable_event_sounds(self, gtk_enable_event_sounds: bool) -> Self {
3425 Self {
3426 builder: self
3427 .builder
3428 .property("gtk-enable-event-sounds", gtk_enable_event_sounds),
3429 }
3430 }
3431
3432 /// Whether to play event sounds as feedback to user input.
3433 ///
3434 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
3435 /// for more information on event sounds and sound themes.
3436 ///
3437 /// GTK itself does not support event sounds, you have to use a loadable
3438 /// module like the one that comes with libcanberra.
3439 pub fn gtk_enable_input_feedback_sounds(self, gtk_enable_input_feedback_sounds: bool) -> Self {
3440 Self {
3441 builder: self.builder.property(
3442 "gtk-enable-input-feedback-sounds",
3443 gtk_enable_input_feedback_sounds,
3444 ),
3445 }
3446 }
3447
3448 /// Whether a middle click on a mouse should paste the
3449 /// 'PRIMARY' clipboard content at the cursor location.
3450 pub fn gtk_enable_primary_paste(self, gtk_enable_primary_paste: bool) -> Self {
3451 Self {
3452 builder: self
3453 .builder
3454 .property("gtk-enable-primary-paste", gtk_enable_primary_paste),
3455 }
3456 }
3457
3458 /// How long to show the last input character in hidden
3459 /// entries.
3460 ///
3461 /// This value is in milliseconds. 0 disables showing the
3462 /// last char. 600 is a good value for enabling it.
3463 pub fn gtk_entry_password_hint_timeout(self, gtk_entry_password_hint_timeout: u32) -> Self {
3464 Self {
3465 builder: self.builder.property(
3466 "gtk-entry-password-hint-timeout",
3467 gtk_entry_password_hint_timeout,
3468 ),
3469 }
3470 }
3471
3472 /// Whether to select the contents of an entry when it is focused.
3473 pub fn gtk_entry_select_on_focus(self, gtk_entry_select_on_focus: bool) -> Self {
3474 Self {
3475 builder: self
3476 .builder
3477 .property("gtk-entry-select-on-focus", gtk_entry_select_on_focus),
3478 }
3479 }
3480
3481 /// When [`true`], keyboard navigation and other input-related errors
3482 /// will cause a beep.
3483 ///
3484 /// Since the error bell is implemented using gdk_surface_beep(), the
3485 /// windowing system may offer ways to configure the error bell in many
3486 /// ways, such as flashing the window or similar visual effects.
3487 pub fn gtk_error_bell(self, gtk_error_bell: bool) -> Self {
3488 Self {
3489 builder: self.builder.property("gtk-error-bell", gtk_error_bell),
3490 }
3491 }
3492
3493 /// The default font to use.
3494 ///
3495 /// GTK uses the family name and size from this string.
3496 pub fn gtk_font_name(self, gtk_font_name: impl Into<glib::GString>) -> Self {
3497 Self {
3498 builder: self.builder.property("gtk-font-name", gtk_font_name.into()),
3499 }
3500 }
3501
3502 /// How GTK font rendering is set up.
3503 ///
3504 /// When set to [enum@Gtk.FontRendering.MANUAL], GTK respects the low-level
3505 /// font-related settings ([`gtk-hint-font-metrics`][struct@crate::Settings#gtk-hint-font-metrics],
3506 /// [`gtk-xft-antialias`][struct@crate::Settings#gtk-xft-antialias], [`gtk-xft-hinting`][struct@crate::Settings#gtk-xft-hinting],
3507 /// [`gtk-xft-hintstyle`][struct@crate::Settings#gtk-xft-hintstyle] and [`gtk-xft-rgba`][struct@crate::Settings#gtk-xft-rgba])
3508 /// as much as practical.
3509 ///
3510 /// When set to [enum@Gtk.FontRendering.AUTOMATIC], GTK will consider factors such
3511 /// as screen resolution and scale in deciding how to render fonts.
3512 #[cfg(feature = "v4_16")]
3513 #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
3514 pub fn gtk_font_rendering(self, gtk_font_rendering: FontRendering) -> Self {
3515 Self {
3516 builder: self
3517 .builder
3518 .property("gtk-font-rendering", gtk_font_rendering),
3519 }
3520 }
3521
3522 /// Timestamp of the current fontconfig configuration.
3523 pub fn gtk_fontconfig_timestamp(self, gtk_fontconfig_timestamp: u32) -> Self {
3524 Self {
3525 builder: self
3526 .builder
3527 .property("gtk-fontconfig-timestamp", gtk_fontconfig_timestamp),
3528 }
3529 }
3530
3531 /// Whether hinting should be applied to font metrics.
3532 ///
3533 /// Note that this also turns off subpixel positioning of glyphs,
3534 /// since it conflicts with metrics hinting.
3535 #[cfg(feature = "v4_6")]
3536 #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
3537 pub fn gtk_hint_font_metrics(self, gtk_hint_font_metrics: bool) -> Self {
3538 Self {
3539 builder: self
3540 .builder
3541 .property("gtk-hint-font-metrics", gtk_hint_font_metrics),
3542 }
3543 }
3544
3545 /// Name of the icon theme to use.
3546 ///
3547 /// See [`IconTheme`][crate::IconTheme] for details about how
3548 /// GTK handles icon themes.
3549 pub fn gtk_icon_theme_name(self, gtk_icon_theme_name: impl Into<glib::GString>) -> Self {
3550 Self {
3551 builder: self
3552 .builder
3553 .property("gtk-icon-theme-name", gtk_icon_theme_name.into()),
3554 }
3555 }
3556
3557 /// Which IM (input method) module should be used by default.
3558 ///
3559 /// This is the input method that will be used if the user has not
3560 /// explicitly chosen another input method from the IM context menu.
3561 /// This also can be a colon-separated list of input methods, which GTK
3562 /// will try in turn until it finds one available on the system.
3563 ///
3564 /// See [`IMContext`][crate::IMContext].
3565 pub fn gtk_im_module(self, gtk_im_module: impl Into<glib::GString>) -> Self {
3566 Self {
3567 builder: self.builder.property("gtk-im-module", gtk_im_module.into()),
3568 }
3569 }
3570
3571 /// The color scheme used for rendering the user interface.
3572 ///
3573 /// This setting communicates the system-wide preference.
3574 /// The color scheme that is actually used when applying CSS
3575 /// styles can be set with the [`prefers-color-scheme`][struct@crate::CssProvider#prefers-color-scheme]
3576 /// property.
3577 #[cfg(feature = "v4_20")]
3578 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3579 pub fn gtk_interface_color_scheme(
3580 self,
3581 gtk_interface_color_scheme: InterfaceColorScheme,
3582 ) -> Self {
3583 Self {
3584 builder: self
3585 .builder
3586 .property("gtk-interface-color-scheme", gtk_interface_color_scheme),
3587 }
3588 }
3589
3590 /// The level of contrast to use for the user interface.
3591 ///
3592 /// This setting communicates the system-wide preference.
3593 /// The contrast level that is actually used when applying CSS
3594 /// styles can be set with the [`prefers-contrast`][struct@crate::CssProvider#prefers-contrast]
3595 /// property.
3596 #[cfg(feature = "v4_20")]
3597 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
3598 pub fn gtk_interface_contrast(self, gtk_interface_contrast: InterfaceContrast) -> Self {
3599 Self {
3600 builder: self
3601 .builder
3602 .property("gtk-interface-contrast", gtk_interface_contrast),
3603 }
3604 }
3605
3606 /// Whether GTK should make sure that text can be navigated with
3607 /// a caret, even if it is not editable.
3608 ///
3609 /// This is useful when using a screen reader.
3610 pub fn gtk_keynav_use_caret(self, gtk_keynav_use_caret: bool) -> Self {
3611 Self {
3612 builder: self
3613 .builder
3614 .property("gtk-keynav-use-caret", gtk_keynav_use_caret),
3615 }
3616 }
3617
3618 /// Whether to select the contents of a selectable
3619 /// label when it is focused.
3620 pub fn gtk_label_select_on_focus(self, gtk_label_select_on_focus: bool) -> Self {
3621 Self {
3622 builder: self
3623 .builder
3624 .property("gtk-label-select-on-focus", gtk_label_select_on_focus),
3625 }
3626 }
3627
3628 /// The time for a button or touch press to be considered a “long press”.
3629 ///
3630 /// See [`GestureLongPress`][crate::GestureLongPress].
3631 pub fn gtk_long_press_time(self, gtk_long_press_time: u32) -> Self {
3632 Self {
3633 builder: self
3634 .builder
3635 .property("gtk-long-press-time", gtk_long_press_time),
3636 }
3637 }
3638
3639 /// Whether scrolled windows may use overlaid scrolling indicators.
3640 ///
3641 /// If this is set to [`false`], scrolled windows will have permanent
3642 /// scrollbars.
3643 pub fn gtk_overlay_scrolling(self, gtk_overlay_scrolling: bool) -> Self {
3644 Self {
3645 builder: self
3646 .builder
3647 .property("gtk-overlay-scrolling", gtk_overlay_scrolling),
3648 }
3649 }
3650
3651 /// If the value of this setting is [`true`], clicking the primary button in a
3652 /// [`Range`][crate::Range] trough will move the slider, and hence set the range’s value, to
3653 /// the point that you clicked.
3654 ///
3655 /// If it is [`false`], a primary click will cause the slider/value to move
3656 /// by the range’s page-size towards the point clicked.
3657 ///
3658 /// Whichever action you choose for the primary button, the other action will
3659 /// be available by holding Shift and primary-clicking, or clicking the middle
3660 /// mouse button.
3661 pub fn gtk_primary_button_warps_slider(self, gtk_primary_button_warps_slider: bool) -> Self {
3662 Self {
3663 builder: self.builder.property(
3664 "gtk-primary-button-warps-slider",
3665 gtk_primary_button_warps_slider,
3666 ),
3667 }
3668 }
3669
3670 /// A comma-separated list of print backends to use in the print
3671 /// dialog.
3672 ///
3673 /// Available print backends depend on the GTK installation,
3674 /// and may include "file", "cups", "lpr" or "papi".
3675 pub fn gtk_print_backends(self, gtk_print_backends: impl Into<glib::GString>) -> Self {
3676 Self {
3677 builder: self
3678 .builder
3679 .property("gtk-print-backends", gtk_print_backends.into()),
3680 }
3681 }
3682
3683 /// A command to run for displaying the print preview.
3684 ///
3685 /// The command should contain a ``f`` placeholder, which will get
3686 /// replaced by the path to the pdf file. The command may also
3687 /// contain a ``s`` placeholder, which will get replaced by the
3688 /// path to a file containing the print settings in the format
3689 /// produced by [`PrintSettings::to_file()`][crate::PrintSettings::to_file()].
3690 ///
3691 /// The preview application is responsible for removing the pdf
3692 /// file and the print settings file when it is done.
3693 pub fn gtk_print_preview_command(
3694 self,
3695 gtk_print_preview_command: impl Into<glib::GString>,
3696 ) -> Self {
3697 Self {
3698 builder: self.builder.property(
3699 "gtk-print-preview-command",
3700 gtk_print_preview_command.into(),
3701 ),
3702 }
3703 }
3704
3705 /// Whether GTK should keep track of items inside the recently used
3706 /// resources list.
3707 ///
3708 /// If set to [`false`], the list will always be empty.
3709 pub fn gtk_recent_files_enabled(self, gtk_recent_files_enabled: bool) -> Self {
3710 Self {
3711 builder: self
3712 .builder
3713 .property("gtk-recent-files-enabled", gtk_recent_files_enabled),
3714 }
3715 }
3716
3717 /// The maximum age, in days, of the items inside the recently used
3718 /// resources list.
3719 ///
3720 /// Items older than this setting will be excised from the list.
3721 /// If set to 0, the list will always be empty; if set to -1, no
3722 /// item will be removed.
3723 pub fn gtk_recent_files_max_age(self, gtk_recent_files_max_age: i32) -> Self {
3724 Self {
3725 builder: self
3726 .builder
3727 .property("gtk-recent-files-max-age", gtk_recent_files_max_age),
3728 }
3729 }
3730
3731 /// Set to [`true`] if the desktop environment is displaying
3732 /// the app menu, [`false`] if the app should display it itself.
3733 /// This setting is not relevant anymore
3734 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
3735 pub fn gtk_shell_shows_app_menu(self, gtk_shell_shows_app_menu: bool) -> Self {
3736 Self {
3737 builder: self
3738 .builder
3739 .property("gtk-shell-shows-app-menu", gtk_shell_shows_app_menu),
3740 }
3741 }
3742
3743 /// Set to [`true`] if the desktop environment is displaying
3744 /// the desktop folder, [`false`] if not.
3745 /// This setting is not relevant anymore
3746 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
3747 pub fn gtk_shell_shows_desktop(self, gtk_shell_shows_desktop: bool) -> Self {
3748 Self {
3749 builder: self
3750 .builder
3751 .property("gtk-shell-shows-desktop", gtk_shell_shows_desktop),
3752 }
3753 }
3754
3755 /// Set to [`true`] if the desktop environment is displaying
3756 /// the menubar, [`false`] if the app should display it itself.
3757 /// This setting is not relevant anymore
3758 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
3759 pub fn gtk_shell_shows_menubar(self, gtk_shell_shows_menubar: bool) -> Self {
3760 Self {
3761 builder: self
3762 .builder
3763 .property("gtk-shell-shows-menubar", gtk_shell_shows_menubar),
3764 }
3765 }
3766
3767 /// When [`true`], widgets like switches include shapes to indicate their on/off state.
3768 #[cfg(feature = "v4_14")]
3769 #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
3770 pub fn gtk_show_status_shapes(self, gtk_show_status_shapes: bool) -> Self {
3771 Self {
3772 builder: self
3773 .builder
3774 .property("gtk-show-status-shapes", gtk_show_status_shapes),
3775 }
3776 }
3777
3778 /// The XDG sound theme to use for event sounds.
3779 ///
3780 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
3781 /// for more information on event sounds and sound themes.
3782 ///
3783 /// GTK itself does not support event sounds, you have to use
3784 /// a loadable module like the one that comes with libcanberra.
3785 pub fn gtk_sound_theme_name(self, gtk_sound_theme_name: impl Into<glib::GString>) -> Self {
3786 Self {
3787 builder: self
3788 .builder
3789 .property("gtk-sound-theme-name", gtk_sound_theme_name.into()),
3790 }
3791 }
3792
3793 /// Whether two cursors should be displayed for mixed left-to-right and
3794 /// right-to-left text.
3795 pub fn gtk_split_cursor(self, gtk_split_cursor: bool) -> Self {
3796 Self {
3797 builder: self.builder.property("gtk-split-cursor", gtk_split_cursor),
3798 }
3799 }
3800
3801 /// Name of the theme to load.
3802 ///
3803 /// See [`CssProvider`][crate::CssProvider] for details about how
3804 /// GTK finds the CSS stylesheet for a theme.
3805 pub fn gtk_theme_name(self, gtk_theme_name: impl Into<glib::GString>) -> Self {
3806 Self {
3807 builder: self
3808 .builder
3809 .property("gtk-theme-name", gtk_theme_name.into()),
3810 }
3811 }
3812
3813 /// Determines the action to take when a double-click
3814 /// occurs on the titlebar of client-side decorated windows.
3815 ///
3816 /// Recognized actions are minimize, toggle-maximize, menu, lower
3817 /// or none.
3818 pub fn gtk_titlebar_double_click(
3819 self,
3820 gtk_titlebar_double_click: impl Into<glib::GString>,
3821 ) -> Self {
3822 Self {
3823 builder: self.builder.property(
3824 "gtk-titlebar-double-click",
3825 gtk_titlebar_double_click.into(),
3826 ),
3827 }
3828 }
3829
3830 /// Determines the action to take when a middle-click
3831 /// occurs on the titlebar of client-side decorated windows.
3832 ///
3833 /// Recognized actions are minimize, toggle-maximize, menu, lower
3834 /// or none.
3835 pub fn gtk_titlebar_middle_click(
3836 self,
3837 gtk_titlebar_middle_click: impl Into<glib::GString>,
3838 ) -> Self {
3839 Self {
3840 builder: self.builder.property(
3841 "gtk-titlebar-middle-click",
3842 gtk_titlebar_middle_click.into(),
3843 ),
3844 }
3845 }
3846
3847 /// Determines the action to take when a right-click
3848 /// occurs on the titlebar of client-side decorated windows.
3849 ///
3850 /// Recognized actions are minimize, toggle-maximize, menu, lower
3851 /// or none.
3852 pub fn gtk_titlebar_right_click(
3853 self,
3854 gtk_titlebar_right_click: impl Into<glib::GString>,
3855 ) -> Self {
3856 Self {
3857 builder: self
3858 .builder
3859 .property("gtk-titlebar-right-click", gtk_titlebar_right_click.into()),
3860 }
3861 }
3862
3863 /// Whether to antialias fonts.
3864 ///
3865 /// The values are 0 for no, 1 for yes, or -1 for the system default.
3866 pub fn gtk_xft_antialias(self, gtk_xft_antialias: i32) -> Self {
3867 Self {
3868 builder: self
3869 .builder
3870 .property("gtk-xft-antialias", gtk_xft_antialias),
3871 }
3872 }
3873
3874 /// The font resolution, in 1024 * dots/inch.
3875 ///
3876 /// -1 to use the default value.
3877 pub fn gtk_xft_dpi(self, gtk_xft_dpi: i32) -> Self {
3878 Self {
3879 builder: self.builder.property("gtk-xft-dpi", gtk_xft_dpi),
3880 }
3881 }
3882
3883 /// Whether to enable font hinting.
3884 ///
3885 /// The values are 0 for no, 1 for yes, or -1 for the system default.
3886 pub fn gtk_xft_hinting(self, gtk_xft_hinting: i32) -> Self {
3887 Self {
3888 builder: self.builder.property("gtk-xft-hinting", gtk_xft_hinting),
3889 }
3890 }
3891
3892 /// What degree of font hinting to use.
3893 ///
3894 /// The possible vaues are hintnone, hintslight,
3895 /// hintmedium, hintfull.
3896 pub fn gtk_xft_hintstyle(self, gtk_xft_hintstyle: impl Into<glib::GString>) -> Self {
3897 Self {
3898 builder: self
3899 .builder
3900 .property("gtk-xft-hintstyle", gtk_xft_hintstyle.into()),
3901 }
3902 }
3903
3904 /// The type of subpixel antialiasing to use.
3905 ///
3906 /// The possible values are none, rgb, bgr, vrgb, vbgr.
3907 ///
3908 /// Note that GSK does not support subpixel antialiasing, and this
3909 /// setting has no effect on font rendering in GTK.
3910 pub fn gtk_xft_rgba(self, gtk_xft_rgba: impl Into<glib::GString>) -> Self {
3911 Self {
3912 builder: self.builder.property("gtk-xft-rgba", gtk_xft_rgba.into()),
3913 }
3914 }
3915
3916 // rustdoc-stripper-ignore-next
3917 /// Build the [`Settings`].
3918 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
3919 pub fn build(self) -> Settings {
3920 assert_initialized_main_thread!();
3921 self.builder.build()
3922 }
3923}