move history to page open action, fix request activate action

This commit is contained in:
yggverse 2024-11-05 08:09:02 +02:00
parent da46928dfd
commit 78b7dd960b
3 changed files with 25 additions and 28 deletions

View file

@ -34,13 +34,14 @@ impl Navigation {
action_page_history_back: SimpleAction,
action_page_history_forward: SimpleAction,
action_page_reload: SimpleAction,
action_page_open: SimpleAction,
action_update: SimpleAction,
) -> Arc<Self> {
// Init components
let home = Home::new_arc(action_page_home);
let history = History::new_arc(action_page_history_back, action_page_history_forward);
let reload = Reload::new_arc(action_page_reload.clone());
let request = Request::new_arc(action_update.clone(), action_page_reload.clone());
let request = Request::new_arc(action_update.clone(), action_page_open.clone());
let bookmark = Bookmark::new_arc();
// Init widget

View file

@ -29,10 +29,7 @@ pub struct Widget {
impl Widget {
// Construct
pub fn new_arc(
action_update: SimpleAction,
action_page_reload: SimpleAction, // @TODO local `action_page_open`?
) -> Arc<Self> {
pub fn new_arc(action_update: SimpleAction, action_page_open: SimpleAction) -> Arc<Self> {
// Init animated progress bar state
let progress = Arc::new(Progress {
fraction: RefCell::new(0.0),
@ -50,8 +47,8 @@ impl Widget {
action_update.activate(Some(&"".to_variant())); // @TODO
});
gobject.connect_activate(move |_| {
action_page_reload.activate(None);
gobject.connect_activate(move |this| {
action_page_open.activate(Some(&this.text().to_variant()));
});
gobject.connect_state_flags_changed({