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