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