reorganize widget modules

This commit is contained in:
yggverse 2024-09-23 18:51:48 +03:00
parent b9b226cc54
commit 4903968309
47 changed files with 352 additions and 786 deletions

View file

@ -1,23 +1,31 @@
mod content;
mod navigation;
mod widget;
use gtk::prelude::BoxExt;
use gtk::{Box, Orientation};
pub struct Page {
widget: widget::Page,
widget: Box,
}
impl Page {
pub fn new() -> Page {
Self {
widget: widget::Page::new(
navigation::Navigation::new().widget().gtk(),
content::Content::new().widget().gtk(),
),
}
// Init components
let navigation = navigation::Navigation::new();
let content = content::Content::new();
// Init widget
let widget = Box::builder().orientation(Orientation::Vertical).build();
widget.append(navigation.widget());
widget.append(content.widget());
// Result
Self { widget }
}
// Getters
pub fn widget(&self) -> &widget::Page {
pub fn widget(&self) -> &Box {
&self.widget
}
}