Settings tabs can be on the stack
This commit is contained in:
@@ -7,20 +7,20 @@
|
|||||||
|
|
||||||
class SettingsWindow final {
|
class SettingsWindow final {
|
||||||
gui::NativeWindow& window;
|
gui::NativeWindow& window;
|
||||||
GeneralSettings* generalSettings;
|
GeneralSettings generalSettings;
|
||||||
CPUSettings* cpuSettings = new CPUSettings;
|
CPUSettings cpuSettings;
|
||||||
AudioSettings* audioSettings = new AudioSettings;
|
AudioSettings audioSettings;
|
||||||
bool applyEnabled = false;
|
bool applyEnabled = false;
|
||||||
|
|
||||||
std::vector<std::pair<std::string, SettingsTab*>> tabs = {
|
std::vector<std::pair<std::string, SettingsTab*>> tabs = {
|
||||||
{ "General", generalSettings },
|
{ "General", &generalSettings },
|
||||||
{ "CPU", cpuSettings },
|
{ "CPU", &cpuSettings },
|
||||||
{ "Audio", audioSettings },
|
{ "Audio", &audioSettings },
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
bool isOpen = false;
|
bool isOpen = false;
|
||||||
bool render();
|
bool render();
|
||||||
explicit SettingsWindow(gui::NativeWindow& window) : window(window), generalSettings(new GeneralSettings(window)) {}
|
explicit SettingsWindow(gui::NativeWindow& window) : window(window), generalSettings(window) {}
|
||||||
[[nodiscard]] float getVolumeL() const { return audioSettings->volumeL / 100.f; }
|
[[nodiscard]] float getVolumeL() const { return audioSettings.volumeL / 100.f; }
|
||||||
[[nodiscard]] float getVolumeR() const { return audioSettings->volumeR / 100.f; }
|
[[nodiscard]] float getVolumeR() const { return audioSettings.volumeR / 100.f; }
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user