mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
add new tab item action group, delegate history handle to action implementation
This commit is contained in:
parent
5145a53bfa
commit
913030a955
29 changed files with 409 additions and 232 deletions
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue