aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp6
-rw-r--r--src/Tabs.cpp4
2 files changed, 9 insertions, 1 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 8d4dffb..eb82a54 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -1726,6 +1726,12 @@ namespace QuickMedia {
}
}
+ for(size_t i = 0; i < tabs.size(); ++i) {
+ Tab &tab = tabs[i];
+ if(tab.page)
+ ui_tabs.set_text(i, tab.page->get_title());
+ }
+
window.clear(back_color);
page_loop_render(window, tabs, selected_tab, tab_associated_data[selected_tab], json_chapters, ui_tabs);
window.display();
diff --git a/src/Tabs.cpp b/src/Tabs.cpp
index 4437472..01e5d2d 100644
--- a/src/Tabs.cpp
+++ b/src/Tabs.cpp
@@ -30,6 +30,7 @@ namespace QuickMedia {
int Tabs::add_tab(const std::string &title) {
tab_texts.push_back(sf::Text(title, *FontLoader::get_font(FontLoader::FontType::LATIN), tab_text_size));
+ tab_labels_utf8.push_back(title);
return tab_texts.size() - 1;
}
@@ -180,8 +181,9 @@ namespace QuickMedia {
}
void Tabs::set_text(int index, const std::string &text) {
- if(index < 0 || index >= (int)tab_texts.size()) return;
+ if(index < 0 || index >= (int)tab_texts.size() || text == tab_labels_utf8[index]) return;
tab_texts[index].setString(sf::String::fromUtf8(text.begin(), text.end()));
+ tab_labels_utf8[index] = text;
}
void Tabs::set_selected(int index) {