libadwaita/auto/
squeezer.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#![allow(deprecated)]
6
7use crate::{ffi, FoldThresholdPolicy, SqueezerPage, SqueezerTransitionType};
8use glib::{
9    prelude::*,
10    signal::{connect_raw, SignalHandlerId},
11    translate::*,
12};
13use std::boxed::Box as Box_;
14
15glib::wrapper! {
16    #[doc(alias = "AdwSqueezer")]
17    pub struct Squeezer(Object<ffi::AdwSqueezer, ffi::AdwSqueezerClass>) @extends gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable;
18
19    match fn {
20        type_ => || ffi::adw_squeezer_get_type(),
21    }
22}
23
24impl Squeezer {
25    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
26    #[allow(deprecated)]
27    #[doc(alias = "adw_squeezer_new")]
28    pub fn new() -> Squeezer {
29        assert_initialized_main_thread!();
30        unsafe { gtk::Widget::from_glib_none(ffi::adw_squeezer_new()).unsafe_cast() }
31    }
32
33    // rustdoc-stripper-ignore-next
34    /// Creates a new builder-pattern struct instance to construct [`Squeezer`] objects.
35    ///
36    /// This method returns an instance of [`SqueezerBuilder`](crate::builders::SqueezerBuilder) which can be used to create [`Squeezer`] objects.
37    pub fn builder() -> SqueezerBuilder {
38        SqueezerBuilder::new()
39    }
40
41    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
42    #[allow(deprecated)]
43    #[doc(alias = "adw_squeezer_add")]
44    pub fn add(&self, child: &impl IsA<gtk::Widget>) -> SqueezerPage {
45        unsafe {
46            from_glib_none(ffi::adw_squeezer_add(
47                self.to_glib_none().0,
48                child.as_ref().to_glib_none().0,
49            ))
50        }
51    }
52
53    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
54    #[allow(deprecated)]
55    #[doc(alias = "adw_squeezer_get_allow_none")]
56    #[doc(alias = "get_allow_none")]
57    #[doc(alias = "allow-none")]
58    pub fn allows_none(&self) -> bool {
59        unsafe { from_glib(ffi::adw_squeezer_get_allow_none(self.to_glib_none().0)) }
60    }
61
62    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
63    #[allow(deprecated)]
64    #[doc(alias = "adw_squeezer_get_homogeneous")]
65    #[doc(alias = "get_homogeneous")]
66    #[doc(alias = "homogeneous")]
67    pub fn is_homogeneous(&self) -> bool {
68        unsafe { from_glib(ffi::adw_squeezer_get_homogeneous(self.to_glib_none().0)) }
69    }
70
71    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
72    #[allow(deprecated)]
73    #[doc(alias = "adw_squeezer_get_interpolate_size")]
74    #[doc(alias = "get_interpolate_size")]
75    #[doc(alias = "interpolate-size")]
76    pub fn is_interpolate_size(&self) -> bool {
77        unsafe {
78            from_glib(ffi::adw_squeezer_get_interpolate_size(
79                self.to_glib_none().0,
80            ))
81        }
82    }
83
84    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
85    #[allow(deprecated)]
86    #[doc(alias = "adw_squeezer_get_page")]
87    #[doc(alias = "get_page")]
88    pub fn page(&self, child: &impl IsA<gtk::Widget>) -> SqueezerPage {
89        unsafe {
90            from_glib_none(ffi::adw_squeezer_get_page(
91                self.to_glib_none().0,
92                child.as_ref().to_glib_none().0,
93            ))
94        }
95    }
96
97    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
98    #[allow(deprecated)]
99    #[doc(alias = "adw_squeezer_get_pages")]
100    #[doc(alias = "get_pages")]
101    pub fn pages(&self) -> gtk::SelectionModel {
102        unsafe { from_glib_full(ffi::adw_squeezer_get_pages(self.to_glib_none().0)) }
103    }
104
105    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
106    #[allow(deprecated)]
107    #[doc(alias = "adw_squeezer_get_switch_threshold_policy")]
108    #[doc(alias = "get_switch_threshold_policy")]
109    #[doc(alias = "switch-threshold-policy")]
110    pub fn switch_threshold_policy(&self) -> FoldThresholdPolicy {
111        unsafe {
112            from_glib(ffi::adw_squeezer_get_switch_threshold_policy(
113                self.to_glib_none().0,
114            ))
115        }
116    }
117
118    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
119    #[allow(deprecated)]
120    #[doc(alias = "adw_squeezer_get_transition_duration")]
121    #[doc(alias = "get_transition_duration")]
122    #[doc(alias = "transition-duration")]
123    pub fn transition_duration(&self) -> u32 {
124        unsafe { ffi::adw_squeezer_get_transition_duration(self.to_glib_none().0) }
125    }
126
127    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
128    #[allow(deprecated)]
129    #[doc(alias = "adw_squeezer_get_transition_running")]
130    #[doc(alias = "get_transition_running")]
131    #[doc(alias = "transition-running")]
132    pub fn is_transition_running(&self) -> bool {
133        unsafe {
134            from_glib(ffi::adw_squeezer_get_transition_running(
135                self.to_glib_none().0,
136            ))
137        }
138    }
139
140    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
141    #[allow(deprecated)]
142    #[doc(alias = "adw_squeezer_get_transition_type")]
143    #[doc(alias = "get_transition_type")]
144    #[doc(alias = "transition-type")]
145    pub fn transition_type(&self) -> SqueezerTransitionType {
146        unsafe { from_glib(ffi::adw_squeezer_get_transition_type(self.to_glib_none().0)) }
147    }
148
149    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
150    #[allow(deprecated)]
151    #[doc(alias = "adw_squeezer_get_visible_child")]
152    #[doc(alias = "get_visible_child")]
153    #[doc(alias = "visible-child")]
154    pub fn visible_child(&self) -> Option<gtk::Widget> {
155        unsafe { from_glib_none(ffi::adw_squeezer_get_visible_child(self.to_glib_none().0)) }
156    }
157
158    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
159    #[allow(deprecated)]
160    #[doc(alias = "adw_squeezer_get_xalign")]
161    #[doc(alias = "get_xalign")]
162    pub fn xalign(&self) -> f32 {
163        unsafe { ffi::adw_squeezer_get_xalign(self.to_glib_none().0) }
164    }
165
166    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
167    #[allow(deprecated)]
168    #[doc(alias = "adw_squeezer_get_yalign")]
169    #[doc(alias = "get_yalign")]
170    pub fn yalign(&self) -> f32 {
171        unsafe { ffi::adw_squeezer_get_yalign(self.to_glib_none().0) }
172    }
173
174    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
175    #[allow(deprecated)]
176    #[doc(alias = "adw_squeezer_remove")]
177    pub fn remove(&self, child: &impl IsA<gtk::Widget>) {
178        unsafe {
179            ffi::adw_squeezer_remove(self.to_glib_none().0, child.as_ref().to_glib_none().0);
180        }
181    }
182
183    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
184    #[allow(deprecated)]
185    #[doc(alias = "adw_squeezer_set_allow_none")]
186    #[doc(alias = "allow-none")]
187    pub fn set_allow_none(&self, allow_none: bool) {
188        unsafe {
189            ffi::adw_squeezer_set_allow_none(self.to_glib_none().0, allow_none.into_glib());
190        }
191    }
192
193    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
194    #[allow(deprecated)]
195    #[doc(alias = "adw_squeezer_set_homogeneous")]
196    #[doc(alias = "homogeneous")]
197    pub fn set_homogeneous(&self, homogeneous: bool) {
198        unsafe {
199            ffi::adw_squeezer_set_homogeneous(self.to_glib_none().0, homogeneous.into_glib());
200        }
201    }
202
203    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
204    #[allow(deprecated)]
205    #[doc(alias = "adw_squeezer_set_interpolate_size")]
206    #[doc(alias = "interpolate-size")]
207    pub fn set_interpolate_size(&self, interpolate_size: bool) {
208        unsafe {
209            ffi::adw_squeezer_set_interpolate_size(
210                self.to_glib_none().0,
211                interpolate_size.into_glib(),
212            );
213        }
214    }
215
216    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
217    #[allow(deprecated)]
218    #[doc(alias = "adw_squeezer_set_switch_threshold_policy")]
219    #[doc(alias = "switch-threshold-policy")]
220    pub fn set_switch_threshold_policy(&self, policy: FoldThresholdPolicy) {
221        unsafe {
222            ffi::adw_squeezer_set_switch_threshold_policy(
223                self.to_glib_none().0,
224                policy.into_glib(),
225            );
226        }
227    }
228
229    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
230    #[allow(deprecated)]
231    #[doc(alias = "adw_squeezer_set_transition_duration")]
232    #[doc(alias = "transition-duration")]
233    pub fn set_transition_duration(&self, duration: u32) {
234        unsafe {
235            ffi::adw_squeezer_set_transition_duration(self.to_glib_none().0, duration);
236        }
237    }
238
239    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
240    #[allow(deprecated)]
241    #[doc(alias = "adw_squeezer_set_transition_type")]
242    #[doc(alias = "transition-type")]
243    pub fn set_transition_type(&self, transition: SqueezerTransitionType) {
244        unsafe {
245            ffi::adw_squeezer_set_transition_type(self.to_glib_none().0, transition.into_glib());
246        }
247    }
248
249    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
250    #[allow(deprecated)]
251    #[doc(alias = "adw_squeezer_set_xalign")]
252    #[doc(alias = "xalign")]
253    pub fn set_xalign(&self, xalign: f32) {
254        unsafe {
255            ffi::adw_squeezer_set_xalign(self.to_glib_none().0, xalign);
256        }
257    }
258
259    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
260    #[allow(deprecated)]
261    #[doc(alias = "adw_squeezer_set_yalign")]
262    #[doc(alias = "yalign")]
263    pub fn set_yalign(&self, yalign: f32) {
264        unsafe {
265            ffi::adw_squeezer_set_yalign(self.to_glib_none().0, yalign);
266        }
267    }
268
269    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
270    #[doc(alias = "allow-none")]
271    pub fn connect_allow_none_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
272        unsafe extern "C" fn notify_allow_none_trampoline<F: Fn(&Squeezer) + 'static>(
273            this: *mut ffi::AdwSqueezer,
274            _param_spec: glib::ffi::gpointer,
275            f: glib::ffi::gpointer,
276        ) {
277            let f: &F = &*(f as *const F);
278            f(&from_glib_borrow(this))
279        }
280        unsafe {
281            let f: Box_<F> = Box_::new(f);
282            connect_raw(
283                self.as_ptr() as *mut _,
284                c"notify::allow-none".as_ptr() as *const _,
285                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
286                    notify_allow_none_trampoline::<F> as *const (),
287                )),
288                Box_::into_raw(f),
289            )
290        }
291    }
292
293    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
294    #[doc(alias = "homogeneous")]
295    pub fn connect_homogeneous_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
296        unsafe extern "C" fn notify_homogeneous_trampoline<F: Fn(&Squeezer) + 'static>(
297            this: *mut ffi::AdwSqueezer,
298            _param_spec: glib::ffi::gpointer,
299            f: glib::ffi::gpointer,
300        ) {
301            let f: &F = &*(f as *const F);
302            f(&from_glib_borrow(this))
303        }
304        unsafe {
305            let f: Box_<F> = Box_::new(f);
306            connect_raw(
307                self.as_ptr() as *mut _,
308                c"notify::homogeneous".as_ptr() as *const _,
309                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
310                    notify_homogeneous_trampoline::<F> as *const (),
311                )),
312                Box_::into_raw(f),
313            )
314        }
315    }
316
317    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
318    #[doc(alias = "interpolate-size")]
319    pub fn connect_interpolate_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
320        unsafe extern "C" fn notify_interpolate_size_trampoline<F: Fn(&Squeezer) + 'static>(
321            this: *mut ffi::AdwSqueezer,
322            _param_spec: glib::ffi::gpointer,
323            f: glib::ffi::gpointer,
324        ) {
325            let f: &F = &*(f as *const F);
326            f(&from_glib_borrow(this))
327        }
328        unsafe {
329            let f: Box_<F> = Box_::new(f);
330            connect_raw(
331                self.as_ptr() as *mut _,
332                c"notify::interpolate-size".as_ptr() as *const _,
333                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
334                    notify_interpolate_size_trampoline::<F> as *const (),
335                )),
336                Box_::into_raw(f),
337            )
338        }
339    }
340
341    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
342    #[doc(alias = "pages")]
343    pub fn connect_pages_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
344        unsafe extern "C" fn notify_pages_trampoline<F: Fn(&Squeezer) + 'static>(
345            this: *mut ffi::AdwSqueezer,
346            _param_spec: glib::ffi::gpointer,
347            f: glib::ffi::gpointer,
348        ) {
349            let f: &F = &*(f as *const F);
350            f(&from_glib_borrow(this))
351        }
352        unsafe {
353            let f: Box_<F> = Box_::new(f);
354            connect_raw(
355                self.as_ptr() as *mut _,
356                c"notify::pages".as_ptr() as *const _,
357                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
358                    notify_pages_trampoline::<F> as *const (),
359                )),
360                Box_::into_raw(f),
361            )
362        }
363    }
364
365    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
366    #[doc(alias = "switch-threshold-policy")]
367    pub fn connect_switch_threshold_policy_notify<F: Fn(&Self) + 'static>(
368        &self,
369        f: F,
370    ) -> SignalHandlerId {
371        unsafe extern "C" fn notify_switch_threshold_policy_trampoline<
372            F: Fn(&Squeezer) + 'static,
373        >(
374            this: *mut ffi::AdwSqueezer,
375            _param_spec: glib::ffi::gpointer,
376            f: glib::ffi::gpointer,
377        ) {
378            let f: &F = &*(f as *const F);
379            f(&from_glib_borrow(this))
380        }
381        unsafe {
382            let f: Box_<F> = Box_::new(f);
383            connect_raw(
384                self.as_ptr() as *mut _,
385                c"notify::switch-threshold-policy".as_ptr() as *const _,
386                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
387                    notify_switch_threshold_policy_trampoline::<F> as *const (),
388                )),
389                Box_::into_raw(f),
390            )
391        }
392    }
393
394    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
395    #[doc(alias = "transition-duration")]
396    pub fn connect_transition_duration_notify<F: Fn(&Self) + 'static>(
397        &self,
398        f: F,
399    ) -> SignalHandlerId {
400        unsafe extern "C" fn notify_transition_duration_trampoline<F: Fn(&Squeezer) + 'static>(
401            this: *mut ffi::AdwSqueezer,
402            _param_spec: glib::ffi::gpointer,
403            f: glib::ffi::gpointer,
404        ) {
405            let f: &F = &*(f as *const F);
406            f(&from_glib_borrow(this))
407        }
408        unsafe {
409            let f: Box_<F> = Box_::new(f);
410            connect_raw(
411                self.as_ptr() as *mut _,
412                c"notify::transition-duration".as_ptr() as *const _,
413                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
414                    notify_transition_duration_trampoline::<F> as *const (),
415                )),
416                Box_::into_raw(f),
417            )
418        }
419    }
420
421    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
422    #[doc(alias = "transition-running")]
423    pub fn connect_transition_running_notify<F: Fn(&Self) + 'static>(
424        &self,
425        f: F,
426    ) -> SignalHandlerId {
427        unsafe extern "C" fn notify_transition_running_trampoline<F: Fn(&Squeezer) + 'static>(
428            this: *mut ffi::AdwSqueezer,
429            _param_spec: glib::ffi::gpointer,
430            f: glib::ffi::gpointer,
431        ) {
432            let f: &F = &*(f as *const F);
433            f(&from_glib_borrow(this))
434        }
435        unsafe {
436            let f: Box_<F> = Box_::new(f);
437            connect_raw(
438                self.as_ptr() as *mut _,
439                c"notify::transition-running".as_ptr() as *const _,
440                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
441                    notify_transition_running_trampoline::<F> as *const (),
442                )),
443                Box_::into_raw(f),
444            )
445        }
446    }
447
448    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
449    #[doc(alias = "transition-type")]
450    pub fn connect_transition_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
451        unsafe extern "C" fn notify_transition_type_trampoline<F: Fn(&Squeezer) + 'static>(
452            this: *mut ffi::AdwSqueezer,
453            _param_spec: glib::ffi::gpointer,
454            f: glib::ffi::gpointer,
455        ) {
456            let f: &F = &*(f as *const F);
457            f(&from_glib_borrow(this))
458        }
459        unsafe {
460            let f: Box_<F> = Box_::new(f);
461            connect_raw(
462                self.as_ptr() as *mut _,
463                c"notify::transition-type".as_ptr() as *const _,
464                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
465                    notify_transition_type_trampoline::<F> as *const (),
466                )),
467                Box_::into_raw(f),
468            )
469        }
470    }
471
472    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
473    #[doc(alias = "visible-child")]
474    pub fn connect_visible_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
475        unsafe extern "C" fn notify_visible_child_trampoline<F: Fn(&Squeezer) + 'static>(
476            this: *mut ffi::AdwSqueezer,
477            _param_spec: glib::ffi::gpointer,
478            f: glib::ffi::gpointer,
479        ) {
480            let f: &F = &*(f as *const F);
481            f(&from_glib_borrow(this))
482        }
483        unsafe {
484            let f: Box_<F> = Box_::new(f);
485            connect_raw(
486                self.as_ptr() as *mut _,
487                c"notify::visible-child".as_ptr() as *const _,
488                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
489                    notify_visible_child_trampoline::<F> as *const (),
490                )),
491                Box_::into_raw(f),
492            )
493        }
494    }
495
496    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
497    #[doc(alias = "xalign")]
498    pub fn connect_xalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
499        unsafe extern "C" fn notify_xalign_trampoline<F: Fn(&Squeezer) + 'static>(
500            this: *mut ffi::AdwSqueezer,
501            _param_spec: glib::ffi::gpointer,
502            f: glib::ffi::gpointer,
503        ) {
504            let f: &F = &*(f as *const F);
505            f(&from_glib_borrow(this))
506        }
507        unsafe {
508            let f: Box_<F> = Box_::new(f);
509            connect_raw(
510                self.as_ptr() as *mut _,
511                c"notify::xalign".as_ptr() as *const _,
512                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
513                    notify_xalign_trampoline::<F> as *const (),
514                )),
515                Box_::into_raw(f),
516            )
517        }
518    }
519
520    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
521    #[doc(alias = "yalign")]
522    pub fn connect_yalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
523        unsafe extern "C" fn notify_yalign_trampoline<F: Fn(&Squeezer) + 'static>(
524            this: *mut ffi::AdwSqueezer,
525            _param_spec: glib::ffi::gpointer,
526            f: glib::ffi::gpointer,
527        ) {
528            let f: &F = &*(f as *const F);
529            f(&from_glib_borrow(this))
530        }
531        unsafe {
532            let f: Box_<F> = Box_::new(f);
533            connect_raw(
534                self.as_ptr() as *mut _,
535                c"notify::yalign".as_ptr() as *const _,
536                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
537                    notify_yalign_trampoline::<F> as *const (),
538                )),
539                Box_::into_raw(f),
540            )
541        }
542    }
543}
544
545impl Default for Squeezer {
546    fn default() -> Self {
547        Self::new()
548    }
549}
550
551// rustdoc-stripper-ignore-next
552/// A [builder-pattern] type to construct [`Squeezer`] objects.
553///
554/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
555#[must_use = "The builder must be built to be used"]
556pub struct SqueezerBuilder {
557    builder: glib::object::ObjectBuilder<'static, Squeezer>,
558}
559
560impl SqueezerBuilder {
561    fn new() -> Self {
562        Self {
563            builder: glib::object::Object::builder(),
564        }
565    }
566
567    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
568    pub fn allow_none(self, allow_none: bool) -> Self {
569        Self {
570            builder: self.builder.property("allow-none", allow_none),
571        }
572    }
573
574    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
575    pub fn homogeneous(self, homogeneous: bool) -> Self {
576        Self {
577            builder: self.builder.property("homogeneous", homogeneous),
578        }
579    }
580
581    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
582    pub fn interpolate_size(self, interpolate_size: bool) -> Self {
583        Self {
584            builder: self.builder.property("interpolate-size", interpolate_size),
585        }
586    }
587
588    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
589    pub fn switch_threshold_policy(self, switch_threshold_policy: FoldThresholdPolicy) -> Self {
590        Self {
591            builder: self
592                .builder
593                .property("switch-threshold-policy", switch_threshold_policy),
594        }
595    }
596
597    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
598    pub fn transition_duration(self, transition_duration: u32) -> Self {
599        Self {
600            builder: self
601                .builder
602                .property("transition-duration", transition_duration),
603        }
604    }
605
606    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
607    pub fn transition_type(self, transition_type: SqueezerTransitionType) -> Self {
608        Self {
609            builder: self.builder.property("transition-type", transition_type),
610        }
611    }
612
613    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
614    pub fn xalign(self, xalign: f32) -> Self {
615        Self {
616            builder: self.builder.property("xalign", xalign),
617        }
618    }
619
620    #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
621    pub fn yalign(self, yalign: f32) -> Self {
622        Self {
623            builder: self.builder.property("yalign", yalign),
624        }
625    }
626
627    pub fn can_focus(self, can_focus: bool) -> Self {
628        Self {
629            builder: self.builder.property("can-focus", can_focus),
630        }
631    }
632
633    pub fn can_target(self, can_target: bool) -> Self {
634        Self {
635            builder: self.builder.property("can-target", can_target),
636        }
637    }
638
639    pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
640        Self {
641            builder: self.builder.property("css-classes", css_classes.into()),
642        }
643    }
644
645    pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
646        Self {
647            builder: self.builder.property("css-name", css_name.into()),
648        }
649    }
650
651    pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
652        Self {
653            builder: self.builder.property("cursor", cursor.clone()),
654        }
655    }
656
657    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
658        Self {
659            builder: self.builder.property("focus-on-click", focus_on_click),
660        }
661    }
662
663    pub fn focusable(self, focusable: bool) -> Self {
664        Self {
665            builder: self.builder.property("focusable", focusable),
666        }
667    }
668
669    pub fn halign(self, halign: gtk::Align) -> Self {
670        Self {
671            builder: self.builder.property("halign", halign),
672        }
673    }
674
675    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
676        Self {
677            builder: self.builder.property("has-tooltip", has_tooltip),
678        }
679    }
680
681    pub fn height_request(self, height_request: i32) -> Self {
682        Self {
683            builder: self.builder.property("height-request", height_request),
684        }
685    }
686
687    pub fn hexpand(self, hexpand: bool) -> Self {
688        Self {
689            builder: self.builder.property("hexpand", hexpand),
690        }
691    }
692
693    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
694        Self {
695            builder: self.builder.property("hexpand-set", hexpand_set),
696        }
697    }
698
699    pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
700        Self {
701            builder: self
702                .builder
703                .property("layout-manager", layout_manager.clone().upcast()),
704        }
705    }
706
707    #[cfg(feature = "gtk_v4_18")]
708    #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
709    pub fn limit_events(self, limit_events: bool) -> Self {
710        Self {
711            builder: self.builder.property("limit-events", limit_events),
712        }
713    }
714
715    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
716        Self {
717            builder: self.builder.property("margin-bottom", margin_bottom),
718        }
719    }
720
721    pub fn margin_end(self, margin_end: i32) -> Self {
722        Self {
723            builder: self.builder.property("margin-end", margin_end),
724        }
725    }
726
727    pub fn margin_start(self, margin_start: i32) -> Self {
728        Self {
729            builder: self.builder.property("margin-start", margin_start),
730        }
731    }
732
733    pub fn margin_top(self, margin_top: i32) -> Self {
734        Self {
735            builder: self.builder.property("margin-top", margin_top),
736        }
737    }
738
739    pub fn name(self, name: impl Into<glib::GString>) -> Self {
740        Self {
741            builder: self.builder.property("name", name.into()),
742        }
743    }
744
745    pub fn opacity(self, opacity: f64) -> Self {
746        Self {
747            builder: self.builder.property("opacity", opacity),
748        }
749    }
750
751    pub fn overflow(self, overflow: gtk::Overflow) -> Self {
752        Self {
753            builder: self.builder.property("overflow", overflow),
754        }
755    }
756
757    pub fn receives_default(self, receives_default: bool) -> Self {
758        Self {
759            builder: self.builder.property("receives-default", receives_default),
760        }
761    }
762
763    pub fn sensitive(self, sensitive: bool) -> Self {
764        Self {
765            builder: self.builder.property("sensitive", sensitive),
766        }
767    }
768
769    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
770        Self {
771            builder: self
772                .builder
773                .property("tooltip-markup", tooltip_markup.into()),
774        }
775    }
776
777    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
778        Self {
779            builder: self.builder.property("tooltip-text", tooltip_text.into()),
780        }
781    }
782
783    pub fn valign(self, valign: gtk::Align) -> Self {
784        Self {
785            builder: self.builder.property("valign", valign),
786        }
787    }
788
789    pub fn vexpand(self, vexpand: bool) -> Self {
790        Self {
791            builder: self.builder.property("vexpand", vexpand),
792        }
793    }
794
795    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
796        Self {
797            builder: self.builder.property("vexpand-set", vexpand_set),
798        }
799    }
800
801    pub fn visible(self, visible: bool) -> Self {
802        Self {
803            builder: self.builder.property("visible", visible),
804        }
805    }
806
807    pub fn width_request(self, width_request: i32) -> Self {
808        Self {
809            builder: self.builder.property("width-request", width_request),
810        }
811    }
812
813    pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
814        Self {
815            builder: self.builder.property("accessible-role", accessible_role),
816        }
817    }
818
819    pub fn orientation(self, orientation: gtk::Orientation) -> Self {
820        Self {
821            builder: self.builder.property("orientation", orientation),
822        }
823    }
824
825    // rustdoc-stripper-ignore-next
826    /// Build the [`Squeezer`].
827    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
828    pub fn build(self) -> Squeezer {
829        assert_initialized_main_thread!();
830        self.builder.build()
831    }
832}