add new tab item action group, delegate history handle to action implementation

This commit is contained in:
yggverse 2025-01-25 17:28:05 +02:00
parent 5145a53bfa
commit 913030a955
29 changed files with 409 additions and 232 deletions

View file

@ -1,6 +1,8 @@
mod history;
mod ident;
mod load;
use history::History;
use ident::Ident;
use load::Load;
@ -8,6 +10,7 @@ use std::rc::Rc;
/// [SimpleActionGroup](https://docs.gtk.org/gio/class.SimpleActionGroup.html) wrapper for `Browser` actions
pub struct Action {
pub history: Rc<History>,
pub ident: Rc<Ident>,
pub load: Rc<Load>,
}
@ -23,9 +26,18 @@ impl Action {
/// Create new `Self`
pub fn new() -> Self {
let ident = Rc::new(Ident::new());
let load = Rc::new(Load::new());
let history = Rc::new(History::build({
let load = load.clone();
move |request| load.activate(Some(&request), false)
}));
Self {
ident: Rc::new(Ident::new()),
load: Rc::new(Load::new()),
history,
ident,
load,
}
}
}