diff options
| author | hachem <im@hachem.wtf> | 2026-06-19 06:21:52 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-06-19 06:21:52 +0200 |
| commit | fc848894de013e2980fb198b56e6aa6f68cbe209 (patch) | |
| tree | 92d2c735159daf84875bdac38896853f1c81f96c /src/ui | |
| parent | 63169e9aa97a66fc02eaeb5591f7f117c1876ecb (diff) | |
feat: migrate over to meson
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/ui.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp index 8bc27ac..fa9c77c 100644 --- a/src/ui/ui.cpp +++ b/src/ui/ui.cpp @@ -1337,14 +1337,9 @@ namespace Hsdbg ImGui::NewLine(); const char* current = m_preferences.theme.c_str(); - for (const auto& entry : m_themes) - { - if (entry.id == m_preferences.theme) - { - current = entry.name.c_str(); - break; - } - } + const auto named = std::ranges::find(m_themes, m_preferences.theme, &ThemeEntry::id); + if (named != m_themes.end()) + current = named->name.c_str(); if (ImGui::BeginCombo("Theme", current)) { @@ -2871,14 +2866,9 @@ namespace Hsdbg m_themes = list_themes(themes_directory()); std::filesystem::path path; - for (const auto& entry : m_themes) - { - if (entry.id == m_preferences.theme) - { - path = entry.path; - break; - } - } + const auto saved = std::ranges::find(m_themes, m_preferences.theme, &ThemeEntry::id); + if (saved != m_themes.end()) + path = saved->path; if (path.empty() && !m_themes.empty()) { path = m_themes.front().path; |
