1use crate::{ffi, TabPage, TabView};
7use glib::{
8 object::ObjectType as _,
9 prelude::*,
10 signal::{connect_raw, SignalHandlerId},
11 translate::*,
12};
13use std::boxed::Box as Box_;
14
15glib::wrapper! {
16 #[doc(alias = "AdwTabBar")]
17 pub struct TabBar(Object<ffi::AdwTabBar, ffi::AdwTabBarClass>) @extends gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
18
19 match fn {
20 type_ => || ffi::adw_tab_bar_get_type(),
21 }
22}
23
24impl TabBar {
25 #[doc(alias = "adw_tab_bar_new")]
26 pub fn new() -> TabBar {
27 assert_initialized_main_thread!();
28 unsafe { from_glib_none(ffi::adw_tab_bar_new()) }
29 }
30
31 pub fn builder() -> TabBarBuilder {
36 TabBarBuilder::new()
37 }
38
39 #[doc(alias = "adw_tab_bar_get_autohide")]
40 #[doc(alias = "get_autohide")]
41 #[doc(alias = "autohide")]
42 pub fn is_autohide(&self) -> bool {
43 unsafe { from_glib(ffi::adw_tab_bar_get_autohide(self.to_glib_none().0)) }
44 }
45
46 #[doc(alias = "adw_tab_bar_get_end_action_widget")]
47 #[doc(alias = "get_end_action_widget")]
48 #[doc(alias = "end-action-widget")]
49 pub fn end_action_widget(&self) -> Option<gtk::Widget> {
50 unsafe {
51 from_glib_none(ffi::adw_tab_bar_get_end_action_widget(
52 self.to_glib_none().0,
53 ))
54 }
55 }
56
57 #[doc(alias = "adw_tab_bar_get_expand_tabs")]
58 #[doc(alias = "get_expand_tabs")]
59 #[doc(alias = "expand-tabs")]
60 pub fn expands_tabs(&self) -> bool {
61 unsafe { from_glib(ffi::adw_tab_bar_get_expand_tabs(self.to_glib_none().0)) }
62 }
63
64 #[cfg(feature = "v1_4")]
65 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
66 #[doc(alias = "adw_tab_bar_get_extra_drag_preferred_action")]
67 #[doc(alias = "get_extra_drag_preferred_action")]
68 #[doc(alias = "extra-drag-preferred-action")]
69 pub fn extra_drag_preferred_action(&self) -> gdk::DragAction {
70 unsafe {
71 from_glib(ffi::adw_tab_bar_get_extra_drag_preferred_action(
72 self.to_glib_none().0,
73 ))
74 }
75 }
76
77 #[cfg(feature = "v1_3")]
78 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
79 #[doc(alias = "adw_tab_bar_get_extra_drag_preload")]
80 #[doc(alias = "get_extra_drag_preload")]
81 #[doc(alias = "extra-drag-preload")]
82 pub fn is_extra_drag_preload(&self) -> bool {
83 unsafe {
84 from_glib(ffi::adw_tab_bar_get_extra_drag_preload(
85 self.to_glib_none().0,
86 ))
87 }
88 }
89
90 #[doc(alias = "adw_tab_bar_get_inverted")]
91 #[doc(alias = "get_inverted")]
92 #[doc(alias = "inverted")]
93 pub fn is_inverted(&self) -> bool {
94 unsafe { from_glib(ffi::adw_tab_bar_get_inverted(self.to_glib_none().0)) }
95 }
96
97 #[doc(alias = "adw_tab_bar_get_is_overflowing")]
98 #[doc(alias = "get_is_overflowing")]
99 #[doc(alias = "is-overflowing")]
100 pub fn is_overflowing(&self) -> bool {
101 unsafe { from_glib(ffi::adw_tab_bar_get_is_overflowing(self.to_glib_none().0)) }
102 }
103
104 #[doc(alias = "adw_tab_bar_get_start_action_widget")]
105 #[doc(alias = "get_start_action_widget")]
106 #[doc(alias = "start-action-widget")]
107 pub fn start_action_widget(&self) -> Option<gtk::Widget> {
108 unsafe {
109 from_glib_none(ffi::adw_tab_bar_get_start_action_widget(
110 self.to_glib_none().0,
111 ))
112 }
113 }
114
115 #[doc(alias = "adw_tab_bar_get_tabs_revealed")]
116 #[doc(alias = "get_tabs_revealed")]
117 #[doc(alias = "tabs-revealed")]
118 pub fn is_tabs_revealed(&self) -> bool {
119 unsafe { from_glib(ffi::adw_tab_bar_get_tabs_revealed(self.to_glib_none().0)) }
120 }
121
122 #[doc(alias = "adw_tab_bar_get_view")]
123 #[doc(alias = "get_view")]
124 pub fn view(&self) -> Option<TabView> {
125 unsafe { from_glib_none(ffi::adw_tab_bar_get_view(self.to_glib_none().0)) }
126 }
127
128 #[doc(alias = "adw_tab_bar_set_autohide")]
129 #[doc(alias = "autohide")]
130 pub fn set_autohide(&self, autohide: bool) {
131 unsafe {
132 ffi::adw_tab_bar_set_autohide(self.to_glib_none().0, autohide.into_glib());
133 }
134 }
135
136 #[doc(alias = "adw_tab_bar_set_end_action_widget")]
137 #[doc(alias = "end-action-widget")]
138 pub fn set_end_action_widget(&self, widget: Option<&impl IsA<gtk::Widget>>) {
139 unsafe {
140 ffi::adw_tab_bar_set_end_action_widget(
141 self.to_glib_none().0,
142 widget.map(|p| p.as_ref()).to_glib_none().0,
143 );
144 }
145 }
146
147 #[doc(alias = "adw_tab_bar_set_expand_tabs")]
148 #[doc(alias = "expand-tabs")]
149 pub fn set_expand_tabs(&self, expand_tabs: bool) {
150 unsafe {
151 ffi::adw_tab_bar_set_expand_tabs(self.to_glib_none().0, expand_tabs.into_glib());
152 }
153 }
154
155 #[cfg(feature = "v1_3")]
156 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
157 #[doc(alias = "adw_tab_bar_set_extra_drag_preload")]
158 #[doc(alias = "extra-drag-preload")]
159 pub fn set_extra_drag_preload(&self, preload: bool) {
160 unsafe {
161 ffi::adw_tab_bar_set_extra_drag_preload(self.to_glib_none().0, preload.into_glib());
162 }
163 }
164
165 #[doc(alias = "adw_tab_bar_set_inverted")]
166 #[doc(alias = "inverted")]
167 pub fn set_inverted(&self, inverted: bool) {
168 unsafe {
169 ffi::adw_tab_bar_set_inverted(self.to_glib_none().0, inverted.into_glib());
170 }
171 }
172
173 #[doc(alias = "adw_tab_bar_set_start_action_widget")]
174 #[doc(alias = "start-action-widget")]
175 pub fn set_start_action_widget(&self, widget: Option<&impl IsA<gtk::Widget>>) {
176 unsafe {
177 ffi::adw_tab_bar_set_start_action_widget(
178 self.to_glib_none().0,
179 widget.map(|p| p.as_ref()).to_glib_none().0,
180 );
181 }
182 }
183
184 #[doc(alias = "adw_tab_bar_set_view")]
185 #[doc(alias = "view")]
186 pub fn set_view(&self, view: Option<&TabView>) {
187 unsafe {
188 ffi::adw_tab_bar_set_view(self.to_glib_none().0, view.to_glib_none().0);
189 }
190 }
191
192 #[doc(alias = "extra-drag-drop")]
193 pub fn connect_extra_drag_drop<F: Fn(&Self, &TabPage, &glib::Value) -> bool + 'static>(
194 &self,
195 f: F,
196 ) -> SignalHandlerId {
197 unsafe extern "C" fn extra_drag_drop_trampoline<
198 F: Fn(&TabBar, &TabPage, &glib::Value) -> bool + 'static,
199 >(
200 this: *mut ffi::AdwTabBar,
201 page: *mut ffi::AdwTabPage,
202 value: *mut glib::gobject_ffi::GValue,
203 f: glib::ffi::gpointer,
204 ) -> glib::ffi::gboolean {
205 let f: &F = &*(f as *const F);
206 f(
207 &from_glib_borrow(this),
208 &from_glib_borrow(page),
209 &from_glib_borrow(value),
210 )
211 .into_glib()
212 }
213 unsafe {
214 let f: Box_<F> = Box_::new(f);
215 connect_raw(
216 self.as_ptr() as *mut _,
217 c"extra-drag-drop".as_ptr() as *const _,
218 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
219 extra_drag_drop_trampoline::<F> as *const (),
220 )),
221 Box_::into_raw(f),
222 )
223 }
224 }
225
226 #[cfg(feature = "v1_3")]
227 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
228 #[doc(alias = "extra-drag-value")]
229 pub fn connect_extra_drag_value<
230 F: Fn(&Self, &TabPage, Option<&glib::Value>) -> gdk::DragAction + 'static,
231 >(
232 &self,
233 f: F,
234 ) -> SignalHandlerId {
235 unsafe extern "C" fn extra_drag_value_trampoline<
236 F: Fn(&TabBar, &TabPage, Option<&glib::Value>) -> gdk::DragAction + 'static,
237 >(
238 this: *mut ffi::AdwTabBar,
239 page: *mut ffi::AdwTabPage,
240 value: *mut glib::gobject_ffi::GValue,
241 f: glib::ffi::gpointer,
242 ) -> gdk::ffi::GdkDragAction {
243 let f: &F = &*(f as *const F);
244 f(
245 &from_glib_borrow(this),
246 &from_glib_borrow(page),
247 Option::<glib::Value>::from_glib_borrow(value)
248 .as_ref()
249 .as_ref(),
250 )
251 .into_glib()
252 }
253 unsafe {
254 let f: Box_<F> = Box_::new(f);
255 connect_raw(
256 self.as_ptr() as *mut _,
257 c"extra-drag-value".as_ptr() as *const _,
258 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
259 extra_drag_value_trampoline::<F> as *const (),
260 )),
261 Box_::into_raw(f),
262 )
263 }
264 }
265
266 #[doc(alias = "autohide")]
267 pub fn connect_autohide_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
268 unsafe extern "C" fn notify_autohide_trampoline<F: Fn(&TabBar) + 'static>(
269 this: *mut ffi::AdwTabBar,
270 _param_spec: glib::ffi::gpointer,
271 f: glib::ffi::gpointer,
272 ) {
273 let f: &F = &*(f as *const F);
274 f(&from_glib_borrow(this))
275 }
276 unsafe {
277 let f: Box_<F> = Box_::new(f);
278 connect_raw(
279 self.as_ptr() as *mut _,
280 c"notify::autohide".as_ptr() as *const _,
281 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
282 notify_autohide_trampoline::<F> as *const (),
283 )),
284 Box_::into_raw(f),
285 )
286 }
287 }
288
289 #[doc(alias = "end-action-widget")]
290 pub fn connect_end_action_widget_notify<F: Fn(&Self) + 'static>(
291 &self,
292 f: F,
293 ) -> SignalHandlerId {
294 unsafe extern "C" fn notify_end_action_widget_trampoline<F: Fn(&TabBar) + 'static>(
295 this: *mut ffi::AdwTabBar,
296 _param_spec: glib::ffi::gpointer,
297 f: glib::ffi::gpointer,
298 ) {
299 let f: &F = &*(f as *const F);
300 f(&from_glib_borrow(this))
301 }
302 unsafe {
303 let f: Box_<F> = Box_::new(f);
304 connect_raw(
305 self.as_ptr() as *mut _,
306 c"notify::end-action-widget".as_ptr() as *const _,
307 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
308 notify_end_action_widget_trampoline::<F> as *const (),
309 )),
310 Box_::into_raw(f),
311 )
312 }
313 }
314
315 #[doc(alias = "expand-tabs")]
316 pub fn connect_expand_tabs_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
317 unsafe extern "C" fn notify_expand_tabs_trampoline<F: Fn(&TabBar) + 'static>(
318 this: *mut ffi::AdwTabBar,
319 _param_spec: glib::ffi::gpointer,
320 f: glib::ffi::gpointer,
321 ) {
322 let f: &F = &*(f as *const F);
323 f(&from_glib_borrow(this))
324 }
325 unsafe {
326 let f: Box_<F> = Box_::new(f);
327 connect_raw(
328 self.as_ptr() as *mut _,
329 c"notify::expand-tabs".as_ptr() as *const _,
330 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
331 notify_expand_tabs_trampoline::<F> as *const (),
332 )),
333 Box_::into_raw(f),
334 )
335 }
336 }
337
338 #[cfg(feature = "v1_4")]
339 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
340 #[doc(alias = "extra-drag-preferred-action")]
341 pub fn connect_extra_drag_preferred_action_notify<F: Fn(&Self) + 'static>(
342 &self,
343 f: F,
344 ) -> SignalHandlerId {
345 unsafe extern "C" fn notify_extra_drag_preferred_action_trampoline<
346 F: Fn(&TabBar) + 'static,
347 >(
348 this: *mut ffi::AdwTabBar,
349 _param_spec: glib::ffi::gpointer,
350 f: glib::ffi::gpointer,
351 ) {
352 let f: &F = &*(f as *const F);
353 f(&from_glib_borrow(this))
354 }
355 unsafe {
356 let f: Box_<F> = Box_::new(f);
357 connect_raw(
358 self.as_ptr() as *mut _,
359 c"notify::extra-drag-preferred-action".as_ptr() as *const _,
360 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
361 notify_extra_drag_preferred_action_trampoline::<F> as *const (),
362 )),
363 Box_::into_raw(f),
364 )
365 }
366 }
367
368 #[cfg(feature = "v1_3")]
369 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
370 #[doc(alias = "extra-drag-preload")]
371 pub fn connect_extra_drag_preload_notify<F: Fn(&Self) + 'static>(
372 &self,
373 f: F,
374 ) -> SignalHandlerId {
375 unsafe extern "C" fn notify_extra_drag_preload_trampoline<F: Fn(&TabBar) + 'static>(
376 this: *mut ffi::AdwTabBar,
377 _param_spec: glib::ffi::gpointer,
378 f: glib::ffi::gpointer,
379 ) {
380 let f: &F = &*(f as *const F);
381 f(&from_glib_borrow(this))
382 }
383 unsafe {
384 let f: Box_<F> = Box_::new(f);
385 connect_raw(
386 self.as_ptr() as *mut _,
387 c"notify::extra-drag-preload".as_ptr() as *const _,
388 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
389 notify_extra_drag_preload_trampoline::<F> as *const (),
390 )),
391 Box_::into_raw(f),
392 )
393 }
394 }
395
396 #[doc(alias = "inverted")]
397 pub fn connect_inverted_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
398 unsafe extern "C" fn notify_inverted_trampoline<F: Fn(&TabBar) + 'static>(
399 this: *mut ffi::AdwTabBar,
400 _param_spec: glib::ffi::gpointer,
401 f: glib::ffi::gpointer,
402 ) {
403 let f: &F = &*(f as *const F);
404 f(&from_glib_borrow(this))
405 }
406 unsafe {
407 let f: Box_<F> = Box_::new(f);
408 connect_raw(
409 self.as_ptr() as *mut _,
410 c"notify::inverted".as_ptr() as *const _,
411 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
412 notify_inverted_trampoline::<F> as *const (),
413 )),
414 Box_::into_raw(f),
415 )
416 }
417 }
418
419 #[doc(alias = "is-overflowing")]
420 pub fn connect_is_overflowing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
421 unsafe extern "C" fn notify_is_overflowing_trampoline<F: Fn(&TabBar) + 'static>(
422 this: *mut ffi::AdwTabBar,
423 _param_spec: glib::ffi::gpointer,
424 f: glib::ffi::gpointer,
425 ) {
426 let f: &F = &*(f as *const F);
427 f(&from_glib_borrow(this))
428 }
429 unsafe {
430 let f: Box_<F> = Box_::new(f);
431 connect_raw(
432 self.as_ptr() as *mut _,
433 c"notify::is-overflowing".as_ptr() as *const _,
434 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
435 notify_is_overflowing_trampoline::<F> as *const (),
436 )),
437 Box_::into_raw(f),
438 )
439 }
440 }
441
442 #[doc(alias = "start-action-widget")]
443 pub fn connect_start_action_widget_notify<F: Fn(&Self) + 'static>(
444 &self,
445 f: F,
446 ) -> SignalHandlerId {
447 unsafe extern "C" fn notify_start_action_widget_trampoline<F: Fn(&TabBar) + 'static>(
448 this: *mut ffi::AdwTabBar,
449 _param_spec: glib::ffi::gpointer,
450 f: glib::ffi::gpointer,
451 ) {
452 let f: &F = &*(f as *const F);
453 f(&from_glib_borrow(this))
454 }
455 unsafe {
456 let f: Box_<F> = Box_::new(f);
457 connect_raw(
458 self.as_ptr() as *mut _,
459 c"notify::start-action-widget".as_ptr() as *const _,
460 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
461 notify_start_action_widget_trampoline::<F> as *const (),
462 )),
463 Box_::into_raw(f),
464 )
465 }
466 }
467
468 #[doc(alias = "tabs-revealed")]
469 pub fn connect_tabs_revealed_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
470 unsafe extern "C" fn notify_tabs_revealed_trampoline<F: Fn(&TabBar) + 'static>(
471 this: *mut ffi::AdwTabBar,
472 _param_spec: glib::ffi::gpointer,
473 f: glib::ffi::gpointer,
474 ) {
475 let f: &F = &*(f as *const F);
476 f(&from_glib_borrow(this))
477 }
478 unsafe {
479 let f: Box_<F> = Box_::new(f);
480 connect_raw(
481 self.as_ptr() as *mut _,
482 c"notify::tabs-revealed".as_ptr() as *const _,
483 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
484 notify_tabs_revealed_trampoline::<F> as *const (),
485 )),
486 Box_::into_raw(f),
487 )
488 }
489 }
490
491 #[doc(alias = "view")]
492 pub fn connect_view_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
493 unsafe extern "C" fn notify_view_trampoline<F: Fn(&TabBar) + 'static>(
494 this: *mut ffi::AdwTabBar,
495 _param_spec: glib::ffi::gpointer,
496 f: glib::ffi::gpointer,
497 ) {
498 let f: &F = &*(f as *const F);
499 f(&from_glib_borrow(this))
500 }
501 unsafe {
502 let f: Box_<F> = Box_::new(f);
503 connect_raw(
504 self.as_ptr() as *mut _,
505 c"notify::view".as_ptr() as *const _,
506 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
507 notify_view_trampoline::<F> as *const (),
508 )),
509 Box_::into_raw(f),
510 )
511 }
512 }
513}
514
515impl Default for TabBar {
516 fn default() -> Self {
517 Self::new()
518 }
519}
520
521#[must_use = "The builder must be built to be used"]
526pub struct TabBarBuilder {
527 builder: glib::object::ObjectBuilder<'static, TabBar>,
528}
529
530impl TabBarBuilder {
531 fn new() -> Self {
532 Self {
533 builder: glib::object::Object::builder(),
534 }
535 }
536
537 pub fn autohide(self, autohide: bool) -> Self {
538 Self {
539 builder: self.builder.property("autohide", autohide),
540 }
541 }
542
543 pub fn end_action_widget(self, end_action_widget: &impl IsA<gtk::Widget>) -> Self {
544 Self {
545 builder: self
546 .builder
547 .property("end-action-widget", end_action_widget.clone().upcast()),
548 }
549 }
550
551 pub fn expand_tabs(self, expand_tabs: bool) -> Self {
552 Self {
553 builder: self.builder.property("expand-tabs", expand_tabs),
554 }
555 }
556
557 #[cfg(feature = "v1_3")]
558 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
559 pub fn extra_drag_preload(self, extra_drag_preload: bool) -> Self {
560 Self {
561 builder: self
562 .builder
563 .property("extra-drag-preload", extra_drag_preload),
564 }
565 }
566
567 pub fn inverted(self, inverted: bool) -> Self {
568 Self {
569 builder: self.builder.property("inverted", inverted),
570 }
571 }
572
573 pub fn start_action_widget(self, start_action_widget: &impl IsA<gtk::Widget>) -> Self {
574 Self {
575 builder: self
576 .builder
577 .property("start-action-widget", start_action_widget.clone().upcast()),
578 }
579 }
580
581 pub fn view(self, view: &TabView) -> Self {
582 Self {
583 builder: self.builder.property("view", view.clone()),
584 }
585 }
586
587 pub fn can_focus(self, can_focus: bool) -> Self {
588 Self {
589 builder: self.builder.property("can-focus", can_focus),
590 }
591 }
592
593 pub fn can_target(self, can_target: bool) -> Self {
594 Self {
595 builder: self.builder.property("can-target", can_target),
596 }
597 }
598
599 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
600 Self {
601 builder: self.builder.property("css-classes", css_classes.into()),
602 }
603 }
604
605 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
606 Self {
607 builder: self.builder.property("css-name", css_name.into()),
608 }
609 }
610
611 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
612 Self {
613 builder: self.builder.property("cursor", cursor.clone()),
614 }
615 }
616
617 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
618 Self {
619 builder: self.builder.property("focus-on-click", focus_on_click),
620 }
621 }
622
623 pub fn focusable(self, focusable: bool) -> Self {
624 Self {
625 builder: self.builder.property("focusable", focusable),
626 }
627 }
628
629 pub fn halign(self, halign: gtk::Align) -> Self {
630 Self {
631 builder: self.builder.property("halign", halign),
632 }
633 }
634
635 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
636 Self {
637 builder: self.builder.property("has-tooltip", has_tooltip),
638 }
639 }
640
641 pub fn height_request(self, height_request: i32) -> Self {
642 Self {
643 builder: self.builder.property("height-request", height_request),
644 }
645 }
646
647 pub fn hexpand(self, hexpand: bool) -> Self {
648 Self {
649 builder: self.builder.property("hexpand", hexpand),
650 }
651 }
652
653 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
654 Self {
655 builder: self.builder.property("hexpand-set", hexpand_set),
656 }
657 }
658
659 pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
660 Self {
661 builder: self
662 .builder
663 .property("layout-manager", layout_manager.clone().upcast()),
664 }
665 }
666
667 #[cfg(feature = "gtk_v4_18")]
668 #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
669 pub fn limit_events(self, limit_events: bool) -> Self {
670 Self {
671 builder: self.builder.property("limit-events", limit_events),
672 }
673 }
674
675 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
676 Self {
677 builder: self.builder.property("margin-bottom", margin_bottom),
678 }
679 }
680
681 pub fn margin_end(self, margin_end: i32) -> Self {
682 Self {
683 builder: self.builder.property("margin-end", margin_end),
684 }
685 }
686
687 pub fn margin_start(self, margin_start: i32) -> Self {
688 Self {
689 builder: self.builder.property("margin-start", margin_start),
690 }
691 }
692
693 pub fn margin_top(self, margin_top: i32) -> Self {
694 Self {
695 builder: self.builder.property("margin-top", margin_top),
696 }
697 }
698
699 pub fn name(self, name: impl Into<glib::GString>) -> Self {
700 Self {
701 builder: self.builder.property("name", name.into()),
702 }
703 }
704
705 pub fn opacity(self, opacity: f64) -> Self {
706 Self {
707 builder: self.builder.property("opacity", opacity),
708 }
709 }
710
711 pub fn overflow(self, overflow: gtk::Overflow) -> Self {
712 Self {
713 builder: self.builder.property("overflow", overflow),
714 }
715 }
716
717 pub fn receives_default(self, receives_default: bool) -> Self {
718 Self {
719 builder: self.builder.property("receives-default", receives_default),
720 }
721 }
722
723 pub fn sensitive(self, sensitive: bool) -> Self {
724 Self {
725 builder: self.builder.property("sensitive", sensitive),
726 }
727 }
728
729 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
730 Self {
731 builder: self
732 .builder
733 .property("tooltip-markup", tooltip_markup.into()),
734 }
735 }
736
737 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
738 Self {
739 builder: self.builder.property("tooltip-text", tooltip_text.into()),
740 }
741 }
742
743 pub fn valign(self, valign: gtk::Align) -> Self {
744 Self {
745 builder: self.builder.property("valign", valign),
746 }
747 }
748
749 pub fn vexpand(self, vexpand: bool) -> Self {
750 Self {
751 builder: self.builder.property("vexpand", vexpand),
752 }
753 }
754
755 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
756 Self {
757 builder: self.builder.property("vexpand-set", vexpand_set),
758 }
759 }
760
761 pub fn visible(self, visible: bool) -> Self {
762 Self {
763 builder: self.builder.property("visible", visible),
764 }
765 }
766
767 pub fn width_request(self, width_request: i32) -> Self {
768 Self {
769 builder: self.builder.property("width-request", width_request),
770 }
771 }
772
773 pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
774 Self {
775 builder: self.builder.property("accessible-role", accessible_role),
776 }
777 }
778
779 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
782 pub fn build(self) -> TabBar {
783 assert_initialized_main_thread!();
784 self.builder.build()
785 }
786}