Yoda/src/browser/main/mod.rs

35 lines
557 B
Rust
Raw Normal View History

2024-09-20 18:02:10 +03:00
mod tab;
2024-09-18 22:07:52 +03:00
2024-09-22 02:00:54 +03:00
use std::sync::Arc;
2024-09-18 22:07:52 +03:00
use gtk::prelude::BoxExt;
2024-09-20 18:02:10 +03:00
use gtk::Box;
2024-09-18 20:33:29 +03:00
2024-09-22 02:00:54 +03:00
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(),
);
2024-09-18 22:07:52 +03:00
2024-09-22 02:00:54 +03:00
widget.append(tab.widget.as_ref());
2024-09-18 22:07:52 +03:00
2024-09-22 02:00:54 +03:00
// Init struct
Main { widget, tab }
2024-09-20 18:02:10 +03:00
}