mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
reorganize reload action, add middle click handler
This commit is contained in:
parent
3ee6a03c30
commit
8b4d184ad7
5 changed files with 80 additions and 20 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue