update tab title on loading indicator inactive

This commit is contained in:
yggverse 2024-10-11 18:43:30 +03:00
parent b1f30fbd1e
commit 4759ce4815
2 changed files with 11 additions and 5 deletions

View File

@ -159,13 +159,15 @@ impl Tab {
// Update item components
item.update();
// Update tab title
// 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())
};
}
}
}
}
pub fn clean(
&self,

View File

@ -89,7 +89,7 @@ impl Item {
self.page.update();
// Update tab loading indicator
self.widget.gobject().set_loading(self.page.is_loading());
self.widget.gobject().set_loading(self.page_is_loading());
}
pub fn clean(
@ -198,6 +198,10 @@ impl Item {
self.id.clone()
}
pub fn page_is_loading(&self) -> bool {
self.page.is_loading()
}
pub fn page_meta_title(&self) -> Option<GString> {
self.page.meta_title()
}