mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-10 10:24:13 +00:00
use arc for tab
This commit is contained in:
parent
54ce146d90
commit
2a1e788f8d
@ -4,8 +4,11 @@ mod widget;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct Main {
|
||||
// Components
|
||||
tab: Arc<tab::Tab>,
|
||||
|
||||
// Extras
|
||||
widget: widget::Main,
|
||||
tab: tab::Tab,
|
||||
}
|
||||
|
||||
impl Main {
|
||||
@ -14,11 +17,11 @@ impl Main {
|
||||
// Init components
|
||||
let tab = tab::Tab::new();
|
||||
|
||||
// Extras
|
||||
let widget = widget::Main::new(tab.widget().tab());
|
||||
|
||||
// Init struct
|
||||
Arc::new(Self {
|
||||
widget: widget::Main::new(tab.widget().tab()), // @TODO
|
||||
tab,
|
||||
})
|
||||
Arc::new(Self { tab, widget })
|
||||
}
|
||||
|
||||
// Actions
|
||||
|
@ -2,16 +2,18 @@ mod label;
|
||||
mod page;
|
||||
mod widget;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct Tab {
|
||||
widget: widget::Tab,
|
||||
}
|
||||
|
||||
impl Tab {
|
||||
// Construct
|
||||
pub fn new() -> Tab {
|
||||
Self {
|
||||
pub fn new() -> Arc<Tab> {
|
||||
Arc::new(Self {
|
||||
widget: widget::Tab::new(),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Actions
|
||||
|
Loading…
x
Reference in New Issue
Block a user