gtk4/auto/
action_bar.rs

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