mirror of
https://git.citron-emu.org/citron/emulator
synced 2025-12-20 19:13:56 +00:00
Edit uisettings.cpp
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
|
||||
// SPDX-FileCopyrightText: 2025 citron Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <QSettings>
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
#ifndef CANNOT_EXPLICITLY_INSTANTIATE
|
||||
namespace Settings {
|
||||
template class Setting<bool>;
|
||||
template class Setting<std::string>;
|
||||
template class Setting<u16, true>;
|
||||
template class Setting<u32>;
|
||||
template class Setting<u8, true>;
|
||||
template class Setting<u8>;
|
||||
template class Setting<unsigned long long>;
|
||||
template class Setting<bool>;
|
||||
template class Setting<std::string>;
|
||||
template class Setting<u16, true>;
|
||||
template class Setting<u32>;
|
||||
template class Setting<u8, true>;
|
||||
template class Setting<u8>;
|
||||
template class Setting<unsigned long long>;
|
||||
} // namespace Settings
|
||||
#endif
|
||||
|
||||
@@ -23,24 +23,24 @@ namespace FS = Common::FS;
|
||||
|
||||
namespace UISettings {
|
||||
|
||||
const Themes themes{{
|
||||
const Themes themes{{
|
||||
{"Default", "default"},
|
||||
{"Default Colorful", "colorful"},
|
||||
{"Dark", "qdarkstyle"},
|
||||
{"Dark Colorful", "colorful_dark"},
|
||||
{"Midnight Blue", "qdarkstyle_midnight_blue"},
|
||||
{"Midnight Blue Colorful", "colorful_midnight_blue"},
|
||||
}};
|
||||
}};
|
||||
|
||||
bool IsDarkTheme() {
|
||||
bool IsDarkTheme() {
|
||||
const auto& theme = UISettings::values.theme;
|
||||
return theme == std::string("qdarkstyle") || theme == std::string("qdarkstyle_midnight_blue") ||
|
||||
theme == std::string("colorful_dark") || theme == std::string("colorful_midnight_blue");
|
||||
}
|
||||
}
|
||||
|
||||
Values values = {};
|
||||
Values values = {};
|
||||
|
||||
u32 CalculateWidth(u32 height, Settings::AspectRatio ratio) {
|
||||
u32 CalculateWidth(u32 height, Settings::AspectRatio ratio) {
|
||||
switch (ratio) {
|
||||
case Settings::AspectRatio::R4_3:
|
||||
return height * 4 / 3;
|
||||
@@ -56,9 +56,9 @@ u32 CalculateWidth(u32 height, Settings::AspectRatio ratio) {
|
||||
break;
|
||||
}
|
||||
return height * 16 / 9;
|
||||
}
|
||||
}
|
||||
|
||||
void SaveWindowState() {
|
||||
void SaveWindowState() {
|
||||
const auto window_state_config_loc =
|
||||
FS::PathToUTF8String(FS::GetCitronPath(FS::CitronPath::ConfigDir) / "window_state.ini");
|
||||
|
||||
@@ -72,9 +72,9 @@ void SaveWindowState() {
|
||||
config.setValue(QStringLiteral("microProfileDialogGeometry"), values.microprofile_geometry);
|
||||
|
||||
config.sync();
|
||||
}
|
||||
}
|
||||
|
||||
void RestoreWindowState(std::unique_ptr<QtConfig>& qtConfig) {
|
||||
void RestoreWindowState(std::unique_ptr<QtConfig>& qtConfig) {
|
||||
const auto window_state_config_loc =
|
||||
FS::PathToUTF8String(FS::GetCitronPath(FS::CitronPath::ConfigDir) / "window_state.ini");
|
||||
|
||||
@@ -110,6 +110,6 @@ void RestoreWindowState(std::unique_ptr<QtConfig>& qtConfig) {
|
||||
config.value(QStringLiteral("gameListHeaderState")).toByteArray();
|
||||
values.microprofile_geometry =
|
||||
config.value(QStringLiteral("microProfileDialogGeometry")).toByteArray();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace UISettings
|
||||
|
||||
Reference in New Issue
Block a user