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