From 48541da91ddbdb74098861c81d7baed5167f7423 Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 23 Sep 2024 00:53:48 +0300 Subject: [PATCH] enshort construction --- src/browser/header/tray/tab/widget.rs | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/browser/header/tray/tab/widget.rs b/src/browser/header/tray/tab/widget.rs index 0c254014..77eb4a23 100644 --- a/src/browser/header/tray/tab/widget.rs +++ b/src/browser/header/tray/tab/widget.rs @@ -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