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,33 @@
mod menu;
mod tab;
mod widget;
use gtk::prelude::BoxExt;
use gtk::{Box, Orientation};
use menu::Menu;
use tab::Tab;
pub struct Tray {
widget: widget::Tray,
widget: Box,
}
impl Tray {
pub fn new() -> Tray {
Self {
widget: widget::Tray::new(
menu::Menu::new().widget().gtk(),
tab::Tab::new().widget().gtk(),
),
}
let menu = Menu::new();
let tab = Tab::new();
let widget = Box::builder()
.orientation(Orientation::Horizontal)
.spacing(8)
.build();
widget.append(menu.widget());
widget.append(tab.widget());
Self { widget }
}
// Getters
pub fn widget(&self) -> &widget::Tray {
pub fn widget(&self) -> &Box {
&self.widget
}
}