diff src/gui/dialog/settings/application.cc @ 279:657fda1b9cac

*: clean up enums
author Paper <paper@paper.us.eu.org>
date Fri, 19 Apr 2024 13:24:06 -0400
parents 862d0d8619f6
children b1f4d1867ab1
line wrap: on
line diff
--- a/src/gui/dialog/settings/application.cc	Thu Apr 18 17:24:42 2024 -0400
+++ b/src/gui/dialog/settings/application.cc	Fri Apr 19 13:24:06 2024 -0400
@@ -4,6 +4,7 @@
 #include "gui/locale.h"
 #include "gui/theme.h"
 #include "gui/translate/anime.h"
+#include "gui/translate/config.h"
 
 #include <QCheckBox>
 #include <QComboBox>
@@ -14,8 +15,6 @@
 #include <QSizePolicy>
 #include <QVBoxLayout>
 
-#include <algorithm>
-
 QWidget* SettingsPageApplication::CreateAnimeListWidget() {
 	QWidget* result = new QWidget(this);
 	result->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
@@ -197,12 +196,13 @@
 			}
 
 			{
+				/* FIXME: don't hardcode these values */
 				QComboBox* theme_combo_box = new QComboBox(appearance_group_box);
-				theme_combo_box->addItem(tr("Default"));
-				theme_combo_box->addItem(tr("Light"));
-				theme_combo_box->addItem(tr("Dark"));
+				for (const auto& theme : Theme::Themes)
+					theme_combo_box->addItem(Strings::ToQString(Translate::ToLocalString(theme)));
+
 				connect(theme_combo_box, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
-				        [this](int index) { theme = static_cast<Themes>(index); });
+				        [this](int index) { theme = static_cast<Theme::Theme>(index); });
 				theme_combo_box->setCurrentIndex(static_cast<int>(theme));
 				appearance_layout->addWidget(theme_combo_box);
 			}