mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +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
|
|
@ -59,6 +59,7 @@ impl Item {
|
|||
let action = Rc::new(Action::new());
|
||||
|
||||
tab_action.simple_action_group.add_action(&action.home);
|
||||
tab_action.simple_action_group.add_action(&action.reload);
|
||||
|
||||
tab_action
|
||||
.simple_action_group
|
||||
|
|
@ -133,6 +134,14 @@ impl Item {
|
|||
}
|
||||
});
|
||||
|
||||
action.reload.connect_activate({
|
||||
let page = page.clone();
|
||||
let client = client.clone();
|
||||
move |_, _| {
|
||||
client.handle(&page.navigation.request.widget.entry.text(), false);
|
||||
}
|
||||
});
|
||||
|
||||
// Handle immediately on request
|
||||
if let Some(text) = request {
|
||||
page.navigation.request.widget.entry.set_text(text);
|
||||
|
|
@ -159,6 +168,10 @@ impl Item {
|
|||
home.to_string() != self.page.navigation.request.widget.entry.text()
|
||||
}));
|
||||
|
||||
self.action
|
||||
.reload
|
||||
.set_enabled(!self.page.navigation.request.widget.entry.text().is_empty());
|
||||
|
||||
// Update child components
|
||||
self.page.update();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue