create separated wrappers for history, close action group

This commit is contained in:
yggverse 2024-11-10 11:53:43 +02:00
parent 4afa2c204c
commit 8113022cd4
22 changed files with 557 additions and 335 deletions

View file

@ -11,7 +11,7 @@ use widget::Widget;
use crate::app::browser::action::Action as BrowserAction;
use crate::app::browser::window::action::Action as WindowAction;
use adw::TabView;
use gtk::{gio::SimpleAction, Box};
use gtk::Box;
use std::rc::Rc;
pub struct Bar {
@ -23,23 +23,12 @@ impl Bar {
pub fn new_rc(
browser_action: Rc<BrowserAction>,
window_action: Rc<WindowAction>,
action_page_close: SimpleAction,
action_page_close_all: SimpleAction,
action_page_history_back: SimpleAction,
action_page_history_forward: SimpleAction,
view: &TabView,
) -> Rc<Self> {
// Init components
let control = Control::new_rc();
let tab = Tab::new_rc(window_action.clone(), view);
let menu = Menu::new_rc(
browser_action,
window_action,
action_page_close,
action_page_close_all,
action_page_history_back,
action_page_history_forward,
);
let menu = Menu::new_rc(browser_action, window_action);
// Build result
Rc::new(Self {