1use crate::{ToolbarStyle, ffi};
7use glib::{
8 prelude::*,
9 signal::{SignalHandlerId, connect_raw},
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 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 unsafe {
229 let f: &F = &*(f as *const F);
230 f(&from_glib_borrow(this))
231 }
232 }
233 unsafe {
234 let f: Box_<F> = Box_::new(f);
235 connect_raw(
236 self.as_ptr() as *mut _,
237 c"notify::bottom-bar-height".as_ptr(),
238 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
239 notify_bottom_bar_height_trampoline::<F> as *const (),
240 )),
241 Box_::into_raw(f),
242 )
243 }
244 }
245
246 #[cfg(feature = "v1_4")]
247 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
248 #[doc(alias = "bottom-bar-style")]
249 pub fn connect_bottom_bar_style_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
250 unsafe extern "C" fn notify_bottom_bar_style_trampoline<F: Fn(&ToolbarView) + 'static>(
251 this: *mut ffi::AdwToolbarView,
252 _param_spec: glib::ffi::gpointer,
253 f: glib::ffi::gpointer,
254 ) {
255 unsafe {
256 let f: &F = &*(f as *const F);
257 f(&from_glib_borrow(this))
258 }
259 }
260 unsafe {
261 let f: Box_<F> = Box_::new(f);
262 connect_raw(
263 self.as_ptr() as *mut _,
264 c"notify::bottom-bar-style".as_ptr(),
265 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
266 notify_bottom_bar_style_trampoline::<F> as *const (),
267 )),
268 Box_::into_raw(f),
269 )
270 }
271 }
272
273 #[cfg(feature = "v1_4")]
274 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
275 #[doc(alias = "content")]
276 pub fn connect_content_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
277 unsafe extern "C" fn notify_content_trampoline<F: Fn(&ToolbarView) + 'static>(
278 this: *mut ffi::AdwToolbarView,
279 _param_spec: glib::ffi::gpointer,
280 f: glib::ffi::gpointer,
281 ) {
282 unsafe {
283 let f: &F = &*(f as *const F);
284 f(&from_glib_borrow(this))
285 }
286 }
287 unsafe {
288 let f: Box_<F> = Box_::new(f);
289 connect_raw(
290 self.as_ptr() as *mut _,
291 c"notify::content".as_ptr(),
292 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
293 notify_content_trampoline::<F> as *const (),
294 )),
295 Box_::into_raw(f),
296 )
297 }
298 }
299
300 #[cfg(feature = "v1_4")]
301 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
302 #[doc(alias = "extend-content-to-bottom-edge")]
303 pub fn connect_extend_content_to_bottom_edge_notify<F: Fn(&Self) + 'static>(
304 &self,
305 f: F,
306 ) -> SignalHandlerId {
307 unsafe extern "C" fn notify_extend_content_to_bottom_edge_trampoline<
308 F: Fn(&ToolbarView) + 'static,
309 >(
310 this: *mut ffi::AdwToolbarView,
311 _param_spec: glib::ffi::gpointer,
312 f: glib::ffi::gpointer,
313 ) {
314 unsafe {
315 let f: &F = &*(f as *const F);
316 f(&from_glib_borrow(this))
317 }
318 }
319 unsafe {
320 let f: Box_<F> = Box_::new(f);
321 connect_raw(
322 self.as_ptr() as *mut _,
323 c"notify::extend-content-to-bottom-edge".as_ptr(),
324 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
325 notify_extend_content_to_bottom_edge_trampoline::<F> as *const (),
326 )),
327 Box_::into_raw(f),
328 )
329 }
330 }
331
332 #[cfg(feature = "v1_4")]
333 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
334 #[doc(alias = "extend-content-to-top-edge")]
335 pub fn connect_extend_content_to_top_edge_notify<F: Fn(&Self) + 'static>(
336 &self,
337 f: F,
338 ) -> SignalHandlerId {
339 unsafe extern "C" fn notify_extend_content_to_top_edge_trampoline<
340 F: Fn(&ToolbarView) + 'static,
341 >(
342 this: *mut ffi::AdwToolbarView,
343 _param_spec: glib::ffi::gpointer,
344 f: glib::ffi::gpointer,
345 ) {
346 unsafe {
347 let f: &F = &*(f as *const F);
348 f(&from_glib_borrow(this))
349 }
350 }
351 unsafe {
352 let f: Box_<F> = Box_::new(f);
353 connect_raw(
354 self.as_ptr() as *mut _,
355 c"notify::extend-content-to-top-edge".as_ptr(),
356 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
357 notify_extend_content_to_top_edge_trampoline::<F> as *const (),
358 )),
359 Box_::into_raw(f),
360 )
361 }
362 }
363
364 #[cfg(feature = "v1_4")]
365 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
366 #[doc(alias = "reveal-bottom-bars")]
367 pub fn connect_reveal_bottom_bars_notify<F: Fn(&Self) + 'static>(
368 &self,
369 f: F,
370 ) -> SignalHandlerId {
371 unsafe extern "C" fn notify_reveal_bottom_bars_trampoline<F: Fn(&ToolbarView) + 'static>(
372 this: *mut ffi::AdwToolbarView,
373 _param_spec: glib::ffi::gpointer,
374 f: glib::ffi::gpointer,
375 ) {
376 unsafe {
377 let f: &F = &*(f as *const F);
378 f(&from_glib_borrow(this))
379 }
380 }
381 unsafe {
382 let f: Box_<F> = Box_::new(f);
383 connect_raw(
384 self.as_ptr() as *mut _,
385 c"notify::reveal-bottom-bars".as_ptr(),
386 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
387 notify_reveal_bottom_bars_trampoline::<F> as *const (),
388 )),
389 Box_::into_raw(f),
390 )
391 }
392 }
393
394 #[cfg(feature = "v1_4")]
395 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
396 #[doc(alias = "reveal-top-bars")]
397 pub fn connect_reveal_top_bars_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
398 unsafe extern "C" fn notify_reveal_top_bars_trampoline<F: Fn(&ToolbarView) + 'static>(
399 this: *mut ffi::AdwToolbarView,
400 _param_spec: glib::ffi::gpointer,
401 f: glib::ffi::gpointer,
402 ) {
403 unsafe {
404 let f: &F = &*(f as *const F);
405 f(&from_glib_borrow(this))
406 }
407 }
408 unsafe {
409 let f: Box_<F> = Box_::new(f);
410 connect_raw(
411 self.as_ptr() as *mut _,
412 c"notify::reveal-top-bars".as_ptr(),
413 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
414 notify_reveal_top_bars_trampoline::<F> as *const (),
415 )),
416 Box_::into_raw(f),
417 )
418 }
419 }
420
421 #[cfg(feature = "v1_4")]
422 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
423 #[doc(alias = "top-bar-height")]
424 pub fn connect_top_bar_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
425 unsafe extern "C" fn notify_top_bar_height_trampoline<F: Fn(&ToolbarView) + 'static>(
426 this: *mut ffi::AdwToolbarView,
427 _param_spec: glib::ffi::gpointer,
428 f: glib::ffi::gpointer,
429 ) {
430 unsafe {
431 let f: &F = &*(f as *const F);
432 f(&from_glib_borrow(this))
433 }
434 }
435 unsafe {
436 let f: Box_<F> = Box_::new(f);
437 connect_raw(
438 self.as_ptr() as *mut _,
439 c"notify::top-bar-height".as_ptr(),
440 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
441 notify_top_bar_height_trampoline::<F> as *const (),
442 )),
443 Box_::into_raw(f),
444 )
445 }
446 }
447
448 #[cfg(feature = "v1_4")]
449 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
450 #[doc(alias = "top-bar-style")]
451 pub fn connect_top_bar_style_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
452 unsafe extern "C" fn notify_top_bar_style_trampoline<F: Fn(&ToolbarView) + 'static>(
453 this: *mut ffi::AdwToolbarView,
454 _param_spec: glib::ffi::gpointer,
455 f: glib::ffi::gpointer,
456 ) {
457 unsafe {
458 let f: &F = &*(f as *const F);
459 f(&from_glib_borrow(this))
460 }
461 }
462 unsafe {
463 let f: Box_<F> = Box_::new(f);
464 connect_raw(
465 self.as_ptr() as *mut _,
466 c"notify::top-bar-style".as_ptr(),
467 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
468 notify_top_bar_style_trampoline::<F> as *const (),
469 )),
470 Box_::into_raw(f),
471 )
472 }
473 }
474}
475
476#[cfg(feature = "v1_4")]
477#[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
478impl Default for ToolbarView {
479 fn default() -> Self {
480 Self::new()
481 }
482}
483
484#[must_use = "The builder must be built to be used"]
489pub struct ToolbarViewBuilder {
490 builder: glib::object::ObjectBuilder<'static, ToolbarView>,
491}
492
493impl ToolbarViewBuilder {
494 fn new() -> Self {
495 Self {
496 builder: glib::object::Object::builder(),
497 }
498 }
499
500 #[cfg(feature = "v1_4")]
501 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
502 pub fn bottom_bar_style(self, bottom_bar_style: ToolbarStyle) -> Self {
503 Self {
504 builder: self.builder.property("bottom-bar-style", bottom_bar_style),
505 }
506 }
507
508 #[cfg(feature = "v1_4")]
509 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
510 pub fn content(self, content: &impl IsA<gtk::Widget>) -> Self {
511 Self {
512 builder: self.builder.property("content", content.clone().upcast()),
513 }
514 }
515
516 #[cfg(feature = "v1_4")]
517 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
518 pub fn extend_content_to_bottom_edge(self, extend_content_to_bottom_edge: bool) -> Self {
519 Self {
520 builder: self.builder.property(
521 "extend-content-to-bottom-edge",
522 extend_content_to_bottom_edge,
523 ),
524 }
525 }
526
527 #[cfg(feature = "v1_4")]
528 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
529 pub fn extend_content_to_top_edge(self, extend_content_to_top_edge: bool) -> Self {
530 Self {
531 builder: self
532 .builder
533 .property("extend-content-to-top-edge", extend_content_to_top_edge),
534 }
535 }
536
537 #[cfg(feature = "v1_4")]
538 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
539 pub fn reveal_bottom_bars(self, reveal_bottom_bars: bool) -> Self {
540 Self {
541 builder: self
542 .builder
543 .property("reveal-bottom-bars", reveal_bottom_bars),
544 }
545 }
546
547 #[cfg(feature = "v1_4")]
548 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
549 pub fn reveal_top_bars(self, reveal_top_bars: bool) -> Self {
550 Self {
551 builder: self.builder.property("reveal-top-bars", reveal_top_bars),
552 }
553 }
554
555 #[cfg(feature = "v1_4")]
556 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
557 pub fn top_bar_style(self, top_bar_style: ToolbarStyle) -> Self {
558 Self {
559 builder: self.builder.property("top-bar-style", top_bar_style),
560 }
561 }
562
563 pub fn can_focus(self, can_focus: bool) -> Self {
564 Self {
565 builder: self.builder.property("can-focus", can_focus),
566 }
567 }
568
569 pub fn can_target(self, can_target: bool) -> Self {
570 Self {
571 builder: self.builder.property("can-target", can_target),
572 }
573 }
574
575 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
576 Self {
577 builder: self.builder.property("css-classes", css_classes.into()),
578 }
579 }
580
581 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
582 Self {
583 builder: self.builder.property("css-name", css_name.into()),
584 }
585 }
586
587 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
588 Self {
589 builder: self.builder.property("cursor", cursor.clone()),
590 }
591 }
592
593 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
594 Self {
595 builder: self.builder.property("focus-on-click", focus_on_click),
596 }
597 }
598
599 pub fn focusable(self, focusable: bool) -> Self {
600 Self {
601 builder: self.builder.property("focusable", focusable),
602 }
603 }
604
605 pub fn halign(self, halign: gtk::Align) -> Self {
606 Self {
607 builder: self.builder.property("halign", halign),
608 }
609 }
610
611 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
612 Self {
613 builder: self.builder.property("has-tooltip", has_tooltip),
614 }
615 }
616
617 pub fn height_request(self, height_request: i32) -> Self {
618 Self {
619 builder: self.builder.property("height-request", height_request),
620 }
621 }
622
623 pub fn hexpand(self, hexpand: bool) -> Self {
624 Self {
625 builder: self.builder.property("hexpand", hexpand),
626 }
627 }
628
629 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
630 Self {
631 builder: self.builder.property("hexpand-set", hexpand_set),
632 }
633 }
634
635 pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
636 Self {
637 builder: self
638 .builder
639 .property("layout-manager", layout_manager.clone().upcast()),
640 }
641 }
642
643 #[cfg(feature = "gtk_v4_18")]
644 #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
645 pub fn limit_events(self, limit_events: bool) -> Self {
646 Self {
647 builder: self.builder.property("limit-events", limit_events),
648 }
649 }
650
651 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
652 Self {
653 builder: self.builder.property("margin-bottom", margin_bottom),
654 }
655 }
656
657 pub fn margin_end(self, margin_end: i32) -> Self {
658 Self {
659 builder: self.builder.property("margin-end", margin_end),
660 }
661 }
662
663 pub fn margin_start(self, margin_start: i32) -> Self {
664 Self {
665 builder: self.builder.property("margin-start", margin_start),
666 }
667 }
668
669 pub fn margin_top(self, margin_top: i32) -> Self {
670 Self {
671 builder: self.builder.property("margin-top", margin_top),
672 }
673 }
674
675 pub fn name(self, name: impl Into<glib::GString>) -> Self {
676 Self {
677 builder: self.builder.property("name", name.into()),
678 }
679 }
680
681 pub fn opacity(self, opacity: f64) -> Self {
682 Self {
683 builder: self.builder.property("opacity", opacity),
684 }
685 }
686
687 pub fn overflow(self, overflow: gtk::Overflow) -> Self {
688 Self {
689 builder: self.builder.property("overflow", overflow),
690 }
691 }
692
693 pub fn receives_default(self, receives_default: bool) -> Self {
694 Self {
695 builder: self.builder.property("receives-default", receives_default),
696 }
697 }
698
699 pub fn sensitive(self, sensitive: bool) -> Self {
700 Self {
701 builder: self.builder.property("sensitive", sensitive),
702 }
703 }
704
705 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
706 Self {
707 builder: self
708 .builder
709 .property("tooltip-markup", tooltip_markup.into()),
710 }
711 }
712
713 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
714 Self {
715 builder: self.builder.property("tooltip-text", tooltip_text.into()),
716 }
717 }
718
719 pub fn valign(self, valign: gtk::Align) -> Self {
720 Self {
721 builder: self.builder.property("valign", valign),
722 }
723 }
724
725 pub fn vexpand(self, vexpand: bool) -> Self {
726 Self {
727 builder: self.builder.property("vexpand", vexpand),
728 }
729 }
730
731 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
732 Self {
733 builder: self.builder.property("vexpand-set", vexpand_set),
734 }
735 }
736
737 pub fn visible(self, visible: bool) -> Self {
738 Self {
739 builder: self.builder.property("visible", visible),
740 }
741 }
742
743 pub fn width_request(self, width_request: i32) -> Self {
744 Self {
745 builder: self.builder.property("width-request", width_request),
746 }
747 }
748
749 pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
750 Self {
751 builder: self.builder.property("accessible-role", accessible_role),
752 }
753 }
754
755 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
758 pub fn build(self) -> ToolbarView {
759 assert_initialized_main_thread!();
760 self.builder.build()
761 }
762}