1use crate::{ffi, ViewStackPage};
7use glib::{
8 prelude::*,
9 signal::{connect_raw, SignalHandlerId},
10 translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15 #[doc(alias = "AdwViewStack")]
16 pub struct ViewStack(Object<ffi::AdwViewStack, ffi::AdwViewStackClass>) @extends gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
17
18 match fn {
19 type_ => || ffi::adw_view_stack_get_type(),
20 }
21}
22
23impl ViewStack {
24 #[doc(alias = "adw_view_stack_new")]
25 pub fn new() -> ViewStack {
26 assert_initialized_main_thread!();
27 unsafe { gtk::Widget::from_glib_none(ffi::adw_view_stack_new()).unsafe_cast() }
28 }
29
30 pub fn builder() -> ViewStackBuilder {
35 ViewStackBuilder::new()
36 }
37
38 #[doc(alias = "adw_view_stack_add")]
39 pub fn add(&self, child: &impl IsA<gtk::Widget>) -> ViewStackPage {
40 unsafe {
41 from_glib_none(ffi::adw_view_stack_add(
42 self.to_glib_none().0,
43 child.as_ref().to_glib_none().0,
44 ))
45 }
46 }
47
48 #[doc(alias = "adw_view_stack_add_named")]
49 pub fn add_named(&self, child: &impl IsA<gtk::Widget>, name: Option<&str>) -> ViewStackPage {
50 unsafe {
51 from_glib_none(ffi::adw_view_stack_add_named(
52 self.to_glib_none().0,
53 child.as_ref().to_glib_none().0,
54 name.to_glib_none().0,
55 ))
56 }
57 }
58
59 #[doc(alias = "adw_view_stack_add_titled")]
60 pub fn add_titled(
61 &self,
62 child: &impl IsA<gtk::Widget>,
63 name: Option<&str>,
64 title: &str,
65 ) -> ViewStackPage {
66 unsafe {
67 from_glib_none(ffi::adw_view_stack_add_titled(
68 self.to_glib_none().0,
69 child.as_ref().to_glib_none().0,
70 name.to_glib_none().0,
71 title.to_glib_none().0,
72 ))
73 }
74 }
75
76 #[cfg(feature = "v1_2")]
77 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
78 #[doc(alias = "adw_view_stack_add_titled_with_icon")]
79 pub fn add_titled_with_icon(
80 &self,
81 child: &impl IsA<gtk::Widget>,
82 name: Option<&str>,
83 title: &str,
84 icon_name: &str,
85 ) -> ViewStackPage {
86 unsafe {
87 from_glib_none(ffi::adw_view_stack_add_titled_with_icon(
88 self.to_glib_none().0,
89 child.as_ref().to_glib_none().0,
90 name.to_glib_none().0,
91 title.to_glib_none().0,
92 icon_name.to_glib_none().0,
93 ))
94 }
95 }
96
97 #[doc(alias = "adw_view_stack_get_child_by_name")]
98 #[doc(alias = "get_child_by_name")]
99 pub fn child_by_name(&self, name: &str) -> Option<gtk::Widget> {
100 unsafe {
101 from_glib_none(ffi::adw_view_stack_get_child_by_name(
102 self.to_glib_none().0,
103 name.to_glib_none().0,
104 ))
105 }
106 }
107
108 #[cfg(feature = "v1_7")]
109 #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
110 #[doc(alias = "adw_view_stack_get_enable_transitions")]
111 #[doc(alias = "get_enable_transitions")]
112 #[doc(alias = "enable-transitions")]
113 pub fn enables_transitions(&self) -> bool {
114 unsafe {
115 from_glib(ffi::adw_view_stack_get_enable_transitions(
116 self.to_glib_none().0,
117 ))
118 }
119 }
120
121 #[doc(alias = "adw_view_stack_get_hhomogeneous")]
122 #[doc(alias = "get_hhomogeneous")]
123 #[doc(alias = "hhomogeneous")]
124 pub fn is_hhomogeneous(&self) -> bool {
125 unsafe { from_glib(ffi::adw_view_stack_get_hhomogeneous(self.to_glib_none().0)) }
126 }
127
128 #[doc(alias = "adw_view_stack_get_page")]
129 #[doc(alias = "get_page")]
130 pub fn page(&self, child: &impl IsA<gtk::Widget>) -> ViewStackPage {
131 unsafe {
132 from_glib_none(ffi::adw_view_stack_get_page(
133 self.to_glib_none().0,
134 child.as_ref().to_glib_none().0,
135 ))
136 }
137 }
138
139 #[doc(alias = "adw_view_stack_get_pages")]
140 #[doc(alias = "get_pages")]
141 pub fn pages(&self) -> gtk::SelectionModel {
142 unsafe { from_glib_full(ffi::adw_view_stack_get_pages(self.to_glib_none().0)) }
143 }
144
145 #[cfg(feature = "v1_7")]
146 #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
147 #[doc(alias = "adw_view_stack_get_transition_duration")]
148 #[doc(alias = "get_transition_duration")]
149 #[doc(alias = "transition-duration")]
150 pub fn transition_duration(&self) -> u32 {
151 unsafe { ffi::adw_view_stack_get_transition_duration(self.to_glib_none().0) }
152 }
153
154 #[cfg(feature = "v1_7")]
155 #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
156 #[doc(alias = "adw_view_stack_get_transition_running")]
157 #[doc(alias = "get_transition_running")]
158 #[doc(alias = "transition-running")]
159 pub fn is_transition_running(&self) -> bool {
160 unsafe {
161 from_glib(ffi::adw_view_stack_get_transition_running(
162 self.to_glib_none().0,
163 ))
164 }
165 }
166
167 #[doc(alias = "adw_view_stack_get_vhomogeneous")]
168 #[doc(alias = "get_vhomogeneous")]
169 #[doc(alias = "vhomogeneous")]
170 pub fn is_vhomogeneous(&self) -> bool {
171 unsafe { from_glib(ffi::adw_view_stack_get_vhomogeneous(self.to_glib_none().0)) }
172 }
173
174 #[doc(alias = "adw_view_stack_get_visible_child")]
175 #[doc(alias = "get_visible_child")]
176 #[doc(alias = "visible-child")]
177 pub fn visible_child(&self) -> Option<gtk::Widget> {
178 unsafe { from_glib_none(ffi::adw_view_stack_get_visible_child(self.to_glib_none().0)) }
179 }
180
181 #[doc(alias = "adw_view_stack_get_visible_child_name")]
182 #[doc(alias = "get_visible_child_name")]
183 #[doc(alias = "visible-child-name")]
184 pub fn visible_child_name(&self) -> Option<glib::GString> {
185 unsafe {
186 from_glib_none(ffi::adw_view_stack_get_visible_child_name(
187 self.to_glib_none().0,
188 ))
189 }
190 }
191
192 #[doc(alias = "adw_view_stack_remove")]
193 pub fn remove(&self, child: &impl IsA<gtk::Widget>) {
194 unsafe {
195 ffi::adw_view_stack_remove(self.to_glib_none().0, child.as_ref().to_glib_none().0);
196 }
197 }
198
199 #[cfg(feature = "v1_7")]
200 #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
201 #[doc(alias = "adw_view_stack_set_enable_transitions")]
202 #[doc(alias = "enable-transitions")]
203 pub fn set_enable_transitions(&self, enable_transitions: bool) {
204 unsafe {
205 ffi::adw_view_stack_set_enable_transitions(
206 self.to_glib_none().0,
207 enable_transitions.into_glib(),
208 );
209 }
210 }
211
212 #[doc(alias = "adw_view_stack_set_hhomogeneous")]
213 #[doc(alias = "hhomogeneous")]
214 pub fn set_hhomogeneous(&self, hhomogeneous: bool) {
215 unsafe {
216 ffi::adw_view_stack_set_hhomogeneous(self.to_glib_none().0, hhomogeneous.into_glib());
217 }
218 }
219
220 #[cfg(feature = "v1_7")]
221 #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
222 #[doc(alias = "adw_view_stack_set_transition_duration")]
223 #[doc(alias = "transition-duration")]
224 pub fn set_transition_duration(&self, duration: u32) {
225 unsafe {
226 ffi::adw_view_stack_set_transition_duration(self.to_glib_none().0, duration);
227 }
228 }
229
230 #[doc(alias = "adw_view_stack_set_vhomogeneous")]
231 #[doc(alias = "vhomogeneous")]
232 pub fn set_vhomogeneous(&self, vhomogeneous: bool) {
233 unsafe {
234 ffi::adw_view_stack_set_vhomogeneous(self.to_glib_none().0, vhomogeneous.into_glib());
235 }
236 }
237
238 #[doc(alias = "adw_view_stack_set_visible_child")]
239 #[doc(alias = "visible-child")]
240 pub fn set_visible_child(&self, child: &impl IsA<gtk::Widget>) {
241 unsafe {
242 ffi::adw_view_stack_set_visible_child(
243 self.to_glib_none().0,
244 child.as_ref().to_glib_none().0,
245 );
246 }
247 }
248
249 #[doc(alias = "adw_view_stack_set_visible_child_name")]
250 #[doc(alias = "visible-child-name")]
251 pub fn set_visible_child_name(&self, name: &str) {
252 unsafe {
253 ffi::adw_view_stack_set_visible_child_name(
254 self.to_glib_none().0,
255 name.to_glib_none().0,
256 );
257 }
258 }
259
260 #[cfg(feature = "v1_7")]
261 #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
262 #[doc(alias = "enable-transitions")]
263 pub fn connect_enable_transitions_notify<F: Fn(&Self) + 'static>(
264 &self,
265 f: F,
266 ) -> SignalHandlerId {
267 unsafe extern "C" fn notify_enable_transitions_trampoline<F: Fn(&ViewStack) + 'static>(
268 this: *mut ffi::AdwViewStack,
269 _param_spec: glib::ffi::gpointer,
270 f: glib::ffi::gpointer,
271 ) {
272 let f: &F = &*(f as *const F);
273 f(&from_glib_borrow(this))
274 }
275 unsafe {
276 let f: Box_<F> = Box_::new(f);
277 connect_raw(
278 self.as_ptr() as *mut _,
279 c"notify::enable-transitions".as_ptr() as *const _,
280 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
281 notify_enable_transitions_trampoline::<F> as *const (),
282 )),
283 Box_::into_raw(f),
284 )
285 }
286 }
287
288 #[doc(alias = "hhomogeneous")]
289 pub fn connect_hhomogeneous_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
290 unsafe extern "C" fn notify_hhomogeneous_trampoline<F: Fn(&ViewStack) + 'static>(
291 this: *mut ffi::AdwViewStack,
292 _param_spec: glib::ffi::gpointer,
293 f: glib::ffi::gpointer,
294 ) {
295 let f: &F = &*(f as *const F);
296 f(&from_glib_borrow(this))
297 }
298 unsafe {
299 let f: Box_<F> = Box_::new(f);
300 connect_raw(
301 self.as_ptr() as *mut _,
302 c"notify::hhomogeneous".as_ptr() as *const _,
303 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
304 notify_hhomogeneous_trampoline::<F> as *const (),
305 )),
306 Box_::into_raw(f),
307 )
308 }
309 }
310
311 #[doc(alias = "pages")]
312 pub fn connect_pages_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
313 unsafe extern "C" fn notify_pages_trampoline<F: Fn(&ViewStack) + 'static>(
314 this: *mut ffi::AdwViewStack,
315 _param_spec: glib::ffi::gpointer,
316 f: glib::ffi::gpointer,
317 ) {
318 let f: &F = &*(f as *const F);
319 f(&from_glib_borrow(this))
320 }
321 unsafe {
322 let f: Box_<F> = Box_::new(f);
323 connect_raw(
324 self.as_ptr() as *mut _,
325 c"notify::pages".as_ptr() as *const _,
326 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
327 notify_pages_trampoline::<F> as *const (),
328 )),
329 Box_::into_raw(f),
330 )
331 }
332 }
333
334 #[cfg(feature = "v1_7")]
335 #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
336 #[doc(alias = "transition-duration")]
337 pub fn connect_transition_duration_notify<F: Fn(&Self) + 'static>(
338 &self,
339 f: F,
340 ) -> SignalHandlerId {
341 unsafe extern "C" fn notify_transition_duration_trampoline<F: Fn(&ViewStack) + 'static>(
342 this: *mut ffi::AdwViewStack,
343 _param_spec: glib::ffi::gpointer,
344 f: glib::ffi::gpointer,
345 ) {
346 let f: &F = &*(f as *const F);
347 f(&from_glib_borrow(this))
348 }
349 unsafe {
350 let f: Box_<F> = Box_::new(f);
351 connect_raw(
352 self.as_ptr() as *mut _,
353 c"notify::transition-duration".as_ptr() as *const _,
354 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
355 notify_transition_duration_trampoline::<F> as *const (),
356 )),
357 Box_::into_raw(f),
358 )
359 }
360 }
361
362 #[cfg(feature = "v1_7")]
363 #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
364 #[doc(alias = "transition-running")]
365 pub fn connect_transition_running_notify<F: Fn(&Self) + 'static>(
366 &self,
367 f: F,
368 ) -> SignalHandlerId {
369 unsafe extern "C" fn notify_transition_running_trampoline<F: Fn(&ViewStack) + 'static>(
370 this: *mut ffi::AdwViewStack,
371 _param_spec: glib::ffi::gpointer,
372 f: glib::ffi::gpointer,
373 ) {
374 let f: &F = &*(f as *const F);
375 f(&from_glib_borrow(this))
376 }
377 unsafe {
378 let f: Box_<F> = Box_::new(f);
379 connect_raw(
380 self.as_ptr() as *mut _,
381 c"notify::transition-running".as_ptr() as *const _,
382 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
383 notify_transition_running_trampoline::<F> as *const (),
384 )),
385 Box_::into_raw(f),
386 )
387 }
388 }
389
390 #[doc(alias = "vhomogeneous")]
391 pub fn connect_vhomogeneous_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
392 unsafe extern "C" fn notify_vhomogeneous_trampoline<F: Fn(&ViewStack) + 'static>(
393 this: *mut ffi::AdwViewStack,
394 _param_spec: glib::ffi::gpointer,
395 f: glib::ffi::gpointer,
396 ) {
397 let f: &F = &*(f as *const F);
398 f(&from_glib_borrow(this))
399 }
400 unsafe {
401 let f: Box_<F> = Box_::new(f);
402 connect_raw(
403 self.as_ptr() as *mut _,
404 c"notify::vhomogeneous".as_ptr() as *const _,
405 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
406 notify_vhomogeneous_trampoline::<F> as *const (),
407 )),
408 Box_::into_raw(f),
409 )
410 }
411 }
412
413 #[doc(alias = "visible-child")]
414 pub fn connect_visible_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
415 unsafe extern "C" fn notify_visible_child_trampoline<F: Fn(&ViewStack) + 'static>(
416 this: *mut ffi::AdwViewStack,
417 _param_spec: glib::ffi::gpointer,
418 f: glib::ffi::gpointer,
419 ) {
420 let f: &F = &*(f as *const F);
421 f(&from_glib_borrow(this))
422 }
423 unsafe {
424 let f: Box_<F> = Box_::new(f);
425 connect_raw(
426 self.as_ptr() as *mut _,
427 c"notify::visible-child".as_ptr() as *const _,
428 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
429 notify_visible_child_trampoline::<F> as *const (),
430 )),
431 Box_::into_raw(f),
432 )
433 }
434 }
435
436 #[doc(alias = "visible-child-name")]
437 pub fn connect_visible_child_name_notify<F: Fn(&Self) + 'static>(
438 &self,
439 f: F,
440 ) -> SignalHandlerId {
441 unsafe extern "C" fn notify_visible_child_name_trampoline<F: Fn(&ViewStack) + 'static>(
442 this: *mut ffi::AdwViewStack,
443 _param_spec: glib::ffi::gpointer,
444 f: glib::ffi::gpointer,
445 ) {
446 let f: &F = &*(f as *const F);
447 f(&from_glib_borrow(this))
448 }
449 unsafe {
450 let f: Box_<F> = Box_::new(f);
451 connect_raw(
452 self.as_ptr() as *mut _,
453 c"notify::visible-child-name".as_ptr() as *const _,
454 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
455 notify_visible_child_name_trampoline::<F> as *const (),
456 )),
457 Box_::into_raw(f),
458 )
459 }
460 }
461}
462
463impl Default for ViewStack {
464 fn default() -> Self {
465 Self::new()
466 }
467}
468
469#[must_use = "The builder must be built to be used"]
474pub struct ViewStackBuilder {
475 builder: glib::object::ObjectBuilder<'static, ViewStack>,
476}
477
478impl ViewStackBuilder {
479 fn new() -> Self {
480 Self {
481 builder: glib::object::Object::builder(),
482 }
483 }
484
485 #[cfg(feature = "v1_7")]
486 #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
487 pub fn enable_transitions(self, enable_transitions: bool) -> Self {
488 Self {
489 builder: self
490 .builder
491 .property("enable-transitions", enable_transitions),
492 }
493 }
494
495 pub fn hhomogeneous(self, hhomogeneous: bool) -> Self {
496 Self {
497 builder: self.builder.property("hhomogeneous", hhomogeneous),
498 }
499 }
500
501 #[cfg(feature = "v1_7")]
502 #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
503 pub fn transition_duration(self, transition_duration: u32) -> Self {
504 Self {
505 builder: self
506 .builder
507 .property("transition-duration", transition_duration),
508 }
509 }
510
511 pub fn vhomogeneous(self, vhomogeneous: bool) -> Self {
512 Self {
513 builder: self.builder.property("vhomogeneous", vhomogeneous),
514 }
515 }
516
517 pub fn visible_child(self, visible_child: &impl IsA<gtk::Widget>) -> Self {
518 Self {
519 builder: self
520 .builder
521 .property("visible-child", visible_child.clone().upcast()),
522 }
523 }
524
525 pub fn visible_child_name(self, visible_child_name: impl Into<glib::GString>) -> Self {
526 Self {
527 builder: self
528 .builder
529 .property("visible-child-name", visible_child_name.into()),
530 }
531 }
532
533 pub fn can_focus(self, can_focus: bool) -> Self {
534 Self {
535 builder: self.builder.property("can-focus", can_focus),
536 }
537 }
538
539 pub fn can_target(self, can_target: bool) -> Self {
540 Self {
541 builder: self.builder.property("can-target", can_target),
542 }
543 }
544
545 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
546 Self {
547 builder: self.builder.property("css-classes", css_classes.into()),
548 }
549 }
550
551 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
552 Self {
553 builder: self.builder.property("css-name", css_name.into()),
554 }
555 }
556
557 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
558 Self {
559 builder: self.builder.property("cursor", cursor.clone()),
560 }
561 }
562
563 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
564 Self {
565 builder: self.builder.property("focus-on-click", focus_on_click),
566 }
567 }
568
569 pub fn focusable(self, focusable: bool) -> Self {
570 Self {
571 builder: self.builder.property("focusable", focusable),
572 }
573 }
574
575 pub fn halign(self, halign: gtk::Align) -> Self {
576 Self {
577 builder: self.builder.property("halign", halign),
578 }
579 }
580
581 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
582 Self {
583 builder: self.builder.property("has-tooltip", has_tooltip),
584 }
585 }
586
587 pub fn height_request(self, height_request: i32) -> Self {
588 Self {
589 builder: self.builder.property("height-request", height_request),
590 }
591 }
592
593 pub fn hexpand(self, hexpand: bool) -> Self {
594 Self {
595 builder: self.builder.property("hexpand", hexpand),
596 }
597 }
598
599 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
600 Self {
601 builder: self.builder.property("hexpand-set", hexpand_set),
602 }
603 }
604
605 pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
606 Self {
607 builder: self
608 .builder
609 .property("layout-manager", layout_manager.clone().upcast()),
610 }
611 }
612
613 #[cfg(feature = "gtk_v4_18")]
614 #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
615 pub fn limit_events(self, limit_events: bool) -> Self {
616 Self {
617 builder: self.builder.property("limit-events", limit_events),
618 }
619 }
620
621 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
622 Self {
623 builder: self.builder.property("margin-bottom", margin_bottom),
624 }
625 }
626
627 pub fn margin_end(self, margin_end: i32) -> Self {
628 Self {
629 builder: self.builder.property("margin-end", margin_end),
630 }
631 }
632
633 pub fn margin_start(self, margin_start: i32) -> Self {
634 Self {
635 builder: self.builder.property("margin-start", margin_start),
636 }
637 }
638
639 pub fn margin_top(self, margin_top: i32) -> Self {
640 Self {
641 builder: self.builder.property("margin-top", margin_top),
642 }
643 }
644
645 pub fn name(self, name: impl Into<glib::GString>) -> Self {
646 Self {
647 builder: self.builder.property("name", name.into()),
648 }
649 }
650
651 pub fn opacity(self, opacity: f64) -> Self {
652 Self {
653 builder: self.builder.property("opacity", opacity),
654 }
655 }
656
657 pub fn overflow(self, overflow: gtk::Overflow) -> Self {
658 Self {
659 builder: self.builder.property("overflow", overflow),
660 }
661 }
662
663 pub fn receives_default(self, receives_default: bool) -> Self {
664 Self {
665 builder: self.builder.property("receives-default", receives_default),
666 }
667 }
668
669 pub fn sensitive(self, sensitive: bool) -> Self {
670 Self {
671 builder: self.builder.property("sensitive", sensitive),
672 }
673 }
674
675 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
676 Self {
677 builder: self
678 .builder
679 .property("tooltip-markup", tooltip_markup.into()),
680 }
681 }
682
683 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
684 Self {
685 builder: self.builder.property("tooltip-text", tooltip_text.into()),
686 }
687 }
688
689 pub fn valign(self, valign: gtk::Align) -> Self {
690 Self {
691 builder: self.builder.property("valign", valign),
692 }
693 }
694
695 pub fn vexpand(self, vexpand: bool) -> Self {
696 Self {
697 builder: self.builder.property("vexpand", vexpand),
698 }
699 }
700
701 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
702 Self {
703 builder: self.builder.property("vexpand-set", vexpand_set),
704 }
705 }
706
707 pub fn visible(self, visible: bool) -> Self {
708 Self {
709 builder: self.builder.property("visible", visible),
710 }
711 }
712
713 pub fn width_request(self, width_request: i32) -> Self {
714 Self {
715 builder: self.builder.property("width-request", width_request),
716 }
717 }
718
719 pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
720 Self {
721 builder: self.builder.property("accessible-role", accessible_role),
722 }
723 }
724
725 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
728 pub fn build(self) -> ViewStack {
729 assert_initialized_main_thread!();
730 self.builder.build()
731 }
732}