mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
define browser entities as structs
This commit is contained in:
parent
3fbfe6a7e0
commit
c0ebe95eb8
4 changed files with 84 additions and 40 deletions
|
|
@ -1,14 +1,34 @@
|
|||
mod tab;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use gtk::prelude::BoxExt;
|
||||
use gtk::Box;
|
||||
|
||||
pub fn new() -> Box {
|
||||
let main = Box::builder()
|
||||
.orientation(gtk::Orientation::Vertical)
|
||||
.build();
|
||||
|
||||
main.append(&tab::new());
|
||||
|
||||
main
|
||||
pub struct Main {
|
||||
pub widget: Arc<gtk::Box>,
|
||||
pub tab: Arc<tab::Tab>,
|
||||
}
|
||||
|
||||
impl Main {
|
||||
pub fn tab_append(&self) {
|
||||
self.tab.append(true);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new() -> Main {
|
||||
// Init components
|
||||
let tab = Arc::new(tab::new());
|
||||
|
||||
// Init widget
|
||||
let widget = Arc::new(
|
||||
Box::builder()
|
||||
.orientation(gtk::Orientation::Vertical)
|
||||
.build(),
|
||||
);
|
||||
|
||||
widget.append(tab.widget.as_ref());
|
||||
|
||||
// Init struct
|
||||
Main { widget, tab }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue