mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-03-23 01:56:08 -04:00
Merge branch 'resize_windows_fix' into 'main'
fix: Dialogs now correctly remember their window size See merge request citron/emulator!98
This commit is contained in:
@@ -90,20 +90,14 @@ rainbow_timer{new QTimer(this)} {
|
|||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
if (!UISettings::values.configure_dialog_geometry.isEmpty()) {
|
||||||
|
restoreGeometry(UISettings::values.configure_dialog_geometry);
|
||||||
|
}
|
||||||
|
|
||||||
UpdateTheme();
|
UpdateTheme();
|
||||||
|
|
||||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
|
||||||
QScreen* screen = QApplication::primaryScreen();
|
|
||||||
if (screen) {
|
|
||||||
QRect screenGeometry = screen->availableGeometry();
|
|
||||||
qreal devicePixelRatio = screen->devicePixelRatio();
|
|
||||||
int logicalWidth = static_cast<int>(screenGeometry.width() / devicePixelRatio);
|
|
||||||
int logicalHeight = static_cast<int>(screenGeometry.height() / devicePixelRatio);
|
|
||||||
setGeometry(0, 0, logicalWidth, logicalHeight);
|
|
||||||
showMaximized();
|
|
||||||
}
|
|
||||||
|
|
||||||
tab_button_group = std::make_unique<QButtonGroup>(this);
|
tab_button_group = std::make_unique<QButtonGroup>(this);
|
||||||
tab_button_group->setExclusive(true);
|
tab_button_group->setExclusive(true);
|
||||||
|
|
||||||
@@ -173,7 +167,9 @@ rainbow_timer{new QTimer(this)} {
|
|||||||
ui->buttonBox->setFocus();
|
ui->buttonBox->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigureDialog::~ConfigureDialog() = default;
|
ConfigureDialog::~ConfigureDialog() {
|
||||||
|
UISettings::values.configure_dialog_geometry = saveGeometry();
|
||||||
|
}
|
||||||
|
|
||||||
void ConfigureDialog::UpdateTheme() {
|
void ConfigureDialog::UpdateTheme() {
|
||||||
QString accent_color_str;
|
QString accent_color_str;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
#include "core/loader/loader.h"
|
#include "core/loader/loader.h"
|
||||||
#include "frontend_common/config.h"
|
#include "frontend_common/config.h"
|
||||||
#include "ui_configure_per_game.h"
|
#include "ui_configure_per_game.h"
|
||||||
|
#include "citron/uisettings.h"
|
||||||
#include "citron/configuration/configuration_shared.h"
|
#include "citron/configuration/configuration_shared.h"
|
||||||
#include "citron/configuration/configure_audio.h"
|
#include "citron/configuration/configure_audio.h"
|
||||||
#include "citron/configuration/configure_cpu.h"
|
#include "citron/configuration/configure_cpu.h"
|
||||||
@@ -78,6 +79,10 @@ rainbow_timer{new QTimer(this)} {
|
|||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
if (!UISettings::values.per_game_configure_geometry.isEmpty()) {
|
||||||
|
restoreGeometry(UISettings::values.per_game_configure_geometry);
|
||||||
|
}
|
||||||
|
|
||||||
ApplyStaticTheme();
|
ApplyStaticTheme();
|
||||||
UpdateTheme(); // Run once to set initial colors
|
UpdateTheme(); // Run once to set initial colors
|
||||||
connect(rainbow_timer, &QTimer::timeout, this, &ConfigurePerGame::UpdateTheme);
|
connect(rainbow_timer, &QTimer::timeout, this, &ConfigurePerGame::UpdateTheme);
|
||||||
@@ -131,7 +136,9 @@ rainbow_timer{new QTimer(this)} {
|
|||||||
LoadConfiguration();
|
LoadConfiguration();
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigurePerGame::~ConfigurePerGame() = default;
|
ConfigurePerGame::~ConfigurePerGame() {
|
||||||
|
UISettings::values.per_game_configure_geometry = saveGeometry();
|
||||||
|
}
|
||||||
|
|
||||||
void ConfigurePerGame::accept() {
|
void ConfigurePerGame::accept() {
|
||||||
ApplyConfiguration();
|
ApplyConfiguration();
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ namespace UISettings {
|
|||||||
config.setValue(QStringLiteral("geometry"), values.geometry);
|
config.setValue(QStringLiteral("geometry"), values.geometry);
|
||||||
config.setValue(QStringLiteral("state"), values.state);
|
config.setValue(QStringLiteral("state"), values.state);
|
||||||
config.setValue(QStringLiteral("geometryRenderWindow"), values.renderwindow_geometry);
|
config.setValue(QStringLiteral("geometryRenderWindow"), values.renderwindow_geometry);
|
||||||
|
config.setValue(QStringLiteral("configureDialogGeometry"), values.configure_dialog_geometry);
|
||||||
|
config.setValue(QStringLiteral("perGameConfigureGeometry"), values.per_game_configure_geometry);
|
||||||
config.setValue(QStringLiteral("gameListHeaderState"), values.gamelist_header_state);
|
config.setValue(QStringLiteral("gameListHeaderState"), values.gamelist_header_state);
|
||||||
config.setValue(QStringLiteral("microProfileDialogGeometry"), values.microprofile_geometry);
|
config.setValue(QStringLiteral("microProfileDialogGeometry"), values.microprofile_geometry);
|
||||||
|
|
||||||
@@ -106,6 +108,10 @@ namespace UISettings {
|
|||||||
values.state = config.value(QStringLiteral("state")).toByteArray();
|
values.state = config.value(QStringLiteral("state")).toByteArray();
|
||||||
values.renderwindow_geometry =
|
values.renderwindow_geometry =
|
||||||
config.value(QStringLiteral("geometryRenderWindow")).toByteArray();
|
config.value(QStringLiteral("geometryRenderWindow")).toByteArray();
|
||||||
|
values.configure_dialog_geometry =
|
||||||
|
config.value(QStringLiteral("configureDialogGeometry")).toByteArray();
|
||||||
|
values.per_game_configure_geometry =
|
||||||
|
config.value(QStringLiteral("perGameConfigureGeometry")).toByteArray();
|
||||||
values.gamelist_header_state =
|
values.gamelist_header_state =
|
||||||
config.value(QStringLiteral("gameListHeaderState")).toByteArray();
|
config.value(QStringLiteral("gameListHeaderState")).toByteArray();
|
||||||
values.microprofile_geometry =
|
values.microprofile_geometry =
|
||||||
|
|||||||
@@ -91,6 +91,9 @@ namespace UISettings {
|
|||||||
|
|
||||||
QByteArray renderwindow_geometry;
|
QByteArray renderwindow_geometry;
|
||||||
|
|
||||||
|
QByteArray configure_dialog_geometry;
|
||||||
|
QByteArray per_game_configure_geometry;
|
||||||
|
|
||||||
QByteArray gamelist_header_state;
|
QByteArray gamelist_header_state;
|
||||||
|
|
||||||
QByteArray microprofile_geometry;
|
QByteArray microprofile_geometry;
|
||||||
|
|||||||
Reference in New Issue
Block a user