Skip to main content

gtk4/auto/
stack_sidebar.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;
8use crate::{
9    AccessibleRole, Align, Buildable, ConstraintTarget, LayoutManager, Overflow, Stack, Widget, ffi,
10};
11use glib::{
12    prelude::*,
13    signal::{SignalHandlerId, connect_raw},
14    translate::*,
15};
16use std::boxed::Box as Box_;
17
18#[cfg(feature = "v4_10")]
19#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
20glib::wrapper! {
21    ///
22    ///
23    /// In order to use a [`StackSidebar`][crate::StackSidebar], you simply use a [`Stack`][crate::Stack] to
24    /// organize your UI flow, and add the sidebar to your sidebar area. You
25    /// can use [`set_stack()`][Self::set_stack()] to connect the [`StackSidebar`][crate::StackSidebar]
26    /// to the [`Stack`][crate::Stack].
27    ///
28    /// # CSS nodes
29    ///
30    /// [`StackSidebar`][crate::StackSidebar] has a single CSS node with name stacksidebar and
31    /// style class .sidebar.
32    ///
33    /// When circumstances require it, [`StackSidebar`][crate::StackSidebar] adds the
34    /// .needs-attention style class to the widgets representing the stack
35    /// pages.
36    ///
37    /// ## Properties
38    ///
39    ///
40    /// #### `stack`
41    ///  The stack.
42    ///
43    /// Readable | Writable
44    /// <details><summary><h4>Widget</h4></summary>
45    ///
46    ///
47    /// #### `can-focus`
48    ///  Whether the widget or any of its descendents can accept
49    /// the input focus.
50    ///
51    /// This property is meant to be set by widget implementations,
52    /// typically in their instance init function.
53    ///
54    /// Readable | Writable
55    ///
56    ///
57    /// #### `can-target`
58    ///  Whether the widget can receive pointer events.
59    ///
60    /// Readable | Writable
61    ///
62    ///
63    /// #### `css-classes`
64    ///  A list of css classes applied to this widget.
65    ///
66    /// Readable | Writable
67    ///
68    ///
69    /// #### `css-name`
70    ///  The name of this widget in the CSS tree.
71    ///
72    /// This property is meant to be set by widget implementations,
73    /// typically in their instance init function.
74    ///
75    /// Readable | Writable | Construct Only
76    ///
77    ///
78    /// #### `cursor`
79    ///  The cursor used by @widget.
80    ///
81    /// Readable | Writable
82    ///
83    ///
84    /// #### `focus-on-click`
85    ///  Whether the widget should grab focus when it is clicked with the mouse.
86    ///
87    /// This property is only relevant for widgets that can take focus.
88    ///
89    /// Readable | Writable
90    ///
91    ///
92    /// #### `focusable`
93    ///  Whether this widget itself will accept the input focus.
94    ///
95    /// Readable | Writable
96    ///
97    ///
98    /// #### `halign`
99    ///  How to distribute horizontal space if widget gets extra space.
100    ///
101    /// Readable | Writable
102    ///
103    ///
104    /// #### `has-default`
105    ///  Whether the widget is the default widget.
106    ///
107    /// Readable
108    ///
109    ///
110    /// #### `has-focus`
111    ///  Whether the widget has the input focus.
112    ///
113    /// Readable
114    ///
115    ///
116    /// #### `has-tooltip`
117    ///  Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
118    /// signal on @widget.
119    ///
120    /// A true value indicates that @widget can have a tooltip, in this case
121    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
122    /// determine whether it will provide a tooltip or not.
123    ///
124    /// Readable | Writable
125    ///
126    ///
127    /// #### `height-request`
128    ///  Overrides for height request of the widget.
129    ///
130    /// If this is -1, the natural request will be used.
131    ///
132    /// Readable | Writable
133    ///
134    ///
135    /// #### `hexpand`
136    ///  Whether to expand horizontally.
137    ///
138    /// Readable | Writable
139    ///
140    ///
141    /// #### `hexpand-set`
142    ///  Whether to use the `hexpand` property.
143    ///
144    /// Readable | Writable
145    ///
146    ///
147    /// #### `layout-manager`
148    ///  The [`LayoutManager`][crate::LayoutManager] instance to use to compute
149    /// the preferred size of the widget, and allocate its children.
150    ///
151    /// This property is meant to be set by widget implementations,
152    /// typically in their instance init function.
153    ///
154    /// Readable | Writable
155    ///
156    ///
157    /// #### `limit-events`
158    ///  Makes this widget act like a modal dialog, with respect to
159    /// event delivery.
160    ///
161    /// Global event controllers will not handle events with targets
162    /// inside the widget, unless they are set up to ignore propagation
163    /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
164    ///
165    /// Readable | Writable
166    ///
167    ///
168    /// #### `margin-bottom`
169    ///  Margin on bottom side of widget.
170    ///
171    /// This property adds margin outside of the widget's normal size
172    /// request, the margin will be added in addition to the size from
173    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
174    ///
175    /// Readable | Writable
176    ///
177    ///
178    /// #### `margin-end`
179    ///  Margin on end of widget, horizontally.
180    ///
181    /// This property supports left-to-right and right-to-left text
182    /// directions.
183    ///
184    /// This property adds margin outside of the widget's normal size
185    /// request, the margin will be added in addition to the size from
186    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
187    ///
188    /// Readable | Writable
189    ///
190    ///
191    /// #### `margin-start`
192    ///  Margin on start of widget, horizontally.
193    ///
194    /// This property supports left-to-right and right-to-left text
195    /// directions.
196    ///
197    /// This property adds margin outside of the widget's normal size
198    /// request, the margin will be added in addition to the size from
199    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
200    ///
201    /// Readable | Writable
202    ///
203    ///
204    /// #### `margin-top`
205    ///  Margin on top side of widget.
206    ///
207    /// This property adds margin outside of the widget's normal size
208    /// request, the margin will be added in addition to the size from
209    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
210    ///
211    /// Readable | Writable
212    ///
213    ///
214    /// #### `name`
215    ///  The name of the widget.
216    ///
217    /// Readable | Writable
218    ///
219    ///
220    /// #### `opacity`
221    ///  The requested opacity of the widget.
222    ///
223    /// Readable | Writable
224    ///
225    ///
226    /// #### `overflow`
227    ///  How content outside the widget's content area is treated.
228    ///
229    /// This property is meant to be set by widget implementations,
230    /// typically in their instance init function.
231    ///
232    /// Readable | Writable
233    ///
234    ///
235    /// #### `parent`
236    ///  The parent widget of this widget.
237    ///
238    /// Readable
239    ///
240    ///
241    /// #### `receives-default`
242    ///  Whether the widget will receive the default action when it is focused.
243    ///
244    /// Readable | Writable
245    ///
246    ///
247    /// #### `root`
248    ///  The [`Root`][crate::Root] widget of the widget tree containing this widget.
249    ///
250    /// This will be `NULL` if the widget is not contained in a root widget.
251    ///
252    /// Readable
253    ///
254    ///
255    /// #### `scale-factor`
256    ///  The scale factor of the widget.
257    ///
258    /// Readable
259    ///
260    ///
261    /// #### `sensitive`
262    ///  Whether the widget responds to input.
263    ///
264    /// Readable | Writable
265    ///
266    ///
267    /// #### `tooltip-markup`
268    ///  Sets the text of tooltip to be the given string, which is marked up
269    /// with Pango markup.
270    ///
271    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
272    ///
273    /// This is a convenience property which will take care of getting the
274    /// tooltip shown if the given string is not `NULL`:
275    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
276    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
277    /// the default signal handler.
278    ///
279    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
280    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
281    ///
282    /// Readable | Writable
283    ///
284    ///
285    /// #### `tooltip-text`
286    ///  Sets the text of tooltip to be the given string.
287    ///
288    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
289    ///
290    /// This is a convenience property which will take care of getting the
291    /// tooltip shown if the given string is not `NULL`:
292    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
293    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
294    /// the default signal handler.
295    ///
296    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
297    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
298    ///
299    /// Readable | Writable
300    ///
301    ///
302    /// #### `valign`
303    ///  How to distribute vertical space if widget gets extra space.
304    ///
305    /// Readable | Writable
306    ///
307    ///
308    /// #### `vexpand`
309    ///  Whether to expand vertically.
310    ///
311    /// Readable | Writable
312    ///
313    ///
314    /// #### `vexpand-set`
315    ///  Whether to use the `vexpand` property.
316    ///
317    /// Readable | Writable
318    ///
319    ///
320    /// #### `visible`
321    ///  Whether the widget is visible.
322    ///
323    /// Readable | Writable
324    ///
325    ///
326    /// #### `width-request`
327    ///  Overrides for width request of the widget.
328    ///
329    /// If this is -1, the natural request will be used.
330    ///
331    /// Readable | Writable
332    /// </details>
333    /// <details><summary><h4>Accessible</h4></summary>
334    ///
335    ///
336    /// #### `accessible-role`
337    ///  The accessible role of the given [`Accessible`][crate::Accessible] implementation.
338    ///
339    /// The accessible role cannot be changed once set.
340    ///
341    /// Readable | Writable
342    /// </details>
343    ///
344    /// # Implements
345    ///
346    /// [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`AccessibleExt`][trait@crate::prelude::AccessibleExt], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`ConstraintTargetExt`][trait@crate::prelude::ConstraintTargetExt], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`AccessibleExtManual`][trait@crate::prelude::AccessibleExtManual]
347    #[doc(alias = "GtkStackSidebar")]
348    pub struct StackSidebar(Object<ffi::GtkStackSidebar>) @extends Widget, @implements Accessible, Buildable, ConstraintTarget;
349
350    match fn {
351        type_ => || ffi::gtk_stack_sidebar_get_type(),
352    }
353}
354
355#[cfg(not(feature = "v4_10"))]
356glib::wrapper! {
357    #[doc(alias = "GtkStackSidebar")]
358    pub struct StackSidebar(Object<ffi::GtkStackSidebar>) @extends Widget, @implements Buildable, ConstraintTarget;
359
360    match fn {
361        type_ => || ffi::gtk_stack_sidebar_get_type(),
362    }
363}
364
365impl StackSidebar {
366    /// Creates a new [`StackSidebar`][crate::StackSidebar].
367    ///
368    /// # Returns
369    ///
370    /// the new [`StackSidebar`][crate::StackSidebar]
371    #[doc(alias = "gtk_stack_sidebar_new")]
372    pub fn new() -> StackSidebar {
373        assert_initialized_main_thread!();
374        unsafe { Widget::from_glib_none(ffi::gtk_stack_sidebar_new()).unsafe_cast() }
375    }
376
377    // rustdoc-stripper-ignore-next
378    /// Creates a new builder-pattern struct instance to construct [`StackSidebar`] objects.
379    ///
380    /// This method returns an instance of [`StackSidebarBuilder`](crate::builders::StackSidebarBuilder) which can be used to create [`StackSidebar`] objects.
381    pub fn builder() -> StackSidebarBuilder {
382        StackSidebarBuilder::new()
383    }
384
385    /// Retrieves the stack.
386    ///
387    /// # Returns
388    ///
389    /// the associated [`Stack`][crate::Stack] or
390    ///   [`None`] if none has been set explicitly
391    #[doc(alias = "gtk_stack_sidebar_get_stack")]
392    #[doc(alias = "get_stack")]
393    pub fn stack(&self) -> Option<Stack> {
394        unsafe { from_glib_none(ffi::gtk_stack_sidebar_get_stack(self.to_glib_none().0)) }
395    }
396
397    /// Set the [`Stack`][crate::Stack] associated with this [`StackSidebar`][crate::StackSidebar].
398    ///
399    /// The sidebar widget will automatically update according to
400    /// the order and items within the given [`Stack`][crate::Stack].
401    /// ## `stack`
402    /// a [`Stack`][crate::Stack]
403    #[doc(alias = "gtk_stack_sidebar_set_stack")]
404    #[doc(alias = "stack")]
405    pub fn set_stack(&self, stack: &Stack) {
406        unsafe {
407            ffi::gtk_stack_sidebar_set_stack(self.to_glib_none().0, stack.to_glib_none().0);
408        }
409    }
410
411    #[doc(alias = "stack")]
412    pub fn connect_stack_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
413        unsafe extern "C" fn notify_stack_trampoline<F: Fn(&StackSidebar) + 'static>(
414            this: *mut ffi::GtkStackSidebar,
415            _param_spec: glib::ffi::gpointer,
416            f: glib::ffi::gpointer,
417        ) {
418            unsafe {
419                let f: &F = &*(f as *const F);
420                f(&from_glib_borrow(this))
421            }
422        }
423        unsafe {
424            let f: Box_<F> = Box_::new(f);
425            connect_raw(
426                self.as_ptr() as *mut _,
427                c"notify::stack".as_ptr(),
428                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
429                    notify_stack_trampoline::<F> as *const (),
430                )),
431                Box_::into_raw(f),
432            )
433        }
434    }
435}
436
437impl Default for StackSidebar {
438    fn default() -> Self {
439        Self::new()
440    }
441}
442
443// rustdoc-stripper-ignore-next
444/// A [builder-pattern] type to construct [`StackSidebar`] objects.
445///
446/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
447#[must_use = "The builder must be built to be used"]
448pub struct StackSidebarBuilder {
449    builder: glib::object::ObjectBuilder<'static, StackSidebar>,
450}
451
452impl StackSidebarBuilder {
453    fn new() -> Self {
454        Self {
455            builder: glib::object::Object::builder(),
456        }
457    }
458
459    /// The stack.
460    pub fn stack(self, stack: &Stack) -> Self {
461        Self {
462            builder: self.builder.property("stack", stack.clone()),
463        }
464    }
465
466    /// Whether the widget or any of its descendents can accept
467    /// the input focus.
468    ///
469    /// This property is meant to be set by widget implementations,
470    /// typically in their instance init function.
471    pub fn can_focus(self, can_focus: bool) -> Self {
472        Self {
473            builder: self.builder.property("can-focus", can_focus),
474        }
475    }
476
477    /// Whether the widget can receive pointer events.
478    pub fn can_target(self, can_target: bool) -> Self {
479        Self {
480            builder: self.builder.property("can-target", can_target),
481        }
482    }
483
484    /// A list of css classes applied to this widget.
485    pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
486        Self {
487            builder: self.builder.property("css-classes", css_classes.into()),
488        }
489    }
490
491    /// The name of this widget in the CSS tree.
492    ///
493    /// This property is meant to be set by widget implementations,
494    /// typically in their instance init function.
495    pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
496        Self {
497            builder: self.builder.property("css-name", css_name.into()),
498        }
499    }
500
501    /// The cursor used by @widget.
502    pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
503        Self {
504            builder: self.builder.property("cursor", cursor.clone()),
505        }
506    }
507
508    /// Whether the widget should grab focus when it is clicked with the mouse.
509    ///
510    /// This property is only relevant for widgets that can take focus.
511    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
512        Self {
513            builder: self.builder.property("focus-on-click", focus_on_click),
514        }
515    }
516
517    /// Whether this widget itself will accept the input focus.
518    pub fn focusable(self, focusable: bool) -> Self {
519        Self {
520            builder: self.builder.property("focusable", focusable),
521        }
522    }
523
524    /// How to distribute horizontal space if widget gets extra space.
525    pub fn halign(self, halign: Align) -> Self {
526        Self {
527            builder: self.builder.property("halign", halign),
528        }
529    }
530
531    /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
532    /// signal on @widget.
533    ///
534    /// A true value indicates that @widget can have a tooltip, in this case
535    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
536    /// determine whether it will provide a tooltip or not.
537    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
538        Self {
539            builder: self.builder.property("has-tooltip", has_tooltip),
540        }
541    }
542
543    /// Overrides for height request of the widget.
544    ///
545    /// If this is -1, the natural request will be used.
546    pub fn height_request(self, height_request: i32) -> Self {
547        Self {
548            builder: self.builder.property("height-request", height_request),
549        }
550    }
551
552    /// Whether to expand horizontally.
553    pub fn hexpand(self, hexpand: bool) -> Self {
554        Self {
555            builder: self.builder.property("hexpand", hexpand),
556        }
557    }
558
559    /// Whether to use the `hexpand` property.
560    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
561        Self {
562            builder: self.builder.property("hexpand-set", hexpand_set),
563        }
564    }
565
566    /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
567    /// the preferred size of the widget, and allocate its children.
568    ///
569    /// This property is meant to be set by widget implementations,
570    /// typically in their instance init function.
571    pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
572        Self {
573            builder: self
574                .builder
575                .property("layout-manager", layout_manager.clone().upcast()),
576        }
577    }
578
579    /// Makes this widget act like a modal dialog, with respect to
580    /// event delivery.
581    ///
582    /// Global event controllers will not handle events with targets
583    /// inside the widget, unless they are set up to ignore propagation
584    /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
585    #[cfg(feature = "v4_18")]
586    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
587    pub fn limit_events(self, limit_events: bool) -> Self {
588        Self {
589            builder: self.builder.property("limit-events", limit_events),
590        }
591    }
592
593    /// Margin on bottom side of widget.
594    ///
595    /// This property adds margin outside of the widget's normal size
596    /// request, the margin will be added in addition to the size from
597    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
598    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
599        Self {
600            builder: self.builder.property("margin-bottom", margin_bottom),
601        }
602    }
603
604    /// Margin on end of widget, horizontally.
605    ///
606    /// This property supports left-to-right and right-to-left text
607    /// directions.
608    ///
609    /// This property adds margin outside of the widget's normal size
610    /// request, the margin will be added in addition to the size from
611    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
612    pub fn margin_end(self, margin_end: i32) -> Self {
613        Self {
614            builder: self.builder.property("margin-end", margin_end),
615        }
616    }
617
618    /// Margin on start of widget, horizontally.
619    ///
620    /// This property supports left-to-right and right-to-left text
621    /// directions.
622    ///
623    /// This property adds margin outside of the widget's normal size
624    /// request, the margin will be added in addition to the size from
625    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
626    pub fn margin_start(self, margin_start: i32) -> Self {
627        Self {
628            builder: self.builder.property("margin-start", margin_start),
629        }
630    }
631
632    /// Margin on top side of widget.
633    ///
634    /// This property adds margin outside of the widget's normal size
635    /// request, the margin will be added in addition to the size from
636    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
637    pub fn margin_top(self, margin_top: i32) -> Self {
638        Self {
639            builder: self.builder.property("margin-top", margin_top),
640        }
641    }
642
643    /// The name of the widget.
644    pub fn name(self, name: impl Into<glib::GString>) -> Self {
645        Self {
646            builder: self.builder.property("name", name.into()),
647        }
648    }
649
650    /// The requested opacity of the widget.
651    pub fn opacity(self, opacity: f64) -> Self {
652        Self {
653            builder: self.builder.property("opacity", opacity),
654        }
655    }
656
657    /// How content outside the widget's content area is treated.
658    ///
659    /// This property is meant to be set by widget implementations,
660    /// typically in their instance init function.
661    pub fn overflow(self, overflow: Overflow) -> Self {
662        Self {
663            builder: self.builder.property("overflow", overflow),
664        }
665    }
666
667    /// Whether the widget will receive the default action when it is focused.
668    pub fn receives_default(self, receives_default: bool) -> Self {
669        Self {
670            builder: self.builder.property("receives-default", receives_default),
671        }
672    }
673
674    /// Whether the widget responds to input.
675    pub fn sensitive(self, sensitive: bool) -> Self {
676        Self {
677            builder: self.builder.property("sensitive", sensitive),
678        }
679    }
680
681    /// Sets the text of tooltip to be the given string, which is marked up
682    /// with Pango markup.
683    ///
684    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
685    ///
686    /// This is a convenience property which will take care of getting the
687    /// tooltip shown if the given string is not `NULL`:
688    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
689    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
690    /// the default signal handler.
691    ///
692    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
693    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
694    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
695        Self {
696            builder: self
697                .builder
698                .property("tooltip-markup", tooltip_markup.into()),
699        }
700    }
701
702    /// Sets the text of tooltip to be the given string.
703    ///
704    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
705    ///
706    /// This is a convenience property which will take care of getting the
707    /// tooltip shown if the given string is not `NULL`:
708    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
709    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
710    /// the default signal handler.
711    ///
712    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
713    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
714    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
715        Self {
716            builder: self.builder.property("tooltip-text", tooltip_text.into()),
717        }
718    }
719
720    /// How to distribute vertical space if widget gets extra space.
721    pub fn valign(self, valign: Align) -> Self {
722        Self {
723            builder: self.builder.property("valign", valign),
724        }
725    }
726
727    /// Whether to expand vertically.
728    pub fn vexpand(self, vexpand: bool) -> Self {
729        Self {
730            builder: self.builder.property("vexpand", vexpand),
731        }
732    }
733
734    /// Whether to use the `vexpand` property.
735    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
736        Self {
737            builder: self.builder.property("vexpand-set", vexpand_set),
738        }
739    }
740
741    /// Whether the widget is visible.
742    pub fn visible(self, visible: bool) -> Self {
743        Self {
744            builder: self.builder.property("visible", visible),
745        }
746    }
747
748    /// Overrides for width request of the widget.
749    ///
750    /// If this is -1, the natural request will be used.
751    pub fn width_request(self, width_request: i32) -> Self {
752        Self {
753            builder: self.builder.property("width-request", width_request),
754        }
755    }
756
757    /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
758    ///
759    /// The accessible role cannot be changed once set.
760    pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
761        Self {
762            builder: self.builder.property("accessible-role", accessible_role),
763        }
764    }
765
766    // rustdoc-stripper-ignore-next
767    /// Build the [`StackSidebar`].
768    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
769    pub fn build(self) -> StackSidebar {
770        assert_initialized_main_thread!();
771        self.builder.build()
772    }
773}