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