|
|
|
@ -1,5 +1,3 @@
@@ -1,5 +1,3 @@
|
|
|
|
|
use gtk::prelude::{ButtonExt, WidgetExt}; |
|
|
|
|
|
|
|
|
|
pub struct Tab { |
|
|
|
|
gtk: gtk::Button, |
|
|
|
|
} |
|
|
|
@ -7,19 +5,13 @@ pub struct Tab {
@@ -7,19 +5,13 @@ pub struct Tab {
|
|
|
|
|
impl Tab { |
|
|
|
|
// Construct
|
|
|
|
|
pub fn new() -> Tab { |
|
|
|
|
// Init widget
|
|
|
|
|
let gtk = gtk::Button::builder() |
|
|
|
|
Self { |
|
|
|
|
gtk: gtk::Button::builder() |
|
|
|
|
.action_name("win.tab_append") |
|
|
|
|
.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 } |
|
|
|
|
.build(), |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Getters
|
|
|
|
|