libadwaita/auto/
split_button.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;
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 = "AdwSplitButton")]
17    pub struct SplitButton(Object<ffi::AdwSplitButton, ffi::AdwSplitButtonClass>) @extends gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Actionable;
18
19    match fn {
20        type_ => || ffi::adw_split_button_get_type(),
21    }
22}
23
24impl SplitButton {
25    #[doc(alias = "adw_split_button_new")]
26    pub fn new() -> SplitButton {
27        assert_initialized_main_thread!();
28        unsafe { gtk::Widget::from_glib_none(ffi::adw_split_button_new()).unsafe_cast() }
29    }
30
31    // rustdoc-stripper-ignore-next
32    /// Creates a new builder-pattern struct instance to construct [`SplitButton`] objects.
33    ///
34    /// This method returns an instance of [`SplitButtonBuilder`](crate::builders::SplitButtonBuilder) which can be used to create [`SplitButton`] objects.
35    pub fn builder() -> SplitButtonBuilder {
36        SplitButtonBuilder::new()
37    }
38
39    #[cfg(feature = "v1_4")]
40    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
41    #[doc(alias = "adw_split_button_get_can_shrink")]
42    #[doc(alias = "get_can_shrink")]
43    #[doc(alias = "can-shrink")]
44    pub fn can_shrink(&self) -> bool {
45        unsafe { from_glib(ffi::adw_split_button_get_can_shrink(self.to_glib_none().0)) }
46    }
47
48    #[doc(alias = "adw_split_button_get_child")]
49    #[doc(alias = "get_child")]
50    pub fn child(&self) -> Option<gtk::Widget> {
51        unsafe { from_glib_none(ffi::adw_split_button_get_child(self.to_glib_none().0)) }
52    }
53
54    #[doc(alias = "adw_split_button_get_direction")]
55    #[doc(alias = "get_direction")]
56    pub fn direction(&self) -> gtk::ArrowType {
57        unsafe { from_glib(ffi::adw_split_button_get_direction(self.to_glib_none().0)) }
58    }
59
60    #[cfg(feature = "v1_2")]
61    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
62    #[doc(alias = "adw_split_button_get_dropdown_tooltip")]
63    #[doc(alias = "get_dropdown_tooltip")]
64    #[doc(alias = "dropdown-tooltip")]
65    pub fn dropdown_tooltip(&self) -> glib::GString {
66        unsafe {
67            from_glib_none(ffi::adw_split_button_get_dropdown_tooltip(
68                self.to_glib_none().0,
69            ))
70        }
71    }
72
73    #[doc(alias = "adw_split_button_get_icon_name")]
74    #[doc(alias = "get_icon_name")]
75    #[doc(alias = "icon-name")]
76    pub fn icon_name(&self) -> Option<glib::GString> {
77        unsafe { from_glib_none(ffi::adw_split_button_get_icon_name(self.to_glib_none().0)) }
78    }
79
80    #[doc(alias = "adw_split_button_get_label")]
81    #[doc(alias = "get_label")]
82    pub fn label(&self) -> Option<glib::GString> {
83        unsafe { from_glib_none(ffi::adw_split_button_get_label(self.to_glib_none().0)) }
84    }
85
86    #[doc(alias = "adw_split_button_get_menu_model")]
87    #[doc(alias = "get_menu_model")]
88    #[doc(alias = "menu-model")]
89    pub fn menu_model(&self) -> Option<gio::MenuModel> {
90        unsafe { from_glib_none(ffi::adw_split_button_get_menu_model(self.to_glib_none().0)) }
91    }
92
93    #[doc(alias = "adw_split_button_get_popover")]
94    #[doc(alias = "get_popover")]
95    pub fn popover(&self) -> Option<gtk::Popover> {
96        unsafe { from_glib_none(ffi::adw_split_button_get_popover(self.to_glib_none().0)) }
97    }
98
99    #[doc(alias = "adw_split_button_get_use_underline")]
100    #[doc(alias = "get_use_underline")]
101    #[doc(alias = "use-underline")]
102    pub fn uses_underline(&self) -> bool {
103        unsafe {
104            from_glib(ffi::adw_split_button_get_use_underline(
105                self.to_glib_none().0,
106            ))
107        }
108    }
109
110    #[doc(alias = "adw_split_button_popdown")]
111    pub fn popdown(&self) {
112        unsafe {
113            ffi::adw_split_button_popdown(self.to_glib_none().0);
114        }
115    }
116
117    #[doc(alias = "adw_split_button_popup")]
118    pub fn popup(&self) {
119        unsafe {
120            ffi::adw_split_button_popup(self.to_glib_none().0);
121        }
122    }
123
124    #[cfg(feature = "v1_4")]
125    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
126    #[doc(alias = "adw_split_button_set_can_shrink")]
127    #[doc(alias = "can-shrink")]
128    pub fn set_can_shrink(&self, can_shrink: bool) {
129        unsafe {
130            ffi::adw_split_button_set_can_shrink(self.to_glib_none().0, can_shrink.into_glib());
131        }
132    }
133
134    #[doc(alias = "adw_split_button_set_child")]
135    #[doc(alias = "child")]
136    pub fn set_child(&self, child: Option<&impl IsA<gtk::Widget>>) {
137        unsafe {
138            ffi::adw_split_button_set_child(
139                self.to_glib_none().0,
140                child.map(|p| p.as_ref()).to_glib_none().0,
141            );
142        }
143    }
144
145    #[doc(alias = "adw_split_button_set_direction")]
146    #[doc(alias = "direction")]
147    pub fn set_direction(&self, direction: gtk::ArrowType) {
148        unsafe {
149            ffi::adw_split_button_set_direction(self.to_glib_none().0, direction.into_glib());
150        }
151    }
152
153    #[cfg(feature = "v1_2")]
154    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
155    #[doc(alias = "adw_split_button_set_dropdown_tooltip")]
156    #[doc(alias = "dropdown-tooltip")]
157    pub fn set_dropdown_tooltip(&self, tooltip: &str) {
158        unsafe {
159            ffi::adw_split_button_set_dropdown_tooltip(
160                self.to_glib_none().0,
161                tooltip.to_glib_none().0,
162            );
163        }
164    }
165
166    #[doc(alias = "adw_split_button_set_icon_name")]
167    #[doc(alias = "icon-name")]
168    pub fn set_icon_name(&self, icon_name: &str) {
169        unsafe {
170            ffi::adw_split_button_set_icon_name(self.to_glib_none().0, icon_name.to_glib_none().0);
171        }
172    }
173
174    #[doc(alias = "adw_split_button_set_label")]
175    #[doc(alias = "label")]
176    pub fn set_label(&self, label: &str) {
177        unsafe {
178            ffi::adw_split_button_set_label(self.to_glib_none().0, label.to_glib_none().0);
179        }
180    }
181
182    #[doc(alias = "adw_split_button_set_menu_model")]
183    #[doc(alias = "menu-model")]
184    pub fn set_menu_model(&self, menu_model: Option<&impl IsA<gio::MenuModel>>) {
185        unsafe {
186            ffi::adw_split_button_set_menu_model(
187                self.to_glib_none().0,
188                menu_model.map(|p| p.as_ref()).to_glib_none().0,
189            );
190        }
191    }
192
193    #[doc(alias = "adw_split_button_set_popover")]
194    #[doc(alias = "popover")]
195    pub fn set_popover(&self, popover: Option<&impl IsA<gtk::Popover>>) {
196        unsafe {
197            ffi::adw_split_button_set_popover(
198                self.to_glib_none().0,
199                popover.map(|p| p.as_ref()).to_glib_none().0,
200            );
201        }
202    }
203
204    #[doc(alias = "adw_split_button_set_use_underline")]
205    #[doc(alias = "use-underline")]
206    pub fn set_use_underline(&self, use_underline: bool) {
207        unsafe {
208            ffi::adw_split_button_set_use_underline(
209                self.to_glib_none().0,
210                use_underline.into_glib(),
211            );
212        }
213    }
214
215    #[doc(alias = "activate")]
216    pub fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
217        unsafe extern "C" fn activate_trampoline<F: Fn(&SplitButton) + 'static>(
218            this: *mut ffi::AdwSplitButton,
219            f: glib::ffi::gpointer,
220        ) {
221            let f: &F = &*(f as *const F);
222            f(&from_glib_borrow(this))
223        }
224        unsafe {
225            let f: Box_<F> = Box_::new(f);
226            connect_raw(
227                self.as_ptr() as *mut _,
228                c"activate".as_ptr() as *const _,
229                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
230                    activate_trampoline::<F> as *const (),
231                )),
232                Box_::into_raw(f),
233            )
234        }
235    }
236
237    pub fn emit_activate(&self) {
238        self.emit_by_name::<()>("activate", &[]);
239    }
240
241    #[doc(alias = "clicked")]
242    pub fn connect_clicked<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
243        unsafe extern "C" fn clicked_trampoline<F: Fn(&SplitButton) + 'static>(
244            this: *mut ffi::AdwSplitButton,
245            f: glib::ffi::gpointer,
246        ) {
247            let f: &F = &*(f as *const F);
248            f(&from_glib_borrow(this))
249        }
250        unsafe {
251            let f: Box_<F> = Box_::new(f);
252            connect_raw(
253                self.as_ptr() as *mut _,
254                c"clicked".as_ptr() as *const _,
255                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
256                    clicked_trampoline::<F> as *const (),
257                )),
258                Box_::into_raw(f),
259            )
260        }
261    }
262
263    pub fn emit_clicked(&self) {
264        self.emit_by_name::<()>("clicked", &[]);
265    }
266
267    #[cfg(feature = "v1_4")]
268    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
269    #[doc(alias = "can-shrink")]
270    pub fn connect_can_shrink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
271        unsafe extern "C" fn notify_can_shrink_trampoline<F: Fn(&SplitButton) + 'static>(
272            this: *mut ffi::AdwSplitButton,
273            _param_spec: glib::ffi::gpointer,
274            f: glib::ffi::gpointer,
275        ) {
276            let f: &F = &*(f as *const F);
277            f(&from_glib_borrow(this))
278        }
279        unsafe {
280            let f: Box_<F> = Box_::new(f);
281            connect_raw(
282                self.as_ptr() as *mut _,
283                c"notify::can-shrink".as_ptr() as *const _,
284                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
285                    notify_can_shrink_trampoline::<F> as *const (),
286                )),
287                Box_::into_raw(f),
288            )
289        }
290    }
291
292    #[doc(alias = "child")]
293    pub fn connect_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
294        unsafe extern "C" fn notify_child_trampoline<F: Fn(&SplitButton) + 'static>(
295            this: *mut ffi::AdwSplitButton,
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::child".as_ptr() as *const _,
307                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
308                    notify_child_trampoline::<F> as *const (),
309                )),
310                Box_::into_raw(f),
311            )
312        }
313    }
314
315    #[doc(alias = "direction")]
316    pub fn connect_direction_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
317        unsafe extern "C" fn notify_direction_trampoline<F: Fn(&SplitButton) + 'static>(
318            this: *mut ffi::AdwSplitButton,
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::direction".as_ptr() as *const _,
330                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
331                    notify_direction_trampoline::<F> as *const (),
332                )),
333                Box_::into_raw(f),
334            )
335        }
336    }
337
338    #[cfg(feature = "v1_2")]
339    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
340    #[doc(alias = "dropdown-tooltip")]
341    pub fn connect_dropdown_tooltip_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
342        unsafe extern "C" fn notify_dropdown_tooltip_trampoline<F: Fn(&SplitButton) + 'static>(
343            this: *mut ffi::AdwSplitButton,
344            _param_spec: glib::ffi::gpointer,
345            f: glib::ffi::gpointer,
346        ) {
347            let f: &F = &*(f as *const F);
348            f(&from_glib_borrow(this))
349        }
350        unsafe {
351            let f: Box_<F> = Box_::new(f);
352            connect_raw(
353                self.as_ptr() as *mut _,
354                c"notify::dropdown-tooltip".as_ptr() as *const _,
355                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
356                    notify_dropdown_tooltip_trampoline::<F> as *const (),
357                )),
358                Box_::into_raw(f),
359            )
360        }
361    }
362
363    #[doc(alias = "icon-name")]
364    pub fn connect_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
365        unsafe extern "C" fn notify_icon_name_trampoline<F: Fn(&SplitButton) + 'static>(
366            this: *mut ffi::AdwSplitButton,
367            _param_spec: glib::ffi::gpointer,
368            f: glib::ffi::gpointer,
369        ) {
370            let f: &F = &*(f as *const F);
371            f(&from_glib_borrow(this))
372        }
373        unsafe {
374            let f: Box_<F> = Box_::new(f);
375            connect_raw(
376                self.as_ptr() as *mut _,
377                c"notify::icon-name".as_ptr() as *const _,
378                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
379                    notify_icon_name_trampoline::<F> as *const (),
380                )),
381                Box_::into_raw(f),
382            )
383        }
384    }
385
386    #[doc(alias = "label")]
387    pub fn connect_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
388        unsafe extern "C" fn notify_label_trampoline<F: Fn(&SplitButton) + 'static>(
389            this: *mut ffi::AdwSplitButton,
390            _param_spec: glib::ffi::gpointer,
391            f: glib::ffi::gpointer,
392        ) {
393            let f: &F = &*(f as *const F);
394            f(&from_glib_borrow(this))
395        }
396        unsafe {
397            let f: Box_<F> = Box_::new(f);
398            connect_raw(
399                self.as_ptr() as *mut _,
400                c"notify::label".as_ptr() as *const _,
401                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
402                    notify_label_trampoline::<F> as *const (),
403                )),
404                Box_::into_raw(f),
405            )
406        }
407    }
408
409    #[doc(alias = "menu-model")]
410    pub fn connect_menu_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
411        unsafe extern "C" fn notify_menu_model_trampoline<F: Fn(&SplitButton) + 'static>(
412            this: *mut ffi::AdwSplitButton,
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::menu-model".as_ptr() as *const _,
424                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
425                    notify_menu_model_trampoline::<F> as *const (),
426                )),
427                Box_::into_raw(f),
428            )
429        }
430    }
431
432    #[doc(alias = "popover")]
433    pub fn connect_popover_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
434        unsafe extern "C" fn notify_popover_trampoline<F: Fn(&SplitButton) + 'static>(
435            this: *mut ffi::AdwSplitButton,
436            _param_spec: glib::ffi::gpointer,
437            f: glib::ffi::gpointer,
438        ) {
439            let f: &F = &*(f as *const F);
440            f(&from_glib_borrow(this))
441        }
442        unsafe {
443            let f: Box_<F> = Box_::new(f);
444            connect_raw(
445                self.as_ptr() as *mut _,
446                c"notify::popover".as_ptr() as *const _,
447                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
448                    notify_popover_trampoline::<F> as *const (),
449                )),
450                Box_::into_raw(f),
451            )
452        }
453    }
454
455    #[doc(alias = "use-underline")]
456    pub fn connect_use_underline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
457        unsafe extern "C" fn notify_use_underline_trampoline<F: Fn(&SplitButton) + 'static>(
458            this: *mut ffi::AdwSplitButton,
459            _param_spec: glib::ffi::gpointer,
460            f: glib::ffi::gpointer,
461        ) {
462            let f: &F = &*(f as *const F);
463            f(&from_glib_borrow(this))
464        }
465        unsafe {
466            let f: Box_<F> = Box_::new(f);
467            connect_raw(
468                self.as_ptr() as *mut _,
469                c"notify::use-underline".as_ptr() as *const _,
470                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
471                    notify_use_underline_trampoline::<F> as *const (),
472                )),
473                Box_::into_raw(f),
474            )
475        }
476    }
477}
478
479impl Default for SplitButton {
480    fn default() -> Self {
481        Self::new()
482    }
483}
484
485// rustdoc-stripper-ignore-next
486/// A [builder-pattern] type to construct [`SplitButton`] objects.
487///
488/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
489#[must_use = "The builder must be built to be used"]
490pub struct SplitButtonBuilder {
491    builder: glib::object::ObjectBuilder<'static, SplitButton>,
492}
493
494impl SplitButtonBuilder {
495    fn new() -> Self {
496        Self {
497            builder: glib::object::Object::builder(),
498        }
499    }
500
501    #[cfg(feature = "v1_4")]
502    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
503    pub fn can_shrink(self, can_shrink: bool) -> Self {
504        Self {
505            builder: self.builder.property("can-shrink", can_shrink),
506        }
507    }
508
509    pub fn child(self, child: &impl IsA<gtk::Widget>) -> Self {
510        Self {
511            builder: self.builder.property("child", child.clone().upcast()),
512        }
513    }
514
515    pub fn direction(self, direction: gtk::ArrowType) -> Self {
516        Self {
517            builder: self.builder.property("direction", direction),
518        }
519    }
520
521    #[cfg(feature = "v1_2")]
522    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
523    pub fn dropdown_tooltip(self, dropdown_tooltip: impl Into<glib::GString>) -> Self {
524        Self {
525            builder: self
526                .builder
527                .property("dropdown-tooltip", dropdown_tooltip.into()),
528        }
529    }
530
531    pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
532        Self {
533            builder: self.builder.property("icon-name", icon_name.into()),
534        }
535    }
536
537    pub fn label(self, label: impl Into<glib::GString>) -> Self {
538        Self {
539            builder: self.builder.property("label", label.into()),
540        }
541    }
542
543    pub fn menu_model(self, menu_model: &impl IsA<gio::MenuModel>) -> Self {
544        Self {
545            builder: self
546                .builder
547                .property("menu-model", menu_model.clone().upcast()),
548        }
549    }
550
551    pub fn popover(self, popover: &impl IsA<gtk::Popover>) -> Self {
552        Self {
553            builder: self.builder.property("popover", popover.clone().upcast()),
554        }
555    }
556
557    pub fn use_underline(self, use_underline: bool) -> Self {
558        Self {
559            builder: self.builder.property("use-underline", use_underline),
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    pub fn action_name(self, action_name: impl Into<glib::GString>) -> Self {
756        Self {
757            builder: self.builder.property("action-name", action_name.into()),
758        }
759    }
760
761    pub fn action_target(self, action_target: &glib::Variant) -> Self {
762        Self {
763            builder: self
764                .builder
765                .property("action-target", action_target.clone()),
766        }
767    }
768
769    // rustdoc-stripper-ignore-next
770    /// Build the [`SplitButton`].
771    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
772    pub fn build(self) -> SplitButton {
773        assert_initialized_main_thread!();
774        self.builder.build()
775    }
776}