mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-05-26 08:29:10 +12:00
Qt: Serialize icon & theme, properly set them
This commit is contained in:
parent
95cc79e0a3
commit
6f90c25fd2
8 changed files with 128 additions and 26 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <utility>
|
||||
|
||||
#include "emulator.hpp"
|
||||
#include "frontend_settings.hpp"
|
||||
|
||||
class ConfigWindow : public QDialog {
|
||||
Q_OBJECT
|
||||
|
@ -23,21 +24,8 @@ class ConfigWindow : public QDialog {
|
|||
using ConfigCallback = std::function<void()>;
|
||||
using IconCallback = std::function<void(const QString&)>;
|
||||
|
||||
enum class Theme : int {
|
||||
System = 0,
|
||||
Light = 1,
|
||||
Dark = 2,
|
||||
GreetingsCat = 3,
|
||||
Cream = 4,
|
||||
};
|
||||
|
||||
enum class WindowIcon : int {
|
||||
Rpog = 0,
|
||||
Rsyn = 1,
|
||||
};
|
||||
|
||||
Theme currentTheme;
|
||||
WindowIcon currentIcon;
|
||||
using Theme = FrontendSettings::Theme;
|
||||
using WindowIcon = FrontendSettings::WindowIcon;
|
||||
|
||||
QTextEdit* helpText = nullptr;
|
||||
QListWidget* widgetList = nullptr;
|
||||
|
@ -54,8 +42,8 @@ class ConfigWindow : public QDialog {
|
|||
IconCallback updateIcon;
|
||||
|
||||
void addWidget(QWidget* widget, QString title, QString icon, QString helpText);
|
||||
void setTheme(Theme theme);
|
||||
void setIcon(WindowIcon icon);
|
||||
void setTheme(FrontendSettings::Theme theme);
|
||||
void setIcon(FrontendSettings::WindowIcon icon);
|
||||
|
||||
public:
|
||||
ConfigWindow(ConfigCallback configCallback, IconCallback iconCallback, const EmulatorConfig& config, QWidget* parent = nullptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue