mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-05 07:54:14 +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 {
|
||||
gtk: gtk::Button,
|
||||
}
|
||||
@ -7,19 +5,13 @@ pub struct Tab {
|
||||
impl Tab {
|
||||
// Construct
|
||||
pub fn new() -> Tab {
|
||||
// Init widget
|
||||
let gtk = gtk::Button::builder()
|
||||
.icon_name("tab-new-symbolic")
|
||||
.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 }
|
||||
Self {
|
||||
gtk: gtk::Button::builder()
|
||||
.action_name("win.tab_append")
|
||||
.icon_name("tab-new-symbolic")
|
||||
.tooltip_text("New tab")
|
||||
.build(),
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
Loading…
x
Reference in New Issue
Block a user