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,27 +1,28 @@
mod tab;
mod widget;
use std::sync::Arc;
use gtk::{Box, Orientation};
use tab::Tab;
use gtk::prelude::BoxExt;
pub struct Main {
// Components
tab: Arc<tab::Tab>,
// Extras
widget: widget::Main,
tab: Tab,
widget: Box,
}
impl Main {
// Construct
pub fn new() -> Arc<Main> {
pub fn new() -> Main {
// Init components
let tab = tab::Tab::new();
let tab = Tab::new();
// Extras
let widget = widget::Main::new(tab.widget().notebook());
let widget = Box::builder().orientation(Orientation::Vertical).build();
widget.append(tab.widget());
// Init struct
Arc::new(Self { tab, widget })
Self { tab, widget }
}
// Actions
@ -42,7 +43,7 @@ impl Main {
}
// Getters
pub fn widget(&self) -> &widget::Main {
pub fn widget(&self) -> &Box {
&self.widget
}
}