libcosmic/examples/app_library/window/imp.rs

33 lines
883 B
Rust
Raw Normal View History

2022-01-19 16:00:02 -05:00
use crate::window_inner::AppLibraryWindowInner;
2022-01-14 17:53:11 -05:00
use gtk4::glib;
2021-12-30 16:54:35 -05:00
use gtk4::subclass::prelude::*;
use once_cell::sync::OnceCell;
// Object holding the state
#[derive(Default)]
2022-01-19 16:00:02 -05:00
2022-01-14 17:53:11 -05:00
pub struct AppLibraryWindow {
2022-01-19 16:00:02 -05:00
pub(super) inner: OnceCell<AppLibraryWindowInner>,
}
// The central trait for subclassing a GObject
#[glib::object_subclass]
2022-01-14 17:53:11 -05:00
impl ObjectSubclass for AppLibraryWindow {
// `NAME` needs to match `class` attribute of template
2022-01-14 17:53:11 -05:00
const NAME: &'static str = "AppLibraryWindow";
type Type = super::AppLibraryWindow;
2021-12-30 16:54:35 -05:00
type ParentType = gtk4::ApplicationWindow;
}
// Trait shared by all GObjects
2022-01-14 17:53:11 -05:00
impl ObjectImpl for AppLibraryWindow {}
// Trait shared by all widgets
2022-01-14 17:53:11 -05:00
impl WidgetImpl for AppLibraryWindow {}
// Trait shared by all windows
2022-01-19 16:00:02 -05:00
impl WindowImpl for AppLibraryWindow {}
// Trait shared by all application
2022-01-14 17:53:11 -05:00
impl ApplicationWindowImpl for AppLibraryWindow {}