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