libadwaita/auto/
toolbar_view.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from
3// from gir-files (https://github.com/gtk-rs/gir-files.git)
4// DO NOT EDIT
5
6use crate::{ffi, ToolbarStyle};
7use glib::{
8    prelude::*,
9    signal::{connect_raw, SignalHandlerId},
10    translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15    #[doc(alias = "AdwToolbarView")]
16    pub struct ToolbarView(Object<ffi::AdwToolbarView, ffi::AdwToolbarViewClass>) @extends gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
17
18    match fn {
19        type_ => || ffi::adw_toolbar_view_get_type(),
20    }
21}
22
23impl ToolbarView {
24    #[doc(alias = "adw_toolbar_view_new")]
25    pub fn new() -> ToolbarView {
26        assert_initialized_main_thread!();
27        unsafe { gtk::Widget::from_glib_none(ffi::adw_toolbar_view_new()).unsafe_cast() }
28    }
29
30    // rustdoc-stripper-ignore-next
31    /// Creates a new builder-pattern struct instance to construct [`ToolbarView`] objects.
32    ///
33    /// This method returns an instance of [`ToolbarViewBuilder`](crate::builders::ToolbarViewBuilder) which can be used to create [`ToolbarView`] objects.
34    pub fn builder() -> ToolbarViewBuilder {
35        ToolbarViewBuilder::new()
36    }
37
38    #[doc(alias = "adw_toolbar_view_add_bottom_bar")]
39    pub fn add_bottom_bar(&self, widget: &impl IsA<gtk::Widget>) {
40        unsafe {
41            ffi::adw_toolbar_view_add_bottom_bar(
42                self.to_glib_none().0,
43                widget.as_ref().to_glib_none().0,
44            );
45        }
46    }
47
48    #[doc(alias = "adw_toolbar_view_add_top_bar")]
49    pub fn add_top_bar(&self, widget: &impl IsA<gtk::Widget>) {
50        unsafe {
51            ffi::adw_toolbar_view_add_top_bar(
52                self.to_glib_none().0,
53                widget.as_ref().to_glib_none().0,
54            );
55        }
56    }
57
58    #[doc(alias = "adw_toolbar_view_get_bottom_bar_height")]
59    #[doc(alias = "get_bottom_bar_height")]
60    #[doc(alias = "bottom-bar-height")]
61    pub fn bottom_bar_height(&self) -> i32 {
62        unsafe { ffi::adw_toolbar_view_get_bottom_bar_height(self.to_glib_none().0) }
63    }
64
65    #[doc(alias = "adw_toolbar_view_get_bottom_bar_style")]
66    #[doc(alias = "get_bottom_bar_style")]
67    #[doc(alias = "bottom-bar-style")]
68    pub fn bottom_bar_style(&self) -> ToolbarStyle {
69        unsafe {
70            from_glib(ffi::adw_toolbar_view_get_bottom_bar_style(
71                self.to_glib_none().0,
72            ))
73        }
74    }
75
76    #[doc(alias = "adw_toolbar_view_get_content")]
77    #[doc(alias = "get_content")]
78    pub fn content(&self) -> Option<gtk::Widget> {
79        unsafe { from_glib_none(ffi::adw_toolbar_view_get_content(self.to_glib_none().0)) }
80    }
81
82    #[doc(alias = "adw_toolbar_view_get_extend_content_to_bottom_edge")]
83    #[doc(alias = "get_extend_content_to_bottom_edge")]
84    #[doc(alias = "extend-content-to-bottom-edge")]
85    pub fn is_extend_content_to_bottom_edge(&self) -> bool {
86        unsafe {
87            from_glib(ffi::adw_toolbar_view_get_extend_content_to_bottom_edge(
88                self.to_glib_none().0,
89            ))
90        }
91    }
92
93    #[doc(alias = "adw_toolbar_view_get_extend_content_to_top_edge")]
94    #[doc(alias = "get_extend_content_to_top_edge")]
95    #[doc(alias = "extend-content-to-top-edge")]
96    pub fn is_extend_content_to_top_edge(&self) -> bool {
97        unsafe {
98            from_glib(ffi::adw_toolbar_view_get_extend_content_to_top_edge(
99                self.to_glib_none().0,
100            ))
101        }
102    }
103
104    #[doc(alias = "adw_toolbar_view_get_reveal_bottom_bars")]
105    #[doc(alias = "get_reveal_bottom_bars")]
106    #[doc(alias = "reveal-bottom-bars")]
107    pub fn reveals_bottom_bars(&self) -> bool {
108        unsafe {
109            from_glib(ffi::adw_toolbar_view_get_reveal_bottom_bars(
110                self.to_glib_none().0,
111            ))
112        }
113    }
114
115    #[doc(alias = "adw_toolbar_view_get_reveal_top_bars")]
116    #[doc(alias = "get_reveal_top_bars")]
117    #[doc(alias = "reveal-top-bars")]
118    pub fn reveals_top_bars(&self) -> bool {
119        unsafe {
120            from_glib(ffi::adw_toolbar_view_get_reveal_top_bars(
121                self.to_glib_none().0,
122            ))
123        }
124    }
125
126    #[doc(alias = "adw_toolbar_view_get_top_bar_height")]
127    #[doc(alias = "get_top_bar_height")]
128    #[doc(alias = "top-bar-height")]
129    pub fn top_bar_height(&self) -> i32 {
130        unsafe { ffi::adw_toolbar_view_get_top_bar_height(self.to_glib_none().0) }
131    }
132
133    #[doc(alias = "adw_toolbar_view_get_top_bar_style")]
134    #[doc(alias = "get_top_bar_style")]
135    #[doc(alias = "top-bar-style")]
136    pub fn top_bar_style(&self) -> ToolbarStyle {
137        unsafe {
138            from_glib(ffi::adw_toolbar_view_get_top_bar_style(
139                self.to_glib_none().0,
140            ))
141        }
142    }
143
144    #[doc(alias = "adw_toolbar_view_remove")]
145    pub fn remove(&self, widget: &impl IsA<gtk::Widget>) {
146        unsafe {
147            ffi::adw_toolbar_view_remove(self.to_glib_none().0, widget.as_ref().to_glib_none().0);
148        }
149    }
150
151    #[doc(alias = "adw_toolbar_view_set_bottom_bar_style")]
152    #[doc(alias = "bottom-bar-style")]
153    pub fn set_bottom_bar_style(&self, style: ToolbarStyle) {
154        unsafe {
155            ffi::adw_toolbar_view_set_bottom_bar_style(self.to_glib_none().0, style.into_glib());
156        }
157    }
158
159    #[doc(alias = "adw_toolbar_view_set_content")]
160    #[doc(alias = "content")]
161    pub fn set_content(&self, content: Option<&impl IsA<gtk::Widget>>) {
162        unsafe {
163            ffi::adw_toolbar_view_set_content(
164                self.to_glib_none().0,
165                content.map(|p| p.as_ref()).to_glib_none().0,
166            );
167        }
168    }
169
170    #[doc(alias = "adw_toolbar_view_set_extend_content_to_bottom_edge")]
171    #[doc(alias = "extend-content-to-bottom-edge")]
172    pub fn set_extend_content_to_bottom_edge(&self, extend: bool) {
173        unsafe {
174            ffi::adw_toolbar_view_set_extend_content_to_bottom_edge(
175                self.to_glib_none().0,
176                extend.into_glib(),
177            );
178        }
179    }
180
181    #[doc(alias = "adw_toolbar_view_set_extend_content_to_top_edge")]
182    #[doc(alias = "extend-content-to-top-edge")]
183    pub fn set_extend_content_to_top_edge(&self, extend: bool) {
184        unsafe {
185            ffi::adw_toolbar_view_set_extend_content_to_top_edge(
186                self.to_glib_none().0,
187                extend.into_glib(),
188            );
189        }
190    }
191
192    #[doc(alias = "adw_toolbar_view_set_reveal_bottom_bars")]
193    #[doc(alias = "reveal-bottom-bars")]
194    pub fn set_reveal_bottom_bars(&self, reveal: bool) {
195        unsafe {
196            ffi::adw_toolbar_view_set_reveal_bottom_bars(self.to_glib_none().0, reveal.into_glib());
197        }
198    }
199
200    #[doc(alias = "adw_toolbar_view_set_reveal_top_bars")]
201    #[doc(alias = "reveal-top-bars")]
202    pub fn set_reveal_top_bars(&self, reveal: bool) {
203        unsafe {
204            ffi::adw_toolbar_view_set_reveal_top_bars(self.to_glib_none().0, reveal.into_glib());
205        }
206    }
207
208    #[doc(alias = "adw_toolbar_view_set_top_bar_style")]
209    #[doc(alias = "top-bar-style")]
210    pub fn set_top_bar_style(&self, style: ToolbarStyle) {
211        unsafe {
212            ffi::adw_toolbar_view_set_top_bar_style(self.to_glib_none().0, style.into_glib());
213        }
214    }
215
216    #[cfg(feature = "v1_4")]
217    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
218    #[doc(alias = "bottom-bar-height")]
219    pub fn connect_bottom_bar_height_notify<F: Fn(&Self) + 'static>(
220        &self,
221        f: F,
222    ) -> SignalHandlerId {
223        unsafe extern "C" fn notify_bottom_bar_height_trampoline<F: Fn(&ToolbarView) + 'static>(
224            this: *mut ffi::AdwToolbarView,
225            _param_spec: glib::ffi::gpointer,
226            f: glib::ffi::gpointer,
227        ) {
228            let f: &F = &*(f as *const F);
229            f(&from_glib_borrow(this))
230        }
231        unsafe {
232            let f: Box_<F> = Box_::new(f);
233            connect_raw(
234                self.as_ptr() as *mut _,
235                c"notify::bottom-bar-height".as_ptr() as *const _,
236                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
237                    notify_bottom_bar_height_trampoline::<F> as *const (),
238                )),
239                Box_::into_raw(f),
240            )
241        }
242    }
243
244    #[cfg(feature = "v1_4")]
245    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
246    #[doc(alias = "bottom-bar-style")]
247    pub fn connect_bottom_bar_style_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
248        unsafe extern "C" fn notify_bottom_bar_style_trampoline<F: Fn(&ToolbarView) + 'static>(
249            this: *mut ffi::AdwToolbarView,
250            _param_spec: glib::ffi::gpointer,
251            f: glib::ffi::gpointer,
252        ) {
253            let f: &F = &*(f as *const F);
254            f(&from_glib_borrow(this))
255        }
256        unsafe {
257            let f: Box_<F> = Box_::new(f);
258            connect_raw(
259                self.as_ptr() as *mut _,
260                c"notify::bottom-bar-style".as_ptr() as *const _,
261                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
262                    notify_bottom_bar_style_trampoline::<F> as *const (),
263                )),
264                Box_::into_raw(f),
265            )
266        }
267    }
268
269    #[cfg(feature = "v1_4")]
270    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
271    #[doc(alias = "content")]
272    pub fn connect_content_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
273        unsafe extern "C" fn notify_content_trampoline<F: Fn(&ToolbarView) + 'static>(
274            this: *mut ffi::AdwToolbarView,
275            _param_spec: glib::ffi::gpointer,
276            f: glib::ffi::gpointer,
277        ) {
278            let f: &F = &*(f as *const F);
279            f(&from_glib_borrow(this))
280        }
281        unsafe {
282            let f: Box_<F> = Box_::new(f);
283            connect_raw(
284                self.as_ptr() as *mut _,
285                c"notify::content".as_ptr() as *const _,
286                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
287                    notify_content_trampoline::<F> as *const (),
288                )),
289                Box_::into_raw(f),
290            )
291        }
292    }
293
294    #[cfg(feature = "v1_4")]
295    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
296    #[doc(alias = "extend-content-to-bottom-edge")]
297    pub fn connect_extend_content_to_bottom_edge_notify<F: Fn(&Self) + 'static>(
298        &self,
299        f: F,
300    ) -> SignalHandlerId {
301        unsafe extern "C" fn notify_extend_content_to_bottom_edge_trampoline<
302            F: Fn(&ToolbarView) + 'static,
303        >(
304            this: *mut ffi::AdwToolbarView,
305            _param_spec: glib::ffi::gpointer,
306            f: glib::ffi::gpointer,
307        ) {
308            let f: &F = &*(f as *const F);
309            f(&from_glib_borrow(this))
310        }
311        unsafe {
312            let f: Box_<F> = Box_::new(f);
313            connect_raw(
314                self.as_ptr() as *mut _,
315                c"notify::extend-content-to-bottom-edge".as_ptr() as *const _,
316                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
317                    notify_extend_content_to_bottom_edge_trampoline::<F> as *const (),
318                )),
319                Box_::into_raw(f),
320            )
321        }
322    }
323
324    #[cfg(feature = "v1_4")]
325    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
326    #[doc(alias = "extend-content-to-top-edge")]
327    pub fn connect_extend_content_to_top_edge_notify<F: Fn(&Self) + 'static>(
328        &self,
329        f: F,
330    ) -> SignalHandlerId {
331        unsafe extern "C" fn notify_extend_content_to_top_edge_trampoline<
332            F: Fn(&ToolbarView) + 'static,
333        >(
334            this: *mut ffi::AdwToolbarView,
335            _param_spec: glib::ffi::gpointer,
336            f: glib::ffi::gpointer,
337        ) {
338            let f: &F = &*(f as *const F);
339            f(&from_glib_borrow(this))
340        }
341        unsafe {
342            let f: Box_<F> = Box_::new(f);
343            connect_raw(
344                self.as_ptr() as *mut _,
345                c"notify::extend-content-to-top-edge".as_ptr() as *const _,
346                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
347                    notify_extend_content_to_top_edge_trampoline::<F> as *const (),
348                )),
349                Box_::into_raw(f),
350            )
351        }
352    }
353
354    #[cfg(feature = "v1_4")]
355    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
356    #[doc(alias = "reveal-bottom-bars")]
357    pub fn connect_reveal_bottom_bars_notify<F: Fn(&Self) + 'static>(
358        &self,
359        f: F,
360    ) -> SignalHandlerId {
361        unsafe extern "C" fn notify_reveal_bottom_bars_trampoline<F: Fn(&ToolbarView) + 'static>(
362            this: *mut ffi::AdwToolbarView,
363            _param_spec: glib::ffi::gpointer,
364            f: glib::ffi::gpointer,
365        ) {
366            let f: &F = &*(f as *const F);
367            f(&from_glib_borrow(this))
368        }
369        unsafe {
370            let f: Box_<F> = Box_::new(f);
371            connect_raw(
372                self.as_ptr() as *mut _,
373                c"notify::reveal-bottom-bars".as_ptr() as *const _,
374                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
375                    notify_reveal_bottom_bars_trampoline::<F> as *const (),
376                )),
377                Box_::into_raw(f),
378            )
379        }
380    }
381
382    #[cfg(feature = "v1_4")]
383    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
384    #[doc(alias = "reveal-top-bars")]
385    pub fn connect_reveal_top_bars_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
386        unsafe extern "C" fn notify_reveal_top_bars_trampoline<F: Fn(&ToolbarView) + 'static>(
387            this: *mut ffi::AdwToolbarView,
388            _param_spec: glib::ffi::gpointer,
389            f: glib::ffi::gpointer,
390        ) {
391            let f: &F = &*(f as *const F);
392            f(&from_glib_borrow(this))
393        }
394        unsafe {
395            let f: Box_<F> = Box_::new(f);
396            connect_raw(
397                self.as_ptr() as *mut _,
398                c"notify::reveal-top-bars".as_ptr() as *const _,
399                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
400                    notify_reveal_top_bars_trampoline::<F> as *const (),
401                )),
402                Box_::into_raw(f),
403            )
404        }
405    }
406
407    #[cfg(feature = "v1_4")]
408    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
409    #[doc(alias = "top-bar-height")]
410    pub fn connect_top_bar_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
411        unsafe extern "C" fn notify_top_bar_height_trampoline<F: Fn(&ToolbarView) + 'static>(
412            this: *mut ffi::AdwToolbarView,
413            _param_spec: glib::ffi::gpointer,
414            f: glib::ffi::gpointer,
415        ) {
416            let f: &F = &*(f as *const F);
417            f(&from_glib_borrow(this))
418        }
419        unsafe {
420            let f: Box_<F> = Box_::new(f);
421            connect_raw(
422                self.as_ptr() as *mut _,
423                c"notify::top-bar-height".as_ptr() as *const _,
424                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
425                    notify_top_bar_height_trampoline::<F> as *const (),
426                )),
427                Box_::into_raw(f),
428            )
429        }
430    }
431
432    #[cfg(feature = "v1_4")]
433    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
434    #[doc(alias = "top-bar-style")]
435    pub fn connect_top_bar_style_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
436        unsafe extern "C" fn notify_top_bar_style_trampoline<F: Fn(&ToolbarView) + 'static>(
437            this: *mut ffi::AdwToolbarView,
438            _param_spec: glib::ffi::gpointer,
439            f: glib::ffi::gpointer,
440        ) {
441            let f: &F = &*(f as *const F);
442            f(&from_glib_borrow(this))
443        }
444        unsafe {
445            let f: Box_<F> = Box_::new(f);
446            connect_raw(
447                self.as_ptr() as *mut _,
448                c"notify::top-bar-style".as_ptr() as *const _,
449                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
450                    notify_top_bar_style_trampoline::<F> as *const (),
451                )),
452                Box_::into_raw(f),
453            )
454        }
455    }
456}
457
458#[cfg(feature = "v1_4")]
459#[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
460impl Default for ToolbarView {
461    fn default() -> Self {
462        Self::new()
463    }
464}
465
466// rustdoc-stripper-ignore-next
467/// A [builder-pattern] type to construct [`ToolbarView`] objects.
468///
469/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
470#[must_use = "The builder must be built to be used"]
471pub struct ToolbarViewBuilder {
472    builder: glib::object::ObjectBuilder<'static, ToolbarView>,
473}
474
475impl ToolbarViewBuilder {
476    fn new() -> Self {
477        Self {
478            builder: glib::object::Object::builder(),
479        }
480    }
481
482    #[cfg(feature = "v1_4")]
483    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
484    pub fn bottom_bar_style(self, bottom_bar_style: ToolbarStyle) -> Self {
485        Self {
486            builder: self.builder.property("bottom-bar-style", bottom_bar_style),
487        }
488    }
489
490    #[cfg(feature = "v1_4")]
491    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
492    pub fn content(self, content: &impl IsA<gtk::Widget>) -> Self {
493        Self {
494            builder: self.builder.property("content", content.clone().upcast()),
495        }
496    }
497
498    #[cfg(feature = "v1_4")]
499    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
500    pub fn extend_content_to_bottom_edge(self, extend_content_to_bottom_edge: bool) -> Self {
501        Self {
502            builder: self.builder.property(
503                "extend-content-to-bottom-edge",
504                extend_content_to_bottom_edge,
505            ),
506        }
507    }
508
509    #[cfg(feature = "v1_4")]
510    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
511    pub fn extend_content_to_top_edge(self, extend_content_to_top_edge: bool) -> Self {
512        Self {
513            builder: self
514                .builder
515                .property("extend-content-to-top-edge", extend_content_to_top_edge),
516        }
517    }
518
519    #[cfg(feature = "v1_4")]
520    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
521    pub fn reveal_bottom_bars(self, reveal_bottom_bars: bool) -> Self {
522        Self {
523            builder: self
524                .builder
525                .property("reveal-bottom-bars", reveal_bottom_bars),
526        }
527    }
528
529    #[cfg(feature = "v1_4")]
530    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
531    pub fn reveal_top_bars(self, reveal_top_bars: bool) -> Self {
532        Self {
533            builder: self.builder.property("reveal-top-bars", reveal_top_bars),
534        }
535    }
536
537    #[cfg(feature = "v1_4")]
538    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
539    pub fn top_bar_style(self, top_bar_style: ToolbarStyle) -> Self {
540        Self {
541            builder: self.builder.property("top-bar-style", top_bar_style),
542        }
543    }
544
545    pub fn can_focus(self, can_focus: bool) -> Self {
546        Self {
547            builder: self.builder.property("can-focus", can_focus),
548        }
549    }
550
551    pub fn can_target(self, can_target: bool) -> Self {
552        Self {
553            builder: self.builder.property("can-target", can_target),
554        }
555    }
556
557    pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
558        Self {
559            builder: self.builder.property("css-classes", css_classes.into()),
560        }
561    }
562
563    pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
564        Self {
565            builder: self.builder.property("css-name", css_name.into()),
566        }
567    }
568
569    pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
570        Self {
571            builder: self.builder.property("cursor", cursor.clone()),
572        }
573    }
574
575    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
576        Self {
577            builder: self.builder.property("focus-on-click", focus_on_click),
578        }
579    }
580
581    pub fn focusable(self, focusable: bool) -> Self {
582        Self {
583            builder: self.builder.property("focusable", focusable),
584        }
585    }
586
587    pub fn halign(self, halign: gtk::Align) -> Self {
588        Self {
589            builder: self.builder.property("halign", halign),
590        }
591    }
592
593    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
594        Self {
595            builder: self.builder.property("has-tooltip", has_tooltip),
596        }
597    }
598
599    pub fn height_request(self, height_request: i32) -> Self {
600        Self {
601            builder: self.builder.property("height-request", height_request),
602        }
603    }
604
605    pub fn hexpand(self, hexpand: bool) -> Self {
606        Self {
607            builder: self.builder.property("hexpand", hexpand),
608        }
609    }
610
611    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
612        Self {
613            builder: self.builder.property("hexpand-set", hexpand_set),
614        }
615    }
616
617    pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
618        Self {
619            builder: self
620                .builder
621                .property("layout-manager", layout_manager.clone().upcast()),
622        }
623    }
624
625    #[cfg(feature = "gtk_v4_18")]
626    #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
627    pub fn limit_events(self, limit_events: bool) -> Self {
628        Self {
629            builder: self.builder.property("limit-events", limit_events),
630        }
631    }
632
633    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
634        Self {
635            builder: self.builder.property("margin-bottom", margin_bottom),
636        }
637    }
638
639    pub fn margin_end(self, margin_end: i32) -> Self {
640        Self {
641            builder: self.builder.property("margin-end", margin_end),
642        }
643    }
644
645    pub fn margin_start(self, margin_start: i32) -> Self {
646        Self {
647            builder: self.builder.property("margin-start", margin_start),
648        }
649    }
650
651    pub fn margin_top(self, margin_top: i32) -> Self {
652        Self {
653            builder: self.builder.property("margin-top", margin_top),
654        }
655    }
656
657    pub fn name(self, name: impl Into<glib::GString>) -> Self {
658        Self {
659            builder: self.builder.property("name", name.into()),
660        }
661    }
662
663    pub fn opacity(self, opacity: f64) -> Self {
664        Self {
665            builder: self.builder.property("opacity", opacity),
666        }
667    }
668
669    pub fn overflow(self, overflow: gtk::Overflow) -> Self {
670        Self {
671            builder: self.builder.property("overflow", overflow),
672        }
673    }
674
675    pub fn receives_default(self, receives_default: bool) -> Self {
676        Self {
677            builder: self.builder.property("receives-default", receives_default),
678        }
679    }
680
681    pub fn sensitive(self, sensitive: bool) -> Self {
682        Self {
683            builder: self.builder.property("sensitive", sensitive),
684        }
685    }
686
687    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
688        Self {
689            builder: self
690                .builder
691                .property("tooltip-markup", tooltip_markup.into()),
692        }
693    }
694
695    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
696        Self {
697            builder: self.builder.property("tooltip-text", tooltip_text.into()),
698        }
699    }
700
701    pub fn valign(self, valign: gtk::Align) -> Self {
702        Self {
703            builder: self.builder.property("valign", valign),
704        }
705    }
706
707    pub fn vexpand(self, vexpand: bool) -> Self {
708        Self {
709            builder: self.builder.property("vexpand", vexpand),
710        }
711    }
712
713    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
714        Self {
715            builder: self.builder.property("vexpand-set", vexpand_set),
716        }
717    }
718
719    pub fn visible(self, visible: bool) -> Self {
720        Self {
721            builder: self.builder.property("visible", visible),
722        }
723    }
724
725    pub fn width_request(self, width_request: i32) -> Self {
726        Self {
727            builder: self.builder.property("width-request", width_request),
728        }
729    }
730
731    pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
732        Self {
733            builder: self.builder.property("accessible-role", accessible_role),
734        }
735    }
736
737    // rustdoc-stripper-ignore-next
738    /// Build the [`ToolbarView`].
739    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
740    pub fn build(self) -> ToolbarView {
741        assert_initialized_main_thread!();
742        self.builder.build()
743    }
744}