mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
implement shared state change method for all group members
This commit is contained in:
parent
5883593c39
commit
d93c93a8c0
2 changed files with 19 additions and 15 deletions
|
|
@ -60,7 +60,7 @@ impl Tab {
|
|||
// as it will be updated on the next init for new tab selected
|
||||
tab_page.map(|tab_page| {
|
||||
index.borrow().get(tab_page).map(|item| {
|
||||
// Update actions status
|
||||
// Update enabled status (for some actions)
|
||||
action
|
||||
.history_back
|
||||
.simple_action
|
||||
|
|
@ -78,20 +78,8 @@ impl Tab {
|
|||
.simple_action
|
||||
.set_enabled(item.action.reload.is_enabled());
|
||||
|
||||
// Update actions target
|
||||
let state = Some(tab_view.page_position(tab_page));
|
||||
|
||||
action.bookmark.change_state(state);
|
||||
action.close_all.change_state(state);
|
||||
action.close.change_state(state);
|
||||
action.find.change_state(state);
|
||||
action.history_back.change_state(state);
|
||||
action.history_forward.change_state(state);
|
||||
action.home.change_state(state);
|
||||
action.pin.change_state(state);
|
||||
action.reload.change_state(state);
|
||||
action.save_as.change_state(state);
|
||||
action.source.change_state(state);
|
||||
// Update target (for all actions)
|
||||
action.change_state(Some(tab_view.page_position(tab_page)));
|
||||
})
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue