mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
apply escape action to the current page only
This commit is contained in:
parent
04a34c91ca
commit
3fda9c851a
5 changed files with 75 additions and 14 deletions
|
|
@ -176,10 +176,19 @@ impl Tab {
|
|||
self.widget.close_all();
|
||||
}
|
||||
|
||||
// Toggle search widget
|
||||
pub fn escape(&self, page_position: Option<i32>) {
|
||||
if let Some(item) = self.item(page_position) {
|
||||
item.page.escape();
|
||||
// Toggle escape action for specified or current item
|
||||
pub fn escape(&self, item_id: Option<GString>) {
|
||||
match item_id {
|
||||
Some(id) => {
|
||||
if let Some(item) = self.index.borrow().get(&id) {
|
||||
item.page.escape()
|
||||
}
|
||||
}
|
||||
None => {
|
||||
if let Some(item) = self.item(None) {
|
||||
item.page.escape();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -176,7 +176,9 @@ impl Page {
|
|||
const DEFAULT_MAX_REDIRECT_COUNT: usize = 10;
|
||||
|
||||
// Move focus out from navigation entry
|
||||
self.browser_action.escape.activate();
|
||||
self.browser_action
|
||||
.escape
|
||||
.activate_stateful_once(Some(self.id.as_str().into()));
|
||||
|
||||
// Initially disable find action
|
||||
self.window_action.find.simple_action.set_enabled(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue