libadwaita/auto/carousel_indicator_lines.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::{Carousel, ffi};
7use glib::{
8 prelude::*,
9 signal::{SignalHandlerId, connect_raw},
10 translate::*,
11};
12use std::boxed::Box as Box_;
13
14#[cfg(feature = "gtk_v4_10")]
15#[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_10")))]
16glib::wrapper! {
17 ///
18 ///
19 /// The [`CarouselIndicatorLines`][crate::CarouselIndicatorLines] widget shows a set of lines for each page of
20 /// a given [`Carousel`][crate::Carousel]. The carousel's active page is shown as another line
21 /// that moves between them to match the carousel's position.
22 ///
23 /// See also [`CarouselIndicatorDots`][crate::CarouselIndicatorDots].
24 ///
25 /// ## CSS nodes
26 ///
27 /// [`CarouselIndicatorLines`][crate::CarouselIndicatorLines] has a single CSS node with name
28 /// `carouselindicatorlines`.
29 ///
30 /// ## Properties
31 ///
32 ///
33 /// #### `carousel`
34 /// The displayed carousel.
35 ///
36 /// Readable | Writable
37 /// <details><summary><h4>Widget</h4></summary>
38 ///
39 ///
40 /// #### `can-focus`
41 /// Whether the widget or any of its descendents can accept
42 /// the input focus.
43 ///
44 /// This property is meant to be set by widget implementations,
45 /// typically in their instance init function.
46 ///
47 /// Readable | Writable
48 ///
49 ///
50 /// #### `can-target`
51 /// Whether the widget can receive pointer events.
52 ///
53 /// Readable | Writable
54 ///
55 ///
56 /// #### `css-classes`
57 /// A list of css classes applied to this widget.
58 ///
59 /// Readable | Writable
60 ///
61 ///
62 /// #### `css-name`
63 /// The name of this widget in the CSS tree.
64 ///
65 /// This property is meant to be set by widget implementations,
66 /// typically in their instance init function.
67 ///
68 /// Readable | Writable | Construct Only
69 ///
70 ///
71 /// #### `cursor`
72 /// The cursor used by @widget.
73 ///
74 /// Readable | Writable
75 ///
76 ///
77 /// #### `focus-on-click`
78 /// Whether the widget should grab focus when it is clicked with the mouse.
79 ///
80 /// This property is only relevant for widgets that can take focus.
81 ///
82 /// Readable | Writable
83 ///
84 ///
85 /// #### `focusable`
86 /// Whether this widget itself will accept the input focus.
87 ///
88 /// Readable | Writable
89 ///
90 ///
91 /// #### `halign`
92 /// How to distribute horizontal space if widget gets extra space.
93 ///
94 /// Readable | Writable
95 ///
96 ///
97 /// #### `has-default`
98 /// Whether the widget is the default widget.
99 ///
100 /// Readable
101 ///
102 ///
103 /// #### `has-focus`
104 /// Whether the widget has the input focus.
105 ///
106 /// Readable
107 ///
108 ///
109 /// #### `has-tooltip`
110 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip]
111 /// signal on @widget.
112 ///
113 /// A true value indicates that @widget can have a tooltip, in this case
114 /// the widget will be queried using [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] to
115 /// determine whether it will provide a tooltip or not.
116 ///
117 /// Readable | Writable
118 ///
119 ///
120 /// #### `height-request`
121 /// Overrides for height request of the widget.
122 ///
123 /// If this is -1, the natural request will be used.
124 ///
125 /// Readable | Writable
126 ///
127 ///
128 /// #### `hexpand`
129 /// Whether to expand horizontally.
130 ///
131 /// Readable | Writable
132 ///
133 ///
134 /// #### `hexpand-set`
135 /// Whether to use the `hexpand` property.
136 ///
137 /// Readable | Writable
138 ///
139 ///
140 /// #### `layout-manager`
141 /// The [`gtk::LayoutManager`][crate::gtk::LayoutManager] instance to use to compute
142 /// the preferred size of the widget, and allocate its children.
143 ///
144 /// This property is meant to be set by widget implementations,
145 /// typically in their instance init function.
146 ///
147 /// Readable | Writable
148 ///
149 ///
150 /// #### `limit-events`
151 /// Makes this widget act like a modal dialog, with respect to
152 /// event delivery.
153 ///
154 /// Global event controllers will not handle events with targets
155 /// inside the widget, unless they are set up to ignore propagation
156 /// limits. See `Gtk::EventController::set_propagation_limit()`.
157 ///
158 /// Readable | Writable
159 ///
160 ///
161 /// #### `margin-bottom`
162 /// Margin on bottom side of widget.
163 ///
164 /// This property adds margin outside of the widget's normal size
165 /// request, the margin will be added in addition to the size from
166 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
167 ///
168 /// Readable | Writable
169 ///
170 ///
171 /// #### `margin-end`
172 /// Margin on end of widget, horizontally.
173 ///
174 /// This property supports left-to-right and right-to-left text
175 /// directions.
176 ///
177 /// This property adds margin outside of the widget's normal size
178 /// request, the margin will be added in addition to the size from
179 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
180 ///
181 /// Readable | Writable
182 ///
183 ///
184 /// #### `margin-start`
185 /// Margin on start of widget, horizontally.
186 ///
187 /// This property supports left-to-right and right-to-left text
188 /// directions.
189 ///
190 /// This property adds margin outside of the widget's normal size
191 /// request, the margin will be added in addition to the size from
192 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
193 ///
194 /// Readable | Writable
195 ///
196 ///
197 /// #### `margin-top`
198 /// Margin on top side of widget.
199 ///
200 /// This property adds margin outside of the widget's normal size
201 /// request, the margin will be added in addition to the size from
202 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
203 ///
204 /// Readable | Writable
205 ///
206 ///
207 /// #### `name`
208 /// The name of the widget.
209 ///
210 /// Readable | Writable
211 ///
212 ///
213 /// #### `opacity`
214 /// The requested opacity of the widget.
215 ///
216 /// Readable | Writable
217 ///
218 ///
219 /// #### `overflow`
220 /// How content outside the widget's content area is treated.
221 ///
222 /// This property is meant to be set by widget implementations,
223 /// typically in their instance init function.
224 ///
225 /// Readable | Writable
226 ///
227 ///
228 /// #### `parent`
229 /// The parent widget of this widget.
230 ///
231 /// Readable
232 ///
233 ///
234 /// #### `receives-default`
235 /// Whether the widget will receive the default action when it is focused.
236 ///
237 /// Readable | Writable
238 ///
239 ///
240 /// #### `root`
241 /// The [`gtk::Root`][crate::gtk::Root] widget of the widget tree containing this widget.
242 ///
243 /// This will be `NULL` if the widget is not contained in a root widget.
244 ///
245 /// Readable
246 ///
247 ///
248 /// #### `scale-factor`
249 /// The scale factor of the widget.
250 ///
251 /// Readable
252 ///
253 ///
254 /// #### `sensitive`
255 /// Whether the widget responds to input.
256 ///
257 /// Readable | Writable
258 ///
259 ///
260 /// #### `tooltip-markup`
261 /// Sets the text of tooltip to be the given string, which is marked up
262 /// with Pango markup.
263 ///
264 /// Also see `Gtk::Tooltip::set_markup()`.
265 ///
266 /// This is a convenience property which will take care of getting the
267 /// tooltip shown if the given string is not `NULL`:
268 /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
269 /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
270 /// the default signal handler.
271 ///
272 /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
273 /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
274 ///
275 /// Readable | Writable
276 ///
277 ///
278 /// #### `tooltip-text`
279 /// Sets the text of tooltip to be the given string.
280 ///
281 /// Also see `Gtk::Tooltip::set_text()`.
282 ///
283 /// This is a convenience property which will take care of getting the
284 /// tooltip shown if the given string is not `NULL`:
285 /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
286 /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
287 /// the default signal handler.
288 ///
289 /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
290 /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
291 ///
292 /// Readable | Writable
293 ///
294 ///
295 /// #### `valign`
296 /// How to distribute vertical space if widget gets extra space.
297 ///
298 /// Readable | Writable
299 ///
300 ///
301 /// #### `vexpand`
302 /// Whether to expand vertically.
303 ///
304 /// Readable | Writable
305 ///
306 ///
307 /// #### `vexpand-set`
308 /// Whether to use the `vexpand` property.
309 ///
310 /// Readable | Writable
311 ///
312 ///
313 /// #### `visible`
314 /// Whether the widget is visible.
315 ///
316 /// Readable | Writable
317 ///
318 ///
319 /// #### `width-request`
320 /// Overrides for width request of the widget.
321 ///
322 /// If this is -1, the natural request will be used.
323 ///
324 /// Readable | Writable
325 /// </details>
326 /// <details><summary><h4>Accessible</h4></summary>
327 ///
328 ///
329 /// #### `accessible-role`
330 /// The accessible role of the given [`gtk::Accessible`][crate::gtk::Accessible] implementation.
331 ///
332 /// The accessible role cannot be changed once set.
333 ///
334 /// Readable | Writable
335 /// </details>
336 /// <details><summary><h4>Orientable</h4></summary>
337 ///
338 ///
339 /// #### `orientation`
340 /// The orientation of the orientable.
341 ///
342 /// Readable | Writable
343 /// </details>
344 ///
345 /// # Implements
346 ///
347 /// [`trait@gtk::prelude::WidgetExt`], [`trait@glib::ObjectExt`], [`trait@gtk::prelude::AccessibleExt`], [`trait@gtk::prelude::BuildableExt`], [`trait@gtk::prelude::ConstraintTargetExt`], [`trait@gtk::prelude::OrientableExt`]
348 #[doc(alias = "AdwCarouselIndicatorLines")]
349 pub struct CarouselIndicatorLines(Object<ffi::AdwCarouselIndicatorLines, ffi::AdwCarouselIndicatorLinesClass>) @extends gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable;
350
351 match fn {
352 type_ => || ffi::adw_carousel_indicator_lines_get_type(),
353 }
354}
355
356#[cfg(not(feature = "gtk_v4_10"))]
357glib::wrapper! {
358 #[doc(alias = "AdwCarouselIndicatorLines")]
359 pub struct CarouselIndicatorLines(Object<ffi::AdwCarouselIndicatorLines, ffi::AdwCarouselIndicatorLinesClass>) @extends gtk::Widget, @implements gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable;
360
361 match fn {
362 type_ => || ffi::adw_carousel_indicator_lines_get_type(),
363 }
364}
365
366impl CarouselIndicatorLines {
367 /// Creates a new [`CarouselIndicatorLines`][crate::CarouselIndicatorLines].
368 ///
369 /// # Returns
370 ///
371 /// the newly created [`CarouselIndicatorLines`][crate::CarouselIndicatorLines]
372 #[doc(alias = "adw_carousel_indicator_lines_new")]
373 pub fn new() -> CarouselIndicatorLines {
374 assert_initialized_main_thread!();
375 unsafe {
376 gtk::Widget::from_glib_none(ffi::adw_carousel_indicator_lines_new()).unsafe_cast()
377 }
378 }
379
380 // rustdoc-stripper-ignore-next
381 /// Creates a new builder-pattern struct instance to construct [`CarouselIndicatorLines`] objects.
382 ///
383 /// This method returns an instance of [`CarouselIndicatorLinesBuilder`](crate::builders::CarouselIndicatorLinesBuilder) which can be used to create [`CarouselIndicatorLines`] objects.
384 pub fn builder() -> CarouselIndicatorLinesBuilder {
385 CarouselIndicatorLinesBuilder::new()
386 }
387
388 /// Gets the displayed carousel.
389 ///
390 /// # Returns
391 ///
392 /// the displayed carousel
393 #[doc(alias = "adw_carousel_indicator_lines_get_carousel")]
394 #[doc(alias = "get_carousel")]
395 pub fn carousel(&self) -> Option<Carousel> {
396 unsafe {
397 from_glib_none(ffi::adw_carousel_indicator_lines_get_carousel(
398 self.to_glib_none().0,
399 ))
400 }
401 }
402
403 /// Sets the displayed carousel.
404 /// ## `carousel`
405 /// a carousel
406 #[doc(alias = "adw_carousel_indicator_lines_set_carousel")]
407 #[doc(alias = "carousel")]
408 pub fn set_carousel(&self, carousel: Option<&Carousel>) {
409 unsafe {
410 ffi::adw_carousel_indicator_lines_set_carousel(
411 self.to_glib_none().0,
412 carousel.to_glib_none().0,
413 );
414 }
415 }
416
417 #[doc(alias = "carousel")]
418 pub fn connect_carousel_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
419 unsafe extern "C" fn notify_carousel_trampoline<
420 F: Fn(&CarouselIndicatorLines) + 'static,
421 >(
422 this: *mut ffi::AdwCarouselIndicatorLines,
423 _param_spec: glib::ffi::gpointer,
424 f: glib::ffi::gpointer,
425 ) {
426 unsafe {
427 let f: &F = &*(f as *const F);
428 f(&from_glib_borrow(this))
429 }
430 }
431 unsafe {
432 let f: Box_<F> = Box_::new(f);
433 connect_raw(
434 self.as_ptr() as *mut _,
435 c"notify::carousel".as_ptr(),
436 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
437 notify_carousel_trampoline::<F> as *const (),
438 )),
439 Box_::into_raw(f),
440 )
441 }
442 }
443}
444
445impl Default for CarouselIndicatorLines {
446 fn default() -> Self {
447 Self::new()
448 }
449}
450
451// rustdoc-stripper-ignore-next
452/// A [builder-pattern] type to construct [`CarouselIndicatorLines`] objects.
453///
454/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
455#[must_use = "The builder must be built to be used"]
456pub struct CarouselIndicatorLinesBuilder {
457 builder: glib::object::ObjectBuilder<'static, CarouselIndicatorLines>,
458}
459
460impl CarouselIndicatorLinesBuilder {
461 fn new() -> Self {
462 Self {
463 builder: glib::object::Object::builder(),
464 }
465 }
466
467 /// The displayed carousel.
468 pub fn carousel(self, carousel: &Carousel) -> Self {
469 Self {
470 builder: self.builder.property("carousel", carousel.clone()),
471 }
472 }
473
474 /// Whether the widget or any of its descendents can accept
475 /// the input focus.
476 ///
477 /// This property is meant to be set by widget implementations,
478 /// typically in their instance init function.
479 pub fn can_focus(self, can_focus: bool) -> Self {
480 Self {
481 builder: self.builder.property("can-focus", can_focus),
482 }
483 }
484
485 /// Whether the widget can receive pointer events.
486 pub fn can_target(self, can_target: bool) -> Self {
487 Self {
488 builder: self.builder.property("can-target", can_target),
489 }
490 }
491
492 /// A list of css classes applied to this widget.
493 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
494 Self {
495 builder: self.builder.property("css-classes", css_classes.into()),
496 }
497 }
498
499 /// The name of this widget in the CSS tree.
500 ///
501 /// This property is meant to be set by widget implementations,
502 /// typically in their instance init function.
503 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
504 Self {
505 builder: self.builder.property("css-name", css_name.into()),
506 }
507 }
508
509 /// The cursor used by @widget.
510 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
511 Self {
512 builder: self.builder.property("cursor", cursor.clone()),
513 }
514 }
515
516 /// Whether the widget should grab focus when it is clicked with the mouse.
517 ///
518 /// This property is only relevant for widgets that can take focus.
519 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
520 Self {
521 builder: self.builder.property("focus-on-click", focus_on_click),
522 }
523 }
524
525 /// Whether this widget itself will accept the input focus.
526 pub fn focusable(self, focusable: bool) -> Self {
527 Self {
528 builder: self.builder.property("focusable", focusable),
529 }
530 }
531
532 /// How to distribute horizontal space if widget gets extra space.
533 pub fn halign(self, halign: gtk::Align) -> Self {
534 Self {
535 builder: self.builder.property("halign", halign),
536 }
537 }
538
539 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip]
540 /// signal on @widget.
541 ///
542 /// A true value indicates that @widget can have a tooltip, in this case
543 /// the widget will be queried using [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] to
544 /// determine whether it will provide a tooltip or not.
545 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
546 Self {
547 builder: self.builder.property("has-tooltip", has_tooltip),
548 }
549 }
550
551 /// Overrides for height request of the widget.
552 ///
553 /// If this is -1, the natural request will be used.
554 pub fn height_request(self, height_request: i32) -> Self {
555 Self {
556 builder: self.builder.property("height-request", height_request),
557 }
558 }
559
560 /// Whether to expand horizontally.
561 pub fn hexpand(self, hexpand: bool) -> Self {
562 Self {
563 builder: self.builder.property("hexpand", hexpand),
564 }
565 }
566
567 /// Whether to use the `hexpand` property.
568 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
569 Self {
570 builder: self.builder.property("hexpand-set", hexpand_set),
571 }
572 }
573
574 /// The [`gtk::LayoutManager`][crate::gtk::LayoutManager] instance to use to compute
575 /// the preferred size of the widget, and allocate its children.
576 ///
577 /// This property is meant to be set by widget implementations,
578 /// typically in their instance init function.
579 pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
580 Self {
581 builder: self
582 .builder
583 .property("layout-manager", layout_manager.clone().upcast()),
584 }
585 }
586
587 /// Makes this widget act like a modal dialog, with respect to
588 /// event delivery.
589 ///
590 /// Global event controllers will not handle events with targets
591 /// inside the widget, unless they are set up to ignore propagation
592 /// limits. See `Gtk::EventController::set_propagation_limit()`.
593 #[cfg(feature = "gtk_v4_18")]
594 #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
595 pub fn limit_events(self, limit_events: bool) -> Self {
596 Self {
597 builder: self.builder.property("limit-events", limit_events),
598 }
599 }
600
601 /// Margin on bottom side of widget.
602 ///
603 /// This property adds margin outside of the widget's normal size
604 /// request, the margin will be added in addition to the size from
605 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
606 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
607 Self {
608 builder: self.builder.property("margin-bottom", margin_bottom),
609 }
610 }
611
612 /// Margin on end of widget, horizontally.
613 ///
614 /// This property supports left-to-right and right-to-left text
615 /// directions.
616 ///
617 /// This property adds margin outside of the widget's normal size
618 /// request, the margin will be added in addition to the size from
619 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
620 pub fn margin_end(self, margin_end: i32) -> Self {
621 Self {
622 builder: self.builder.property("margin-end", margin_end),
623 }
624 }
625
626 /// Margin on start of widget, horizontally.
627 ///
628 /// This property supports left-to-right and right-to-left text
629 /// directions.
630 ///
631 /// This property adds margin outside of the widget's normal size
632 /// request, the margin will be added in addition to the size from
633 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
634 pub fn margin_start(self, margin_start: i32) -> Self {
635 Self {
636 builder: self.builder.property("margin-start", margin_start),
637 }
638 }
639
640 /// Margin on top side of widget.
641 ///
642 /// This property adds margin outside of the widget's normal size
643 /// request, the margin will be added in addition to the size from
644 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
645 pub fn margin_top(self, margin_top: i32) -> Self {
646 Self {
647 builder: self.builder.property("margin-top", margin_top),
648 }
649 }
650
651 /// The name of the widget.
652 pub fn name(self, name: impl Into<glib::GString>) -> Self {
653 Self {
654 builder: self.builder.property("name", name.into()),
655 }
656 }
657
658 /// The requested opacity of the widget.
659 pub fn opacity(self, opacity: f64) -> Self {
660 Self {
661 builder: self.builder.property("opacity", opacity),
662 }
663 }
664
665 /// How content outside the widget's content area is treated.
666 ///
667 /// This property is meant to be set by widget implementations,
668 /// typically in their instance init function.
669 pub fn overflow(self, overflow: gtk::Overflow) -> Self {
670 Self {
671 builder: self.builder.property("overflow", overflow),
672 }
673 }
674
675 /// Whether the widget will receive the default action when it is focused.
676 pub fn receives_default(self, receives_default: bool) -> Self {
677 Self {
678 builder: self.builder.property("receives-default", receives_default),
679 }
680 }
681
682 /// Whether the widget responds to input.
683 pub fn sensitive(self, sensitive: bool) -> Self {
684 Self {
685 builder: self.builder.property("sensitive", sensitive),
686 }
687 }
688
689 /// Sets the text of tooltip to be the given string, which is marked up
690 /// with Pango markup.
691 ///
692 /// Also see `Gtk::Tooltip::set_markup()`.
693 ///
694 /// This is a convenience property which will take care of getting the
695 /// tooltip shown if the given string is not `NULL`:
696 /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
697 /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
698 /// the default signal handler.
699 ///
700 /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
701 /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
702 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
703 Self {
704 builder: self
705 .builder
706 .property("tooltip-markup", tooltip_markup.into()),
707 }
708 }
709
710 /// Sets the text of tooltip to be the given string.
711 ///
712 /// Also see `Gtk::Tooltip::set_text()`.
713 ///
714 /// This is a convenience property which will take care of getting the
715 /// tooltip shown if the given string is not `NULL`:
716 /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
717 /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
718 /// the default signal handler.
719 ///
720 /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
721 /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
722 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
723 Self {
724 builder: self.builder.property("tooltip-text", tooltip_text.into()),
725 }
726 }
727
728 /// How to distribute vertical space if widget gets extra space.
729 pub fn valign(self, valign: gtk::Align) -> Self {
730 Self {
731 builder: self.builder.property("valign", valign),
732 }
733 }
734
735 /// Whether to expand vertically.
736 pub fn vexpand(self, vexpand: bool) -> Self {
737 Self {
738 builder: self.builder.property("vexpand", vexpand),
739 }
740 }
741
742 /// Whether to use the `vexpand` property.
743 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
744 Self {
745 builder: self.builder.property("vexpand-set", vexpand_set),
746 }
747 }
748
749 /// Whether the widget is visible.
750 pub fn visible(self, visible: bool) -> Self {
751 Self {
752 builder: self.builder.property("visible", visible),
753 }
754 }
755
756 /// Overrides for width request of the widget.
757 ///
758 /// If this is -1, the natural request will be used.
759 pub fn width_request(self, width_request: i32) -> Self {
760 Self {
761 builder: self.builder.property("width-request", width_request),
762 }
763 }
764
765 /// The accessible role of the given [`gtk::Accessible`][crate::gtk::Accessible] implementation.
766 ///
767 /// The accessible role cannot be changed once set.
768 pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
769 Self {
770 builder: self.builder.property("accessible-role", accessible_role),
771 }
772 }
773
774 /// The orientation of the orientable.
775 pub fn orientation(self, orientation: gtk::Orientation) -> Self {
776 Self {
777 builder: self.builder.property("orientation", orientation),
778 }
779 }
780
781 // rustdoc-stripper-ignore-next
782 /// Build the [`CarouselIndicatorLines`].
783 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
784 pub fn build(self) -> CarouselIndicatorLines {
785 assert_initialized_main_thread!();
786 self.builder.build()
787 }
788}