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