reorganize reload action, add middle click handler

This commit is contained in:
yggverse 2025-01-26 13:28:20 +02:00
parent 3ee6a03c30
commit 8b4d184ad7
5 changed files with 80 additions and 20 deletions

View file

@ -8,7 +8,7 @@ mod widget;
use super::{BrowserAction, ItemAction, Profile, TabAction, WindowAction};
use bookmark::Bookmark;
use gtk::{prelude::WidgetExt, Box, Button};
use gtk::{Box, Button};
use history::History;
use home::Home;
use reload::Reload;
@ -39,8 +39,8 @@ impl Navigation {
// init children components
let history = Box::history((window_action, tab_action, item_action));
let reload = Button::reload(window_action);
let request = Rc::new(Request::build((browser_action, item_action)));
let reload = Button::reload((window_action, tab_action, item_action), &request);
let home = Button::home((window_action, tab_action, item_action), &request);
let bookmark = Button::bookmark(window_action);
@ -73,13 +73,8 @@ impl Navigation {
// update children components
self.bookmark
.update(self.profile.bookmark.get(&request).is_ok());
self.reload.set_sensitive(!request.is_empty());
self.request.update(
self.profile
.identity
.get(&self.request.strip_prefix())
.is_some(),
);
self.request
.update(self.profile.identity.get(&request).is_some());
}
pub fn clean(