mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-10 20:51:45 +00:00
implement tab title update
This commit is contained in:
parent
06cfd72c62
commit
0c2658825e
@ -155,7 +155,16 @@ impl Tab {
|
|||||||
pub fn update(&self) {
|
pub fn update(&self) {
|
||||||
if let Some(id) = self.widget.current_page_keyword() {
|
if let Some(id) = self.widget.current_page_keyword() {
|
||||||
if let Some(item) = self.index.borrow().get(&id) {
|
if let Some(item) = self.index.borrow().get(&id) {
|
||||||
|
// Update item components
|
||||||
item.update();
|
item.update();
|
||||||
|
|
||||||
|
// Update tab title
|
||||||
|
let title = match item.page_meta_title() {
|
||||||
|
Some(value) => value,
|
||||||
|
None => GString::new(),
|
||||||
|
};
|
||||||
|
|
||||||
|
item.gobject().set_title(title.as_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,6 +187,10 @@ impl Item {
|
|||||||
self.id.clone()
|
self.id.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn page_meta_title(&self) -> Option<GString> {
|
||||||
|
self.page.meta_title()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn gobject(&self) -> &TabPage {
|
pub fn gobject(&self) -> &TabPage {
|
||||||
&self.widget.gobject()
|
&self.widget.gobject()
|
||||||
}
|
}
|
||||||
|
@ -463,6 +463,10 @@ impl Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
|
pub fn meta_title(&self) -> Option<GString> {
|
||||||
|
self.meta.borrow().title.clone()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn gobject(&self) -> &Box {
|
pub fn gobject(&self) -> &Box {
|
||||||
&self.widget.gobject()
|
&self.widget.gobject()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user