separate modules to submodule components

This commit is contained in:
yggverse 2024-09-22 20:58:23 +03:00
parent 2c389abdfd
commit e45b7f0a4a
13 changed files with 167 additions and 71 deletions

View file

@ -1,22 +1,23 @@
mod menu;
mod tab;
mod widget;
use gtk::prelude::BoxExt;
use gtk::Box;
pub fn new() -> Box {
// Init components
let tab = tab::new();
// Init widget
let tray = Box::builder()
.orientation(gtk::Orientation::Horizontal)
.spacing(8)
.build();
// Compose childs
tray.append(&menu::new()); // @TODO
tray.append(tab.widget.as_ref());
tray // @TODO struct
pub struct Tray {
widget: widget::Tray,
}
impl Tray {
pub fn new() -> Tray {
Self {
widget: widget::Tray::new(
menu::Menu::new().widget().gtk(),
tab::Tab::new().widget().gtk(),
),
}
}
// Getters
pub fn widget(&self) -> &widget::Tray {
&self.widget
}
}