mirror of https://github.com/YGGverse/Yoda.git
yggverse
2 months ago
3 changed files with 44 additions and 24 deletions
@ -1,34 +1,31 @@
@@ -1,34 +1,31 @@
|
||||
mod tab; |
||||
|
||||
use std::sync::Arc; |
||||
|
||||
use gtk::prelude::BoxExt; |
||||
use gtk::Box; |
||||
mod widget; |
||||
|
||||
pub struct Main { |
||||
pub widget: Arc<gtk::Box>, |
||||
pub tab: Arc<tab::Tab>, |
||||
widget: widget::Main, |
||||
tab: tab::Tab, |
||||
} |
||||
|
||||
impl Main { |
||||
pub fn tab_append(&self) { |
||||
self.tab.append(true); |
||||
} |
||||
} |
||||
|
||||
pub fn new() -> Main { |
||||
// Construct
|
||||
pub fn new() -> Main { |
||||
// Init components
|
||||
let tab = Arc::new(tab::new()); |
||||
let tab = tab::new(); |
||||
|
||||
// Init widget
|
||||
let widget = Arc::new( |
||||
Box::builder() |
||||
.orientation(gtk::Orientation::Vertical) |
||||
.build(), |
||||
); |
||||
// Init struct
|
||||
Self { |
||||
widget: widget::Main::new(tab.widget.as_ref()), // @TODO
|
||||
tab, |
||||
} |
||||
} |
||||
|
||||
widget.append(tab.widget.as_ref()); |
||||
// Actions
|
||||
pub fn tab_append(&self) { |
||||
self.tab.append(true); |
||||
} |
||||
|
||||
// Init struct
|
||||
Main { widget, tab } |
||||
// Getters
|
||||
pub fn widget(&self) -> &widget::Main { |
||||
&self.widget |
||||
} |
||||
} |
||||
|
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
use gtk::prelude::BoxExt; |
||||
|
||||
pub struct Main { |
||||
gtk: gtk::Box, |
||||
} |
||||
|
||||
impl Main { |
||||
// Construct
|
||||
pub fn new(tab: >k::Notebook) -> Main { |
||||
let gtk = gtk::Box::builder() |
||||
.orientation(gtk::Orientation::Vertical) |
||||
.build(); |
||||
|
||||
gtk.append(tab); |
||||
|
||||
Self { gtk } |
||||
} |
||||
|
||||
// Getters
|
||||
pub fn gtk(&self) -> >k::Box { |
||||
&self.gtk |
||||
} |
||||
} |
Loading…
Reference in new issue