mod subject; mod tray; mod widget; use subject::Subject; use tray::Tray; use widget::Widget; use adw::HeaderBar; use gtk::{gio::SimpleAction, glib::GString}; use std::sync::Arc; pub struct Header { subject: Arc, // tray: Arc, widget: Arc, } impl Header { // Construct pub fn new( action_tool_debug: Arc, action_tool_profile_directory: Arc, action_quit: Arc, action_tab_append: Arc, action_tab_close: Arc, action_tab_close_all: Arc, action_tab_page_navigation_base: Arc, action_tab_page_navigation_history_back: Arc, action_tab_page_navigation_history_forward: Arc, action_tab_page_navigation_reload: Arc, action_tab_pin: Arc, ) -> Self { // Init components let tray = Tray::new( action_tool_debug, action_tool_profile_directory, action_quit, action_tab_append, action_tab_close, action_tab_close_all, action_tab_page_navigation_base, action_tab_page_navigation_history_back, action_tab_page_navigation_history_forward, action_tab_page_navigation_reload, action_tab_pin, ); let subject = Arc::new(Subject::new()); // Init widget let widget = Arc::new(Widget::new(tray.gobject(), Some(subject.gobject()))); // Return new struct Self { subject, widget } } // Actions pub fn update(&self, title: Option, description: Option) { self.subject.update(title, description); } // Getters pub fn gobject(&self) -> &HeaderBar { &self.widget.gobject() } }