mod menu; mod tab; use menu::Menu; use tab::Tab; use gtk::{ gio::SimpleAction, prelude::BoxExt, {Box, Orientation}, }; use std::sync::Arc; pub struct Tray { widget: Box, } impl Tray { pub fn new( action_debug: Arc, action_quit: Arc, action_tab_append: Arc, action_tab_close: Arc, action_tab_close_all: Arc, action_tab_page_navigation_reload: Arc, action_tab_pin: Arc, ) -> Self { // Init components let tab = Tab::new(action_tab_append.clone()); let menu = Menu::new( action_debug, action_quit, action_tab_append, action_tab_close, action_tab_close_all, action_tab_page_navigation_reload, action_tab_pin, ); // Init widget let widget = Box::builder() .orientation(Orientation::Horizontal) .spacing(8) .build(); widget.append(menu.widget()); widget.append(tab.widget()); // Return new struct Self { widget } } // Getters pub fn widget(&self) -> &Box { &self.widget } }