1use crate::{ffi, LengthUnit, Swipeable};
7use glib::{
8 prelude::*,
9 signal::{connect_raw, SignalHandlerId},
10 translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15 #[doc(alias = "AdwOverlaySplitView")]
16 pub struct OverlaySplitView(Object<ffi::AdwOverlaySplitView, ffi::AdwOverlaySplitViewClass>) @extends gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, Swipeable;
17
18 match fn {
19 type_ => || ffi::adw_overlay_split_view_get_type(),
20 }
21}
22
23impl OverlaySplitView {
24 #[doc(alias = "adw_overlay_split_view_new")]
25 pub fn new() -> OverlaySplitView {
26 assert_initialized_main_thread!();
27 unsafe { gtk::Widget::from_glib_none(ffi::adw_overlay_split_view_new()).unsafe_cast() }
28 }
29
30 pub fn builder() -> OverlaySplitViewBuilder {
35 OverlaySplitViewBuilder::new()
36 }
37
38 #[doc(alias = "adw_overlay_split_view_get_collapsed")]
39 #[doc(alias = "get_collapsed")]
40 #[doc(alias = "collapsed")]
41 pub fn is_collapsed(&self) -> bool {
42 unsafe {
43 from_glib(ffi::adw_overlay_split_view_get_collapsed(
44 self.to_glib_none().0,
45 ))
46 }
47 }
48
49 #[doc(alias = "adw_overlay_split_view_get_content")]
50 #[doc(alias = "get_content")]
51 pub fn content(&self) -> Option<gtk::Widget> {
52 unsafe {
53 from_glib_none(ffi::adw_overlay_split_view_get_content(
54 self.to_glib_none().0,
55 ))
56 }
57 }
58
59 #[doc(alias = "adw_overlay_split_view_get_enable_hide_gesture")]
60 #[doc(alias = "get_enable_hide_gesture")]
61 #[doc(alias = "enable-hide-gesture")]
62 pub fn enables_hide_gesture(&self) -> bool {
63 unsafe {
64 from_glib(ffi::adw_overlay_split_view_get_enable_hide_gesture(
65 self.to_glib_none().0,
66 ))
67 }
68 }
69
70 #[doc(alias = "adw_overlay_split_view_get_enable_show_gesture")]
71 #[doc(alias = "get_enable_show_gesture")]
72 #[doc(alias = "enable-show-gesture")]
73 pub fn enables_show_gesture(&self) -> bool {
74 unsafe {
75 from_glib(ffi::adw_overlay_split_view_get_enable_show_gesture(
76 self.to_glib_none().0,
77 ))
78 }
79 }
80
81 #[doc(alias = "adw_overlay_split_view_get_max_sidebar_width")]
82 #[doc(alias = "get_max_sidebar_width")]
83 #[doc(alias = "max-sidebar-width")]
84 pub fn max_sidebar_width(&self) -> f64 {
85 unsafe { ffi::adw_overlay_split_view_get_max_sidebar_width(self.to_glib_none().0) }
86 }
87
88 #[doc(alias = "adw_overlay_split_view_get_min_sidebar_width")]
89 #[doc(alias = "get_min_sidebar_width")]
90 #[doc(alias = "min-sidebar-width")]
91 pub fn min_sidebar_width(&self) -> f64 {
92 unsafe { ffi::adw_overlay_split_view_get_min_sidebar_width(self.to_glib_none().0) }
93 }
94
95 #[doc(alias = "adw_overlay_split_view_get_pin_sidebar")]
96 #[doc(alias = "get_pin_sidebar")]
97 #[doc(alias = "pin-sidebar")]
98 pub fn is_pin_sidebar(&self) -> bool {
99 unsafe {
100 from_glib(ffi::adw_overlay_split_view_get_pin_sidebar(
101 self.to_glib_none().0,
102 ))
103 }
104 }
105
106 #[doc(alias = "adw_overlay_split_view_get_show_sidebar")]
107 #[doc(alias = "get_show_sidebar")]
108 #[doc(alias = "show-sidebar")]
109 pub fn shows_sidebar(&self) -> bool {
110 unsafe {
111 from_glib(ffi::adw_overlay_split_view_get_show_sidebar(
112 self.to_glib_none().0,
113 ))
114 }
115 }
116
117 #[doc(alias = "adw_overlay_split_view_get_sidebar")]
118 #[doc(alias = "get_sidebar")]
119 pub fn sidebar(&self) -> Option<gtk::Widget> {
120 unsafe {
121 from_glib_none(ffi::adw_overlay_split_view_get_sidebar(
122 self.to_glib_none().0,
123 ))
124 }
125 }
126
127 #[doc(alias = "adw_overlay_split_view_get_sidebar_position")]
128 #[doc(alias = "get_sidebar_position")]
129 #[doc(alias = "sidebar-position")]
130 pub fn sidebar_position(&self) -> gtk::PackType {
131 unsafe {
132 from_glib(ffi::adw_overlay_split_view_get_sidebar_position(
133 self.to_glib_none().0,
134 ))
135 }
136 }
137
138 #[doc(alias = "adw_overlay_split_view_get_sidebar_width_fraction")]
139 #[doc(alias = "get_sidebar_width_fraction")]
140 #[doc(alias = "sidebar-width-fraction")]
141 pub fn sidebar_width_fraction(&self) -> f64 {
142 unsafe { ffi::adw_overlay_split_view_get_sidebar_width_fraction(self.to_glib_none().0) }
143 }
144
145 #[doc(alias = "adw_overlay_split_view_get_sidebar_width_unit")]
146 #[doc(alias = "get_sidebar_width_unit")]
147 #[doc(alias = "sidebar-width-unit")]
148 pub fn sidebar_width_unit(&self) -> LengthUnit {
149 unsafe {
150 from_glib(ffi::adw_overlay_split_view_get_sidebar_width_unit(
151 self.to_glib_none().0,
152 ))
153 }
154 }
155
156 #[doc(alias = "adw_overlay_split_view_set_collapsed")]
157 #[doc(alias = "collapsed")]
158 pub fn set_collapsed(&self, collapsed: bool) {
159 unsafe {
160 ffi::adw_overlay_split_view_set_collapsed(self.to_glib_none().0, collapsed.into_glib());
161 }
162 }
163
164 #[doc(alias = "adw_overlay_split_view_set_content")]
165 #[doc(alias = "content")]
166 pub fn set_content(&self, content: Option<&impl IsA<gtk::Widget>>) {
167 unsafe {
168 ffi::adw_overlay_split_view_set_content(
169 self.to_glib_none().0,
170 content.map(|p| p.as_ref()).to_glib_none().0,
171 );
172 }
173 }
174
175 #[doc(alias = "adw_overlay_split_view_set_enable_hide_gesture")]
176 #[doc(alias = "enable-hide-gesture")]
177 pub fn set_enable_hide_gesture(&self, enable_hide_gesture: bool) {
178 unsafe {
179 ffi::adw_overlay_split_view_set_enable_hide_gesture(
180 self.to_glib_none().0,
181 enable_hide_gesture.into_glib(),
182 );
183 }
184 }
185
186 #[doc(alias = "adw_overlay_split_view_set_enable_show_gesture")]
187 #[doc(alias = "enable-show-gesture")]
188 pub fn set_enable_show_gesture(&self, enable_show_gesture: bool) {
189 unsafe {
190 ffi::adw_overlay_split_view_set_enable_show_gesture(
191 self.to_glib_none().0,
192 enable_show_gesture.into_glib(),
193 );
194 }
195 }
196
197 #[doc(alias = "adw_overlay_split_view_set_max_sidebar_width")]
198 #[doc(alias = "max-sidebar-width")]
199 pub fn set_max_sidebar_width(&self, width: f64) {
200 unsafe {
201 ffi::adw_overlay_split_view_set_max_sidebar_width(self.to_glib_none().0, width);
202 }
203 }
204
205 #[doc(alias = "adw_overlay_split_view_set_min_sidebar_width")]
206 #[doc(alias = "min-sidebar-width")]
207 pub fn set_min_sidebar_width(&self, width: f64) {
208 unsafe {
209 ffi::adw_overlay_split_view_set_min_sidebar_width(self.to_glib_none().0, width);
210 }
211 }
212
213 #[doc(alias = "adw_overlay_split_view_set_pin_sidebar")]
214 #[doc(alias = "pin-sidebar")]
215 pub fn set_pin_sidebar(&self, pin_sidebar: bool) {
216 unsafe {
217 ffi::adw_overlay_split_view_set_pin_sidebar(
218 self.to_glib_none().0,
219 pin_sidebar.into_glib(),
220 );
221 }
222 }
223
224 #[doc(alias = "adw_overlay_split_view_set_show_sidebar")]
225 #[doc(alias = "show-sidebar")]
226 pub fn set_show_sidebar(&self, show_sidebar: bool) {
227 unsafe {
228 ffi::adw_overlay_split_view_set_show_sidebar(
229 self.to_glib_none().0,
230 show_sidebar.into_glib(),
231 );
232 }
233 }
234
235 #[doc(alias = "adw_overlay_split_view_set_sidebar")]
236 #[doc(alias = "sidebar")]
237 pub fn set_sidebar(&self, sidebar: Option<&impl IsA<gtk::Widget>>) {
238 unsafe {
239 ffi::adw_overlay_split_view_set_sidebar(
240 self.to_glib_none().0,
241 sidebar.map(|p| p.as_ref()).to_glib_none().0,
242 );
243 }
244 }
245
246 #[doc(alias = "adw_overlay_split_view_set_sidebar_position")]
247 #[doc(alias = "sidebar-position")]
248 pub fn set_sidebar_position(&self, position: gtk::PackType) {
249 unsafe {
250 ffi::adw_overlay_split_view_set_sidebar_position(
251 self.to_glib_none().0,
252 position.into_glib(),
253 );
254 }
255 }
256
257 #[doc(alias = "adw_overlay_split_view_set_sidebar_width_fraction")]
258 #[doc(alias = "sidebar-width-fraction")]
259 pub fn set_sidebar_width_fraction(&self, fraction: f64) {
260 unsafe {
261 ffi::adw_overlay_split_view_set_sidebar_width_fraction(self.to_glib_none().0, fraction);
262 }
263 }
264
265 #[doc(alias = "adw_overlay_split_view_set_sidebar_width_unit")]
266 #[doc(alias = "sidebar-width-unit")]
267 pub fn set_sidebar_width_unit(&self, unit: LengthUnit) {
268 unsafe {
269 ffi::adw_overlay_split_view_set_sidebar_width_unit(
270 self.to_glib_none().0,
271 unit.into_glib(),
272 );
273 }
274 }
275
276 #[cfg(feature = "v1_4")]
277 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
278 #[doc(alias = "collapsed")]
279 pub fn connect_collapsed_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
280 unsafe extern "C" fn notify_collapsed_trampoline<F: Fn(&OverlaySplitView) + 'static>(
281 this: *mut ffi::AdwOverlaySplitView,
282 _param_spec: glib::ffi::gpointer,
283 f: glib::ffi::gpointer,
284 ) {
285 let f: &F = &*(f as *const F);
286 f(&from_glib_borrow(this))
287 }
288 unsafe {
289 let f: Box_<F> = Box_::new(f);
290 connect_raw(
291 self.as_ptr() as *mut _,
292 c"notify::collapsed".as_ptr() as *const _,
293 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
294 notify_collapsed_trampoline::<F> as *const (),
295 )),
296 Box_::into_raw(f),
297 )
298 }
299 }
300
301 #[cfg(feature = "v1_4")]
302 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
303 #[doc(alias = "content")]
304 pub fn connect_content_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
305 unsafe extern "C" fn notify_content_trampoline<F: Fn(&OverlaySplitView) + 'static>(
306 this: *mut ffi::AdwOverlaySplitView,
307 _param_spec: glib::ffi::gpointer,
308 f: glib::ffi::gpointer,
309 ) {
310 let f: &F = &*(f as *const F);
311 f(&from_glib_borrow(this))
312 }
313 unsafe {
314 let f: Box_<F> = Box_::new(f);
315 connect_raw(
316 self.as_ptr() as *mut _,
317 c"notify::content".as_ptr() as *const _,
318 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
319 notify_content_trampoline::<F> as *const (),
320 )),
321 Box_::into_raw(f),
322 )
323 }
324 }
325
326 #[cfg(feature = "v1_4")]
327 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
328 #[doc(alias = "enable-hide-gesture")]
329 pub fn connect_enable_hide_gesture_notify<F: Fn(&Self) + 'static>(
330 &self,
331 f: F,
332 ) -> SignalHandlerId {
333 unsafe extern "C" fn notify_enable_hide_gesture_trampoline<
334 F: Fn(&OverlaySplitView) + 'static,
335 >(
336 this: *mut ffi::AdwOverlaySplitView,
337 _param_spec: glib::ffi::gpointer,
338 f: glib::ffi::gpointer,
339 ) {
340 let f: &F = &*(f as *const F);
341 f(&from_glib_borrow(this))
342 }
343 unsafe {
344 let f: Box_<F> = Box_::new(f);
345 connect_raw(
346 self.as_ptr() as *mut _,
347 c"notify::enable-hide-gesture".as_ptr() as *const _,
348 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
349 notify_enable_hide_gesture_trampoline::<F> as *const (),
350 )),
351 Box_::into_raw(f),
352 )
353 }
354 }
355
356 #[cfg(feature = "v1_4")]
357 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
358 #[doc(alias = "enable-show-gesture")]
359 pub fn connect_enable_show_gesture_notify<F: Fn(&Self) + 'static>(
360 &self,
361 f: F,
362 ) -> SignalHandlerId {
363 unsafe extern "C" fn notify_enable_show_gesture_trampoline<
364 F: Fn(&OverlaySplitView) + 'static,
365 >(
366 this: *mut ffi::AdwOverlaySplitView,
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::enable-show-gesture".as_ptr() as *const _,
378 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
379 notify_enable_show_gesture_trampoline::<F> as *const (),
380 )),
381 Box_::into_raw(f),
382 )
383 }
384 }
385
386 #[cfg(feature = "v1_4")]
387 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
388 #[doc(alias = "max-sidebar-width")]
389 pub fn connect_max_sidebar_width_notify<F: Fn(&Self) + 'static>(
390 &self,
391 f: F,
392 ) -> SignalHandlerId {
393 unsafe extern "C" fn notify_max_sidebar_width_trampoline<
394 F: Fn(&OverlaySplitView) + 'static,
395 >(
396 this: *mut ffi::AdwOverlaySplitView,
397 _param_spec: glib::ffi::gpointer,
398 f: glib::ffi::gpointer,
399 ) {
400 let f: &F = &*(f as *const F);
401 f(&from_glib_borrow(this))
402 }
403 unsafe {
404 let f: Box_<F> = Box_::new(f);
405 connect_raw(
406 self.as_ptr() as *mut _,
407 c"notify::max-sidebar-width".as_ptr() as *const _,
408 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
409 notify_max_sidebar_width_trampoline::<F> as *const (),
410 )),
411 Box_::into_raw(f),
412 )
413 }
414 }
415
416 #[cfg(feature = "v1_4")]
417 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
418 #[doc(alias = "min-sidebar-width")]
419 pub fn connect_min_sidebar_width_notify<F: Fn(&Self) + 'static>(
420 &self,
421 f: F,
422 ) -> SignalHandlerId {
423 unsafe extern "C" fn notify_min_sidebar_width_trampoline<
424 F: Fn(&OverlaySplitView) + 'static,
425 >(
426 this: *mut ffi::AdwOverlaySplitView,
427 _param_spec: glib::ffi::gpointer,
428 f: glib::ffi::gpointer,
429 ) {
430 let f: &F = &*(f as *const F);
431 f(&from_glib_borrow(this))
432 }
433 unsafe {
434 let f: Box_<F> = Box_::new(f);
435 connect_raw(
436 self.as_ptr() as *mut _,
437 c"notify::min-sidebar-width".as_ptr() as *const _,
438 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
439 notify_min_sidebar_width_trampoline::<F> as *const (),
440 )),
441 Box_::into_raw(f),
442 )
443 }
444 }
445
446 #[cfg(feature = "v1_4")]
447 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
448 #[doc(alias = "pin-sidebar")]
449 pub fn connect_pin_sidebar_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
450 unsafe extern "C" fn notify_pin_sidebar_trampoline<F: Fn(&OverlaySplitView) + 'static>(
451 this: *mut ffi::AdwOverlaySplitView,
452 _param_spec: glib::ffi::gpointer,
453 f: glib::ffi::gpointer,
454 ) {
455 let f: &F = &*(f as *const F);
456 f(&from_glib_borrow(this))
457 }
458 unsafe {
459 let f: Box_<F> = Box_::new(f);
460 connect_raw(
461 self.as_ptr() as *mut _,
462 c"notify::pin-sidebar".as_ptr() as *const _,
463 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
464 notify_pin_sidebar_trampoline::<F> as *const (),
465 )),
466 Box_::into_raw(f),
467 )
468 }
469 }
470
471 #[cfg(feature = "v1_4")]
472 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
473 #[doc(alias = "show-sidebar")]
474 pub fn connect_show_sidebar_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
475 unsafe extern "C" fn notify_show_sidebar_trampoline<F: Fn(&OverlaySplitView) + 'static>(
476 this: *mut ffi::AdwOverlaySplitView,
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::show-sidebar".as_ptr() as *const _,
488 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
489 notify_show_sidebar_trampoline::<F> as *const (),
490 )),
491 Box_::into_raw(f),
492 )
493 }
494 }
495
496 #[cfg(feature = "v1_4")]
497 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
498 #[doc(alias = "sidebar")]
499 pub fn connect_sidebar_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
500 unsafe extern "C" fn notify_sidebar_trampoline<F: Fn(&OverlaySplitView) + 'static>(
501 this: *mut ffi::AdwOverlaySplitView,
502 _param_spec: glib::ffi::gpointer,
503 f: glib::ffi::gpointer,
504 ) {
505 let f: &F = &*(f as *const F);
506 f(&from_glib_borrow(this))
507 }
508 unsafe {
509 let f: Box_<F> = Box_::new(f);
510 connect_raw(
511 self.as_ptr() as *mut _,
512 c"notify::sidebar".as_ptr() as *const _,
513 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
514 notify_sidebar_trampoline::<F> as *const (),
515 )),
516 Box_::into_raw(f),
517 )
518 }
519 }
520
521 #[cfg(feature = "v1_4")]
522 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
523 #[doc(alias = "sidebar-position")]
524 pub fn connect_sidebar_position_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
525 unsafe extern "C" fn notify_sidebar_position_trampoline<
526 F: Fn(&OverlaySplitView) + 'static,
527 >(
528 this: *mut ffi::AdwOverlaySplitView,
529 _param_spec: glib::ffi::gpointer,
530 f: glib::ffi::gpointer,
531 ) {
532 let f: &F = &*(f as *const F);
533 f(&from_glib_borrow(this))
534 }
535 unsafe {
536 let f: Box_<F> = Box_::new(f);
537 connect_raw(
538 self.as_ptr() as *mut _,
539 c"notify::sidebar-position".as_ptr() as *const _,
540 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
541 notify_sidebar_position_trampoline::<F> as *const (),
542 )),
543 Box_::into_raw(f),
544 )
545 }
546 }
547
548 #[cfg(feature = "v1_4")]
549 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
550 #[doc(alias = "sidebar-width-fraction")]
551 pub fn connect_sidebar_width_fraction_notify<F: Fn(&Self) + 'static>(
552 &self,
553 f: F,
554 ) -> SignalHandlerId {
555 unsafe extern "C" fn notify_sidebar_width_fraction_trampoline<
556 F: Fn(&OverlaySplitView) + 'static,
557 >(
558 this: *mut ffi::AdwOverlaySplitView,
559 _param_spec: glib::ffi::gpointer,
560 f: glib::ffi::gpointer,
561 ) {
562 let f: &F = &*(f as *const F);
563 f(&from_glib_borrow(this))
564 }
565 unsafe {
566 let f: Box_<F> = Box_::new(f);
567 connect_raw(
568 self.as_ptr() as *mut _,
569 c"notify::sidebar-width-fraction".as_ptr() as *const _,
570 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
571 notify_sidebar_width_fraction_trampoline::<F> as *const (),
572 )),
573 Box_::into_raw(f),
574 )
575 }
576 }
577
578 #[cfg(feature = "v1_4")]
579 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
580 #[doc(alias = "sidebar-width-unit")]
581 pub fn connect_sidebar_width_unit_notify<F: Fn(&Self) + 'static>(
582 &self,
583 f: F,
584 ) -> SignalHandlerId {
585 unsafe extern "C" fn notify_sidebar_width_unit_trampoline<
586 F: Fn(&OverlaySplitView) + 'static,
587 >(
588 this: *mut ffi::AdwOverlaySplitView,
589 _param_spec: glib::ffi::gpointer,
590 f: glib::ffi::gpointer,
591 ) {
592 let f: &F = &*(f as *const F);
593 f(&from_glib_borrow(this))
594 }
595 unsafe {
596 let f: Box_<F> = Box_::new(f);
597 connect_raw(
598 self.as_ptr() as *mut _,
599 c"notify::sidebar-width-unit".as_ptr() as *const _,
600 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
601 notify_sidebar_width_unit_trampoline::<F> as *const (),
602 )),
603 Box_::into_raw(f),
604 )
605 }
606 }
607}
608
609#[cfg(feature = "v1_4")]
610#[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
611impl Default for OverlaySplitView {
612 fn default() -> Self {
613 Self::new()
614 }
615}
616
617#[must_use = "The builder must be built to be used"]
622pub struct OverlaySplitViewBuilder {
623 builder: glib::object::ObjectBuilder<'static, OverlaySplitView>,
624}
625
626impl OverlaySplitViewBuilder {
627 fn new() -> Self {
628 Self {
629 builder: glib::object::Object::builder(),
630 }
631 }
632
633 #[cfg(feature = "v1_4")]
634 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
635 pub fn collapsed(self, collapsed: bool) -> Self {
636 Self {
637 builder: self.builder.property("collapsed", collapsed),
638 }
639 }
640
641 #[cfg(feature = "v1_4")]
642 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
643 pub fn content(self, content: &impl IsA<gtk::Widget>) -> Self {
644 Self {
645 builder: self.builder.property("content", content.clone().upcast()),
646 }
647 }
648
649 #[cfg(feature = "v1_4")]
650 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
651 pub fn enable_hide_gesture(self, enable_hide_gesture: bool) -> Self {
652 Self {
653 builder: self
654 .builder
655 .property("enable-hide-gesture", enable_hide_gesture),
656 }
657 }
658
659 #[cfg(feature = "v1_4")]
660 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
661 pub fn enable_show_gesture(self, enable_show_gesture: bool) -> Self {
662 Self {
663 builder: self
664 .builder
665 .property("enable-show-gesture", enable_show_gesture),
666 }
667 }
668
669 #[cfg(feature = "v1_4")]
670 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
671 pub fn max_sidebar_width(self, max_sidebar_width: f64) -> Self {
672 Self {
673 builder: self
674 .builder
675 .property("max-sidebar-width", max_sidebar_width),
676 }
677 }
678
679 #[cfg(feature = "v1_4")]
680 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
681 pub fn min_sidebar_width(self, min_sidebar_width: f64) -> Self {
682 Self {
683 builder: self
684 .builder
685 .property("min-sidebar-width", min_sidebar_width),
686 }
687 }
688
689 #[cfg(feature = "v1_4")]
690 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
691 pub fn pin_sidebar(self, pin_sidebar: bool) -> Self {
692 Self {
693 builder: self.builder.property("pin-sidebar", pin_sidebar),
694 }
695 }
696
697 #[cfg(feature = "v1_4")]
698 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
699 pub fn show_sidebar(self, show_sidebar: bool) -> Self {
700 Self {
701 builder: self.builder.property("show-sidebar", show_sidebar),
702 }
703 }
704
705 #[cfg(feature = "v1_4")]
706 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
707 pub fn sidebar(self, sidebar: &impl IsA<gtk::Widget>) -> Self {
708 Self {
709 builder: self.builder.property("sidebar", sidebar.clone().upcast()),
710 }
711 }
712
713 #[cfg(feature = "v1_4")]
714 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
715 pub fn sidebar_position(self, sidebar_position: gtk::PackType) -> Self {
716 Self {
717 builder: self.builder.property("sidebar-position", sidebar_position),
718 }
719 }
720
721 #[cfg(feature = "v1_4")]
722 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
723 pub fn sidebar_width_fraction(self, sidebar_width_fraction: f64) -> Self {
724 Self {
725 builder: self
726 .builder
727 .property("sidebar-width-fraction", sidebar_width_fraction),
728 }
729 }
730
731 #[cfg(feature = "v1_4")]
732 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
733 pub fn sidebar_width_unit(self, sidebar_width_unit: LengthUnit) -> Self {
734 Self {
735 builder: self
736 .builder
737 .property("sidebar-width-unit", sidebar_width_unit),
738 }
739 }
740
741 pub fn can_focus(self, can_focus: bool) -> Self {
742 Self {
743 builder: self.builder.property("can-focus", can_focus),
744 }
745 }
746
747 pub fn can_target(self, can_target: bool) -> Self {
748 Self {
749 builder: self.builder.property("can-target", can_target),
750 }
751 }
752
753 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
754 Self {
755 builder: self.builder.property("css-classes", css_classes.into()),
756 }
757 }
758
759 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
760 Self {
761 builder: self.builder.property("css-name", css_name.into()),
762 }
763 }
764
765 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
766 Self {
767 builder: self.builder.property("cursor", cursor.clone()),
768 }
769 }
770
771 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
772 Self {
773 builder: self.builder.property("focus-on-click", focus_on_click),
774 }
775 }
776
777 pub fn focusable(self, focusable: bool) -> Self {
778 Self {
779 builder: self.builder.property("focusable", focusable),
780 }
781 }
782
783 pub fn halign(self, halign: gtk::Align) -> Self {
784 Self {
785 builder: self.builder.property("halign", halign),
786 }
787 }
788
789 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
790 Self {
791 builder: self.builder.property("has-tooltip", has_tooltip),
792 }
793 }
794
795 pub fn height_request(self, height_request: i32) -> Self {
796 Self {
797 builder: self.builder.property("height-request", height_request),
798 }
799 }
800
801 pub fn hexpand(self, hexpand: bool) -> Self {
802 Self {
803 builder: self.builder.property("hexpand", hexpand),
804 }
805 }
806
807 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
808 Self {
809 builder: self.builder.property("hexpand-set", hexpand_set),
810 }
811 }
812
813 pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
814 Self {
815 builder: self
816 .builder
817 .property("layout-manager", layout_manager.clone().upcast()),
818 }
819 }
820
821 #[cfg(feature = "gtk_v4_18")]
822 #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
823 pub fn limit_events(self, limit_events: bool) -> Self {
824 Self {
825 builder: self.builder.property("limit-events", limit_events),
826 }
827 }
828
829 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
830 Self {
831 builder: self.builder.property("margin-bottom", margin_bottom),
832 }
833 }
834
835 pub fn margin_end(self, margin_end: i32) -> Self {
836 Self {
837 builder: self.builder.property("margin-end", margin_end),
838 }
839 }
840
841 pub fn margin_start(self, margin_start: i32) -> Self {
842 Self {
843 builder: self.builder.property("margin-start", margin_start),
844 }
845 }
846
847 pub fn margin_top(self, margin_top: i32) -> Self {
848 Self {
849 builder: self.builder.property("margin-top", margin_top),
850 }
851 }
852
853 pub fn name(self, name: impl Into<glib::GString>) -> Self {
854 Self {
855 builder: self.builder.property("name", name.into()),
856 }
857 }
858
859 pub fn opacity(self, opacity: f64) -> Self {
860 Self {
861 builder: self.builder.property("opacity", opacity),
862 }
863 }
864
865 pub fn overflow(self, overflow: gtk::Overflow) -> Self {
866 Self {
867 builder: self.builder.property("overflow", overflow),
868 }
869 }
870
871 pub fn receives_default(self, receives_default: bool) -> Self {
872 Self {
873 builder: self.builder.property("receives-default", receives_default),
874 }
875 }
876
877 pub fn sensitive(self, sensitive: bool) -> Self {
878 Self {
879 builder: self.builder.property("sensitive", sensitive),
880 }
881 }
882
883 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
884 Self {
885 builder: self
886 .builder
887 .property("tooltip-markup", tooltip_markup.into()),
888 }
889 }
890
891 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
892 Self {
893 builder: self.builder.property("tooltip-text", tooltip_text.into()),
894 }
895 }
896
897 pub fn valign(self, valign: gtk::Align) -> Self {
898 Self {
899 builder: self.builder.property("valign", valign),
900 }
901 }
902
903 pub fn vexpand(self, vexpand: bool) -> Self {
904 Self {
905 builder: self.builder.property("vexpand", vexpand),
906 }
907 }
908
909 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
910 Self {
911 builder: self.builder.property("vexpand-set", vexpand_set),
912 }
913 }
914
915 pub fn visible(self, visible: bool) -> Self {
916 Self {
917 builder: self.builder.property("visible", visible),
918 }
919 }
920
921 pub fn width_request(self, width_request: i32) -> Self {
922 Self {
923 builder: self.builder.property("width-request", width_request),
924 }
925 }
926
927 pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
928 Self {
929 builder: self.builder.property("accessible-role", accessible_role),
930 }
931 }
932
933 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
936 pub fn build(self) -> OverlaySplitView {
937 assert_initialized_main_thread!();
938 self.builder.build()
939 }
940}