aboutsummaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-09-06 06:21:52 +0200
committerhachem <im@hachem.wtf>2026-09-06 06:21:52 +0200
commit392c49d61fec199605c9cff6e1e2975660e1b846 (patch)
treeab77f5deee5aa993b9bc9224904845af3107203c /src/ui
parent9a3a74070be2de9cd58f778e7a6d1df05cb60474 (diff)
feat: migrate over to meson
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/ui.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp
index 9a851a3..78d585d 100644
--- a/src/ui/ui.cpp
+++ b/src/ui/ui.cpp
@@ -1409,14 +1409,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))
{
@@ -2992,14 +2987,9 @@ namespace Hsdbg
// resolve the saved id to a file; fall back to the first theme found,
// then to the baked-in default, so the ui is never left unstyled
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;