gtk4/auto/overlay_layout.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::{ffi, LayoutManager};
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9 /// [`OverlayLayout`][crate::OverlayLayout] is the layout manager used by [`Overlay`][crate::Overlay].
10 ///
11 /// It places widgets as overlays on top of the main child.
12 ///
13 /// This is not a reusable layout manager, since it expects its widget
14 /// to be a [`Overlay`][crate::Overlay]. It is only listed here so that its layout
15 /// properties get documented.
16 ///
17 /// # Implements
18 ///
19 /// [`LayoutManagerExt`][trait@crate::prelude::LayoutManagerExt], [`trait@glib::ObjectExt`]
20 #[doc(alias = "GtkOverlayLayout")]
21 pub struct OverlayLayout(Object<ffi::GtkOverlayLayout, ffi::GtkOverlayLayoutClass>) @extends LayoutManager;
22
23 match fn {
24 type_ => || ffi::gtk_overlay_layout_get_type(),
25 }
26}
27
28impl OverlayLayout {
29 /// Creates a new [`OverlayLayout`][crate::OverlayLayout] instance.
30 ///
31 /// # Returns
32 ///
33 /// the newly created instance
34 #[doc(alias = "gtk_overlay_layout_new")]
35 pub fn new() -> OverlayLayout {
36 assert_initialized_main_thread!();
37 unsafe { LayoutManager::from_glib_full(ffi::gtk_overlay_layout_new()).unsafe_cast() }
38 }
39}
40
41impl Default for OverlayLayout {
42 fn default() -> Self {
43 Self::new()
44 }
45}