mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue