mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-21 04:49:14 +12:00
Add infrastructure for Qt settings window
This commit is contained in:
parent
d010d95e18
commit
ba049fc1c7
4 changed files with 34 additions and 3 deletions
|
@ -1,16 +1,23 @@
|
|||
#pragma once
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QDialog>
|
||||
#include <QPalette>
|
||||
#include <QWidget>
|
||||
#include <QtWidgets>
|
||||
#include <functional>
|
||||
#include <utility>
|
||||
|
||||
#include "config.hpp"
|
||||
|
||||
class ConfigWindow : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
using ConfigCallback = std::function<void()>;
|
||||
|
||||
enum class Theme : int {
|
||||
System = 0,
|
||||
Light = 1,
|
||||
|
@ -21,9 +28,15 @@ class ConfigWindow : public QDialog {
|
|||
Theme currentTheme;
|
||||
QComboBox* themeSelect = nullptr;
|
||||
|
||||
// The config class holds a copy of the emulator config which it edits and sends
|
||||
// over to the emulator
|
||||
EmulatorConfig config;
|
||||
ConfigCallback updateConfig;
|
||||
void setTheme(Theme theme);
|
||||
|
||||
public:
|
||||
ConfigWindow(QWidget* parent = nullptr);
|
||||
ConfigWindow(ConfigCallback callback, const EmulatorConfig& config, QWidget* parent = nullptr);
|
||||
~ConfigWindow();
|
||||
|
||||
EmulatorConfig& getConfig() { return config; }
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue