mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
create separated wrapper for reload action
This commit is contained in:
parent
baea14de95
commit
b4dee17768
16 changed files with 144 additions and 64 deletions
|
|
@ -30,7 +30,6 @@ pub struct Tab {
|
|||
action_page_home: SimpleAction,
|
||||
action_page_history_back: SimpleAction,
|
||||
action_page_history_forward: SimpleAction,
|
||||
action_page_reload: SimpleAction,
|
||||
// Dynamically allocated reference index
|
||||
index: Rc<RefCell<HashMap<GString, Rc<Item>>>>,
|
||||
action: Rc<Action>,
|
||||
|
|
@ -47,7 +46,6 @@ impl Tab {
|
|||
action_page_home: SimpleAction,
|
||||
action_page_history_back: SimpleAction,
|
||||
action_page_history_forward: SimpleAction,
|
||||
action_page_reload: SimpleAction,
|
||||
) -> Rc<Self> {
|
||||
// Init local actions
|
||||
let action = Rc::new(Action::new());
|
||||
|
|
@ -63,7 +61,6 @@ impl Tab {
|
|||
action_page_history_back.clone(),
|
||||
action_page_history_forward.clone(),
|
||||
action_page_home.clone(),
|
||||
action_page_reload.clone(),
|
||||
);
|
||||
|
||||
// Init widget
|
||||
|
|
@ -82,7 +79,6 @@ impl Tab {
|
|||
let action_page_home = action_page_home.clone();
|
||||
let action_page_history_back = action_page_history_back.clone();
|
||||
let action_page_history_forward = action_page_history_forward.clone();
|
||||
let action_page_reload = action_page_reload.clone();
|
||||
|
||||
move |request| {
|
||||
// Init new tab item
|
||||
|
|
@ -96,7 +92,6 @@ impl Tab {
|
|||
action_page_home.clone(),
|
||||
action_page_history_back.clone(),
|
||||
action_page_history_forward.clone(),
|
||||
action_page_reload.clone(),
|
||||
// Options
|
||||
gobject
|
||||
.selected_page()
|
||||
|
|
@ -123,7 +118,6 @@ impl Tab {
|
|||
let action_page_history_forward = action_page_history_forward.clone();
|
||||
let action_page_home = action_page_home.clone();
|
||||
let window_action = window_action.clone();
|
||||
let action_page_reload = action_page_reload.clone();
|
||||
move |tab_view, tab_page| {
|
||||
// Update actions
|
||||
let state_v2 = match tab_page {
|
||||
|
|
@ -133,6 +127,7 @@ impl Tab {
|
|||
None => None,
|
||||
}; // @TODO
|
||||
window_action.pin().change_state(state_v2);
|
||||
window_action.reload().change_state(state_v2);
|
||||
|
||||
// @TODO old version requires update
|
||||
// Setup state for selected page
|
||||
|
|
@ -147,7 +142,6 @@ impl Tab {
|
|||
action_page_history_back.change_state(&state);
|
||||
action_page_history_forward.change_state(&state);
|
||||
action_page_home.change_state(&state);
|
||||
action_page_reload.change_state(&state);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -191,7 +185,6 @@ impl Tab {
|
|||
action_page_home,
|
||||
action_page_history_back,
|
||||
action_page_history_forward,
|
||||
action_page_reload,
|
||||
// Init empty HashMap index as no tabs appended yet
|
||||
index,
|
||||
action,
|
||||
|
|
@ -212,7 +205,6 @@ impl Tab {
|
|||
self.action_page_home.clone(),
|
||||
self.action_page_history_back.clone(),
|
||||
self.action_page_history_forward.clone(),
|
||||
self.action_page_reload.clone(),
|
||||
// Options
|
||||
position,
|
||||
false,
|
||||
|
|
@ -356,7 +348,6 @@ impl Tab {
|
|||
self.action_page_home.clone(),
|
||||
self.action_page_history_back.clone(),
|
||||
self.action_page_history_forward.clone(),
|
||||
self.action_page_reload.clone(),
|
||||
) {
|
||||
Ok(items) => {
|
||||
for item in items {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue