mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
use arc for tab
This commit is contained in:
parent
54ce146d90
commit
2a1e788f8d
2 changed files with 13 additions and 8 deletions
|
|
@ -4,8 +4,11 @@ mod widget;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
pub struct Main {
|
pub struct Main {
|
||||||
|
// Components
|
||||||
|
tab: Arc<tab::Tab>,
|
||||||
|
|
||||||
|
// Extras
|
||||||
widget: widget::Main,
|
widget: widget::Main,
|
||||||
tab: tab::Tab,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Main {
|
impl Main {
|
||||||
|
|
@ -14,11 +17,11 @@ impl Main {
|
||||||
// Init components
|
// Init components
|
||||||
let tab = tab::Tab::new();
|
let tab = tab::Tab::new();
|
||||||
|
|
||||||
|
// Extras
|
||||||
|
let widget = widget::Main::new(tab.widget().tab());
|
||||||
|
|
||||||
// Init struct
|
// Init struct
|
||||||
Arc::new(Self {
|
Arc::new(Self { tab, widget })
|
||||||
widget: widget::Main::new(tab.widget().tab()), // @TODO
|
|
||||||
tab,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,18 @@ mod label;
|
||||||
mod page;
|
mod page;
|
||||||
mod widget;
|
mod widget;
|
||||||
|
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
pub struct Tab {
|
pub struct Tab {
|
||||||
widget: widget::Tab,
|
widget: widget::Tab,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Tab {
|
impl Tab {
|
||||||
// Construct
|
// Construct
|
||||||
pub fn new() -> Tab {
|
pub fn new() -> Arc<Tab> {
|
||||||
Self {
|
Arc::new(Self {
|
||||||
widget: widget::Tab::new(),
|
widget: widget::Tab::new(),
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue