gtk4/auto/font_chooser_dialog.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#![allow(deprecated)]
5
6use crate::{
7 ffi, Accessible, AccessibleRole, Align, Application, Buildable, ConstraintTarget, Dialog,
8 FontChooser, FontChooserLevel, LayoutManager, Native, Overflow, Root, ShortcutManager, Widget,
9 Window,
10};
11use glib::{prelude::*, translate::*};
12
13glib::wrapper! {
14 /// Use [`FontDialog`][crate::FontDialog] instead
15 /// The [`FontChooserDialog`][crate::FontChooserDialog] widget is a dialog for selecting a font.
16 ///
17 /// <picture>
18 /// <source srcset="fontchooser-dark.png" media="(prefers-color-scheme: dark)">
19 /// <img alt="An example GtkFontChooserDialog" src="fontchooser.png">
20 /// </picture>
21 ///
22 /// [`FontChooserDialog`][crate::FontChooserDialog] implements the [`FontChooser`][crate::FontChooser] interface
23 /// and does not provide much API of its own.
24 ///
25 /// To create a [`FontChooserDialog`][crate::FontChooserDialog], use [`new()`][Self::new()].
26 ///
27 /// # GtkFontChooserDialog as GtkBuildable
28 ///
29 /// The [`FontChooserDialog`][crate::FontChooserDialog] implementation of the [`Buildable`][crate::Buildable]
30 /// interface exposes the buttons with the names “select_button”
31 /// and “cancel_button”.
32 ///
33 /// ## CSS nodes
34 ///
35 /// [`FontChooserDialog`][crate::FontChooserDialog] has a single CSS node with the name `window` and style
36 /// class `.fontchooser`.
37 ///
38 /// # Implements
39 ///
40 /// [`DialogExt`][trait@crate::prelude::DialogExt], [`GtkWindowExt`][trait@crate::prelude::GtkWindowExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`AccessibleExt`][trait@crate::prelude::AccessibleExt], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`ConstraintTargetExt`][trait@crate::prelude::ConstraintTargetExt], [`NativeExt`][trait@crate::prelude::NativeExt], [`RootExt`][trait@crate::prelude::RootExt], [`ShortcutManagerExt`][trait@crate::prelude::ShortcutManagerExt], [`FontChooserExt`][trait@crate::prelude::FontChooserExt], [`DialogExtManual`][trait@crate::prelude::DialogExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`AccessibleExtManual`][trait@crate::prelude::AccessibleExtManual], [`FontChooserExtManual`][trait@crate::prelude::FontChooserExtManual]
41 #[doc(alias = "GtkFontChooserDialog")]
42 pub struct FontChooserDialog(Object<ffi::GtkFontChooserDialog>) @extends Dialog, Window, Widget, @implements Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager, FontChooser;
43
44 match fn {
45 type_ => || ffi::gtk_font_chooser_dialog_get_type(),
46 }
47}
48
49impl FontChooserDialog {
50 /// Creates a new [`FontChooserDialog`][crate::FontChooserDialog].
51 ///
52 /// # Deprecated since 4.10
53 ///
54 /// Use [`FontDialog`][crate::FontDialog] instead
55 /// ## `title`
56 /// Title of the dialog
57 /// ## `parent`
58 /// Transient parent of the dialog
59 ///
60 /// # Returns
61 ///
62 /// a new [`FontChooserDialog`][crate::FontChooserDialog]
63 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
64 #[allow(deprecated)]
65 #[doc(alias = "gtk_font_chooser_dialog_new")]
66 pub fn new(title: Option<&str>, parent: Option<&impl IsA<Window>>) -> FontChooserDialog {
67 assert_initialized_main_thread!();
68 unsafe {
69 Widget::from_glib_none(ffi::gtk_font_chooser_dialog_new(
70 title.to_glib_none().0,
71 parent.map(|p| p.as_ref()).to_glib_none().0,
72 ))
73 .unsafe_cast()
74 }
75 }
76
77 // rustdoc-stripper-ignore-next
78 /// Creates a new builder-pattern struct instance to construct [`FontChooserDialog`] objects.
79 ///
80 /// This method returns an instance of [`FontChooserDialogBuilder`](crate::builders::FontChooserDialogBuilder) which can be used to create [`FontChooserDialog`] objects.
81 pub fn builder() -> FontChooserDialogBuilder {
82 FontChooserDialogBuilder::new()
83 }
84}
85
86impl Default for FontChooserDialog {
87 fn default() -> Self {
88 glib::object::Object::new::<Self>()
89 }
90}
91
92// rustdoc-stripper-ignore-next
93/// A [builder-pattern] type to construct [`FontChooserDialog`] objects.
94///
95/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
96#[must_use = "The builder must be built to be used"]
97pub struct FontChooserDialogBuilder {
98 builder: glib::object::ObjectBuilder<'static, FontChooserDialog>,
99}
100
101impl FontChooserDialogBuilder {
102 fn new() -> Self {
103 Self {
104 builder: glib::object::Object::builder(),
105 }
106 }
107
108 /// [`true`] if the dialog uses a headerbar for action buttons
109 /// instead of the action-area.
110 ///
111 /// For technical reasons, this property is declared as an integer
112 /// property, but you should only set it to [`true`] or [`false`].
113 ///
114 /// ## Creating a dialog with headerbar
115 ///
116 /// Builtin [`Dialog`][crate::Dialog] subclasses such as [`ColorChooserDialog`][crate::ColorChooserDialog]
117 /// set this property according to platform conventions (using the
118 /// [`gtk-dialogs-use-header`][struct@crate::Settings#gtk-dialogs-use-header] setting).
119 ///
120 /// Here is how you can achieve the same:
121 ///
122 /// **⚠️ The following code is in c ⚠️**
123 ///
124 /// ```c
125 /// g_object_get (settings, "gtk-dialogs-use-header", &header, NULL);
126 /// dialog = g_object_new (GTK_TYPE_DIALOG, header, TRUE, NULL);
127 /// ```
128 /// Use [`Window`][crate::Window] instead
129 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
130 pub fn use_header_bar(self, use_header_bar: i32) -> Self {
131 Self {
132 builder: self.builder.property("use-header-bar", use_header_bar),
133 }
134 }
135
136 /// The [`Application`][crate::Application] associated with the window.
137 ///
138 /// The application will be kept alive for at least as long as it
139 /// has any windows associated with it (see g_application_hold()
140 /// for a way to keep it alive without windows).
141 ///
142 /// Normally, the connection between the application and the window
143 /// will remain until the window is destroyed, but you can explicitly
144 /// remove it by setting the this property to `NULL`.
145 pub fn application(self, application: &impl IsA<Application>) -> Self {
146 Self {
147 builder: self
148 .builder
149 .property("application", application.clone().upcast()),
150 }
151 }
152
153 /// The child widget.
154 pub fn child(self, child: &impl IsA<Widget>) -> Self {
155 Self {
156 builder: self.builder.property("child", child.clone().upcast()),
157 }
158 }
159
160 /// Whether the window should have a frame (also known as *decorations*).
161 pub fn decorated(self, decorated: bool) -> Self {
162 Self {
163 builder: self.builder.property("decorated", decorated),
164 }
165 }
166
167 /// The default height of the window.
168 pub fn default_height(self, default_height: i32) -> Self {
169 Self {
170 builder: self.builder.property("default-height", default_height),
171 }
172 }
173
174 /// The default widget.
175 pub fn default_widget(self, default_widget: &impl IsA<Widget>) -> Self {
176 Self {
177 builder: self
178 .builder
179 .property("default-widget", default_widget.clone().upcast()),
180 }
181 }
182
183 /// The default width of the window.
184 pub fn default_width(self, default_width: i32) -> Self {
185 Self {
186 builder: self.builder.property("default-width", default_width),
187 }
188 }
189
190 /// Whether the window frame should have a close button.
191 pub fn deletable(self, deletable: bool) -> Self {
192 Self {
193 builder: self.builder.property("deletable", deletable),
194 }
195 }
196
197 /// If this window should be destroyed when the parent is destroyed.
198 pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self {
199 Self {
200 builder: self
201 .builder
202 .property("destroy-with-parent", destroy_with_parent),
203 }
204 }
205
206 /// The display that will display this window.
207 pub fn display(self, display: &impl IsA<gdk::Display>) -> Self {
208 Self {
209 builder: self.builder.property("display", display.clone().upcast()),
210 }
211 }
212
213 /// Whether 'focus rectangles' are currently visible in this window.
214 ///
215 /// This property is maintained by GTK based on user input
216 /// and should not be set by applications.
217 pub fn focus_visible(self, focus_visible: bool) -> Self {
218 Self {
219 builder: self.builder.property("focus-visible", focus_visible),
220 }
221 }
222
223 /// The focus widget.
224 pub fn focus_widget(self, focus_widget: &impl IsA<Widget>) -> Self {
225 Self {
226 builder: self
227 .builder
228 .property("focus-widget", focus_widget.clone().upcast()),
229 }
230 }
231
232 /// Whether the window is fullscreen.
233 ///
234 /// Setting this property is the equivalent of calling
235 /// [`GtkWindowExt::fullscreen()`][crate::prelude::GtkWindowExt::fullscreen()] or [`GtkWindowExt::unfullscreen()`][crate::prelude::GtkWindowExt::unfullscreen()];
236 /// either operation is asynchronous, which means you will need to
237 /// connect to the ::notify signal in order to know whether the
238 /// operation was successful.
239 pub fn fullscreened(self, fullscreened: bool) -> Self {
240 Self {
241 builder: self.builder.property("fullscreened", fullscreened),
242 }
243 }
244
245 /// Whether the window frame should handle <kbd>F10</kbd> for activating
246 /// menubars.
247 #[cfg(feature = "v4_2")]
248 #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))]
249 pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self {
250 Self {
251 builder: self
252 .builder
253 .property("handle-menubar-accel", handle_menubar_accel),
254 }
255 }
256
257 /// If this window should be hidden instead of destroyed when the user clicks
258 /// the close button.
259 pub fn hide_on_close(self, hide_on_close: bool) -> Self {
260 Self {
261 builder: self.builder.property("hide-on-close", hide_on_close),
262 }
263 }
264
265 /// Specifies the name of the themed icon to use as the window icon.
266 ///
267 /// See [`IconTheme`][crate::IconTheme] for more details.
268 pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
269 Self {
270 builder: self.builder.property("icon-name", icon_name.into()),
271 }
272 }
273
274 /// Whether the window is maximized.
275 ///
276 /// Setting this property is the equivalent of calling
277 /// [`GtkWindowExt::maximize()`][crate::prelude::GtkWindowExt::maximize()] or [`GtkWindowExt::unmaximize()`][crate::prelude::GtkWindowExt::unmaximize()];
278 /// either operation is asynchronous, which means you will need to
279 /// connect to the ::notify signal in order to know whether the
280 /// operation was successful.
281 pub fn maximized(self, maximized: bool) -> Self {
282 Self {
283 builder: self.builder.property("maximized", maximized),
284 }
285 }
286
287 /// Whether mnemonics are currently visible in this window.
288 ///
289 /// This property is maintained by GTK based on user input,
290 /// and should not be set by applications.
291 pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self {
292 Self {
293 builder: self
294 .builder
295 .property("mnemonics-visible", mnemonics_visible),
296 }
297 }
298
299 /// If true, the window is modal.
300 pub fn modal(self, modal: bool) -> Self {
301 Self {
302 builder: self.builder.property("modal", modal),
303 }
304 }
305
306 /// If true, users can resize the window.
307 pub fn resizable(self, resizable: bool) -> Self {
308 Self {
309 builder: self.builder.property("resizable", resizable),
310 }
311 }
312
313 /// A write-only property for setting window's startup notification identifier.
314 pub fn startup_id(self, startup_id: impl Into<glib::GString>) -> Self {
315 Self {
316 builder: self.builder.property("startup-id", startup_id.into()),
317 }
318 }
319
320 /// The title of the window.
321 pub fn title(self, title: impl Into<glib::GString>) -> Self {
322 Self {
323 builder: self.builder.property("title", title.into()),
324 }
325 }
326
327 /// The titlebar widget.
328 #[cfg(feature = "v4_6")]
329 #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
330 pub fn titlebar(self, titlebar: &impl IsA<Widget>) -> Self {
331 Self {
332 builder: self.builder.property("titlebar", titlebar.clone().upcast()),
333 }
334 }
335
336 /// The transient parent of the window.
337 pub fn transient_for(self, transient_for: &impl IsA<Window>) -> Self {
338 Self {
339 builder: self
340 .builder
341 .property("transient-for", transient_for.clone().upcast()),
342 }
343 }
344
345 /// Whether the widget or any of its descendents can accept
346 /// the input focus.
347 ///
348 /// This property is meant to be set by widget implementations,
349 /// typically in their instance init function.
350 pub fn can_focus(self, can_focus: bool) -> Self {
351 Self {
352 builder: self.builder.property("can-focus", can_focus),
353 }
354 }
355
356 /// Whether the widget can receive pointer events.
357 pub fn can_target(self, can_target: bool) -> Self {
358 Self {
359 builder: self.builder.property("can-target", can_target),
360 }
361 }
362
363 /// A list of css classes applied to this widget.
364 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
365 Self {
366 builder: self.builder.property("css-classes", css_classes.into()),
367 }
368 }
369
370 /// The name of this widget in the CSS tree.
371 ///
372 /// This property is meant to be set by widget implementations,
373 /// typically in their instance init function.
374 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
375 Self {
376 builder: self.builder.property("css-name", css_name.into()),
377 }
378 }
379
380 /// The cursor used by @widget.
381 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
382 Self {
383 builder: self.builder.property("cursor", cursor.clone()),
384 }
385 }
386
387 /// Whether the widget should grab focus when it is clicked with the mouse.
388 ///
389 /// This property is only relevant for widgets that can take focus.
390 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
391 Self {
392 builder: self.builder.property("focus-on-click", focus_on_click),
393 }
394 }
395
396 /// Whether this widget itself will accept the input focus.
397 pub fn focusable(self, focusable: bool) -> Self {
398 Self {
399 builder: self.builder.property("focusable", focusable),
400 }
401 }
402
403 /// How to distribute horizontal space if widget gets extra space.
404 pub fn halign(self, halign: Align) -> Self {
405 Self {
406 builder: self.builder.property("halign", halign),
407 }
408 }
409
410 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
411 /// signal on @widget.
412 ///
413 /// A true value indicates that @widget can have a tooltip, in this case
414 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
415 /// determine whether it will provide a tooltip or not.
416 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
417 Self {
418 builder: self.builder.property("has-tooltip", has_tooltip),
419 }
420 }
421
422 /// Overrides for height request of the widget.
423 ///
424 /// If this is -1, the natural request will be used.
425 pub fn height_request(self, height_request: i32) -> Self {
426 Self {
427 builder: self.builder.property("height-request", height_request),
428 }
429 }
430
431 /// Whether to expand horizontally.
432 pub fn hexpand(self, hexpand: bool) -> Self {
433 Self {
434 builder: self.builder.property("hexpand", hexpand),
435 }
436 }
437
438 /// Whether to use the `hexpand` property.
439 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
440 Self {
441 builder: self.builder.property("hexpand-set", hexpand_set),
442 }
443 }
444
445 /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
446 /// the preferred size of the widget, and allocate its children.
447 ///
448 /// This property is meant to be set by widget implementations,
449 /// typically in their instance init function.
450 pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
451 Self {
452 builder: self
453 .builder
454 .property("layout-manager", layout_manager.clone().upcast()),
455 }
456 }
457
458 /// Makes this widget act like a modal dialog, with respect to
459 /// event delivery.
460 ///
461 /// Global event controllers will not handle events with targets
462 /// inside the widget, unless they are set up to ignore propagation
463 /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
464 #[cfg(feature = "v4_18")]
465 #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
466 pub fn limit_events(self, limit_events: bool) -> Self {
467 Self {
468 builder: self.builder.property("limit-events", limit_events),
469 }
470 }
471
472 /// Margin on bottom side of widget.
473 ///
474 /// This property adds margin outside of the widget's normal size
475 /// request, the margin will be added in addition to the size from
476 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
477 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
478 Self {
479 builder: self.builder.property("margin-bottom", margin_bottom),
480 }
481 }
482
483 /// Margin on end of widget, horizontally.
484 ///
485 /// This property supports left-to-right and right-to-left text
486 /// directions.
487 ///
488 /// This property adds margin outside of the widget's normal size
489 /// request, the margin will be added in addition to the size from
490 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
491 pub fn margin_end(self, margin_end: i32) -> Self {
492 Self {
493 builder: self.builder.property("margin-end", margin_end),
494 }
495 }
496
497 /// Margin on start of widget, horizontally.
498 ///
499 /// This property supports left-to-right and right-to-left text
500 /// directions.
501 ///
502 /// This property adds margin outside of the widget's normal size
503 /// request, the margin will be added in addition to the size from
504 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
505 pub fn margin_start(self, margin_start: i32) -> Self {
506 Self {
507 builder: self.builder.property("margin-start", margin_start),
508 }
509 }
510
511 /// Margin on top side of widget.
512 ///
513 /// This property adds margin outside of the widget's normal size
514 /// request, the margin will be added in addition to the size from
515 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
516 pub fn margin_top(self, margin_top: i32) -> Self {
517 Self {
518 builder: self.builder.property("margin-top", margin_top),
519 }
520 }
521
522 /// The name of the widget.
523 pub fn name(self, name: impl Into<glib::GString>) -> Self {
524 Self {
525 builder: self.builder.property("name", name.into()),
526 }
527 }
528
529 /// The requested opacity of the widget.
530 pub fn opacity(self, opacity: f64) -> Self {
531 Self {
532 builder: self.builder.property("opacity", opacity),
533 }
534 }
535
536 /// How content outside the widget's content area is treated.
537 ///
538 /// This property is meant to be set by widget implementations,
539 /// typically in their instance init function.
540 pub fn overflow(self, overflow: Overflow) -> Self {
541 Self {
542 builder: self.builder.property("overflow", overflow),
543 }
544 }
545
546 /// Whether the widget will receive the default action when it is focused.
547 pub fn receives_default(self, receives_default: bool) -> Self {
548 Self {
549 builder: self.builder.property("receives-default", receives_default),
550 }
551 }
552
553 /// Whether the widget responds to input.
554 pub fn sensitive(self, sensitive: bool) -> Self {
555 Self {
556 builder: self.builder.property("sensitive", sensitive),
557 }
558 }
559
560 /// Sets the text of tooltip to be the given string, which is marked up
561 /// with Pango markup.
562 ///
563 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
564 ///
565 /// This is a convenience property which will take care of getting the
566 /// tooltip shown if the given string is not `NULL`:
567 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
568 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
569 /// the default signal handler.
570 ///
571 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
572 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
573 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
574 Self {
575 builder: self
576 .builder
577 .property("tooltip-markup", tooltip_markup.into()),
578 }
579 }
580
581 /// Sets the text of tooltip to be the given string.
582 ///
583 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
584 ///
585 /// This is a convenience property which will take care of getting the
586 /// tooltip shown if the given string is not `NULL`:
587 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
588 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
589 /// the default signal handler.
590 ///
591 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
592 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
593 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
594 Self {
595 builder: self.builder.property("tooltip-text", tooltip_text.into()),
596 }
597 }
598
599 /// How to distribute vertical space if widget gets extra space.
600 pub fn valign(self, valign: Align) -> Self {
601 Self {
602 builder: self.builder.property("valign", valign),
603 }
604 }
605
606 /// Whether to expand vertically.
607 pub fn vexpand(self, vexpand: bool) -> Self {
608 Self {
609 builder: self.builder.property("vexpand", vexpand),
610 }
611 }
612
613 /// Whether to use the `vexpand` property.
614 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
615 Self {
616 builder: self.builder.property("vexpand-set", vexpand_set),
617 }
618 }
619
620 /// Whether the widget is visible.
621 pub fn visible(self, visible: bool) -> Self {
622 Self {
623 builder: self.builder.property("visible", visible),
624 }
625 }
626
627 /// Overrides for width request of the widget.
628 ///
629 /// If this is -1, the natural request will be used.
630 pub fn width_request(self, width_request: i32) -> Self {
631 Self {
632 builder: self.builder.property("width-request", width_request),
633 }
634 }
635
636 /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
637 ///
638 /// The accessible role cannot be changed once set.
639 pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
640 Self {
641 builder: self.builder.property("accessible-role", accessible_role),
642 }
643 }
644
645 /// The font description as a string, e.g. "Sans Italic 12".
646 /// Use [`FontDialog`][crate::FontDialog] and [`FontDialogButton`][crate::FontDialogButton] instead
647 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
648 pub fn font(self, font: impl Into<glib::GString>) -> Self {
649 Self {
650 builder: self.builder.property("font", font.into()),
651 }
652 }
653
654 /// The font description as a [`pango::FontDescription`][crate::pango::FontDescription].
655 /// Use [`FontDialog`][crate::FontDialog] and [`FontDialogButton`][crate::FontDialogButton] instead
656 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
657 pub fn font_desc(self, font_desc: &pango::FontDescription) -> Self {
658 Self {
659 builder: self.builder.property("font-desc", font_desc),
660 }
661 }
662
663 /// The language for which the font features were selected.
664 /// Use [`FontDialog`][crate::FontDialog] and [`FontDialogButton`][crate::FontDialogButton] instead
665 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
666 pub fn language(self, language: impl Into<glib::GString>) -> Self {
667 Self {
668 builder: self.builder.property("language", language.into()),
669 }
670 }
671
672 /// The level of granularity to offer for selecting fonts.
673 /// Use [`FontDialog`][crate::FontDialog] and [`FontDialogButton`][crate::FontDialogButton] instead
674 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
675 pub fn level(self, level: FontChooserLevel) -> Self {
676 Self {
677 builder: self.builder.property("level", level),
678 }
679 }
680
681 /// The string with which to preview the font.
682 /// Use [`FontDialog`][crate::FontDialog] and [`FontDialogButton`][crate::FontDialogButton] instead
683 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
684 pub fn preview_text(self, preview_text: impl Into<glib::GString>) -> Self {
685 Self {
686 builder: self.builder.property("preview-text", preview_text.into()),
687 }
688 }
689
690 /// Whether to show an entry to change the preview text.
691 /// Use [`FontDialog`][crate::FontDialog] and [`FontDialogButton`][crate::FontDialogButton] instead
692 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
693 pub fn show_preview_entry(self, show_preview_entry: bool) -> Self {
694 Self {
695 builder: self
696 .builder
697 .property("show-preview-entry", show_preview_entry),
698 }
699 }
700
701 // rustdoc-stripper-ignore-next
702 /// Build the [`FontChooserDialog`].
703 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
704 pub fn build(self) -> FontChooserDialog {
705 assert_initialized_main_thread!();
706 self.builder.build()
707 }
708}