reorganize home action, add middle click handler

This commit is contained in:
yggverse 2025-01-26 13:07:20 +02:00
parent 418b04c86c
commit 3ee6a03c30
5 changed files with 93 additions and 30 deletions

View file

@ -1,8 +1,11 @@
mod history;
mod home;
mod ident;
mod load;
use gtk::gio::SimpleAction;
use history::History;
use home::Home;
use ident::Ident;
use load::Load;
@ -11,6 +14,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 home: SimpleAction,
pub ident: Rc<Ident>,
pub load: Rc<Load>,
}
@ -28,6 +32,7 @@ impl Action {
pub fn new() -> Self {
let ident = Rc::new(Ident::new());
let load = Rc::new(Load::new());
let home = SimpleAction::home();
let history = Rc::new(History::build({
let load = load.clone();
@ -36,6 +41,7 @@ impl Action {
Self {
history,
home,
ident,
load,
}