Browse Source

enshort construction

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

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

@ -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…
Cancel
Save