mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
make update action by item id
This commit is contained in:
parent
c92a5406f5
commit
6c4137f2b6
7 changed files with 48 additions and 41 deletions
|
|
@ -26,7 +26,7 @@ pub struct Tab {
|
|||
action_tab_page_navigation_reload: Arc<SimpleAction>,
|
||||
action_update: Arc<SimpleAction>,
|
||||
// Dynamically allocated reference index
|
||||
index: Arc<RefCell<HashMap<Arc<GString>, Arc<Item>>>>,
|
||||
index: Arc<RefCell<HashMap<GString, Arc<Item>>>>,
|
||||
// GTK
|
||||
widget: Arc<Widget>,
|
||||
}
|
||||
|
|
@ -208,18 +208,16 @@ impl Tab {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn update(&self) {
|
||||
if let Some(id) = self.widget.current_page_keyword() {
|
||||
if let Some(item) = self.index.borrow().get(&id) {
|
||||
// Update item components
|
||||
item.update();
|
||||
pub fn update(&self, id: &str) {
|
||||
if let Some(item) = self.index.borrow().get(id) {
|
||||
// Update item components
|
||||
item.update();
|
||||
|
||||
// Update tab title on loading indicator inactive
|
||||
if !item.page_is_loading() {
|
||||
if let Some(title) = item.page_meta_title() {
|
||||
item.gobject().set_title(title.as_str())
|
||||
};
|
||||
}
|
||||
// Update tab title on loading indicator inactive
|
||||
if !item.page_is_loading() {
|
||||
if let Some(title) = item.page_meta_title() {
|
||||
item.gobject().set_title(title.as_str())
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue