mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-10 10:24:13 +00:00
enshort construction
This commit is contained in:
parent
4877e24020
commit
48541da91d
@ -1,5 +1,3 @@
|
|||||||
use gtk::prelude::{ButtonExt, WidgetExt};
|
|
||||||
|
|
||||||
pub struct Tab {
|
pub struct Tab {
|
||||||
gtk: gtk::Button,
|
gtk: gtk::Button,
|
||||||
}
|
}
|
||||||
@ -7,19 +5,13 @@ pub struct Tab {
|
|||||||
impl Tab {
|
impl Tab {
|
||||||
// Construct
|
// Construct
|
||||||
pub fn new() -> Tab {
|
pub fn new() -> Tab {
|
||||||
// Init widget
|
Self {
|
||||||
let gtk = gtk::Button::builder()
|
gtk: gtk::Button::builder()
|
||||||
.icon_name("tab-new-symbolic")
|
.action_name("win.tab_append")
|
||||||
.tooltip_text("New tab")
|
.icon_name("tab-new-symbolic")
|
||||||
.build();
|
.tooltip_text("New tab")
|
||||||
|
.build(),
|
||||||
// Init events
|
}
|
||||||
gtk.connect_clicked(|this| {
|
|
||||||
this.activate_action("win.tab_append", None)
|
|
||||||
.expect("The action does not exist");
|
|
||||||
});
|
|
||||||
|
|
||||||
Self { gtk }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
|
Loading…
x
Reference in New Issue
Block a user