mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
reorganize widget modules
This commit is contained in:
parent
b9b226cc54
commit
4903968309
47 changed files with 352 additions and 786 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue