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