Browse Source

enshort construction

master
yggverse 2 months ago
parent
commit
48541da91d
  1. 18
      src/browser/header/tray/tab/widget.rs

18
src/browser/header/tray/tab/widget.rs

@ -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

Loading…
Cancel
Save