mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
separate modules to submodule components
This commit is contained in:
parent
2c389abdfd
commit
e45b7f0a4a
13 changed files with 167 additions and 71 deletions
|
|
@ -1,27 +1,27 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use gtk::prelude::{ButtonExt, WidgetExt};
|
||||
use gtk::Button;
|
||||
mod widget;
|
||||
|
||||
pub struct Tab {
|
||||
pub widget: Arc<gtk::Button>,
|
||||
pub widget: widget::Tab,
|
||||
}
|
||||
|
||||
pub fn new() -> Tab {
|
||||
// Init widget
|
||||
let widget = Arc::new(
|
||||
Button::builder()
|
||||
.icon_name("tab-new-symbolic")
|
||||
.tooltip_text("New tab")
|
||||
.build(),
|
||||
);
|
||||
impl Tab {
|
||||
pub fn new() -> Tab {
|
||||
// Init widget
|
||||
let widget = widget::Tab::new();
|
||||
|
||||
// Init events
|
||||
widget.connect_clicked(|this| {
|
||||
this.activate_action("win.tab_append", None)
|
||||
.expect("The action does not exist");
|
||||
});
|
||||
// Init events
|
||||
/* @TODO
|
||||
widget.connect_clicked(|this| {
|
||||
this.activate_action("win.tab_append", None)
|
||||
.expect("The action does not exist");
|
||||
}); */
|
||||
|
||||
// Result
|
||||
Tab { widget }
|
||||
// Result
|
||||
Self { widget }
|
||||
}
|
||||
|
||||
// Getters
|
||||
pub fn widget(&self) -> &widget::Tab {
|
||||
&self.widget
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue