aboutsummaryrefslogtreecommitdiff
path: root/src/Tabs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Tabs.cpp')
-rw-r--r--src/Tabs.cpp4
1 files changed, 3 insertions, 1 deletions
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) {