mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
separate modules to submodule components
This commit is contained in:
parent
2c389abdfd
commit
e45b7f0a4a
13 changed files with 167 additions and 71 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue