QT: Various interface fixes (#2496)

* QT: Various interface fixes

* fix close without saving

* +

* +

using the save and close buttons, everything works fine, but when using the X button it doesn't work very well...

* fix close (X) without saving
This commit is contained in:
DanielSvoboda 2025-02-23 05:02:00 -03:00 committed by GitHub
parent 22ca57b1f2
commit e1ae052185
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 70 additions and 5 deletions

View file

@ -290,6 +290,27 @@ void MainWindow::CreateConnects() {
connect(settingsDialog, &SettingsDialog::CompatibilityChanged, this,
&MainWindow::RefreshGameTable);
connect(settingsDialog, &SettingsDialog::accepted, this, &MainWindow::RefreshGameTable);
connect(settingsDialog, &SettingsDialog::rejected, this, &MainWindow::RefreshGameTable);
connect(settingsDialog, &SettingsDialog::close, this, &MainWindow::RefreshGameTable);
connect(settingsDialog, &SettingsDialog::BackgroundOpacityChanged, this,
[this](int opacity) {
Config::setBackgroundImageOpacity(opacity);
if (m_game_list_frame) {
QTableWidgetItem* current = m_game_list_frame->GetCurrentItem();
if (current) {
m_game_list_frame->SetListBackgroundImage(current);
}
}
if (m_game_grid_frame) {
if (m_game_grid_frame->IsValidCellSelected()) {
m_game_grid_frame->SetGridBackgroundImage(m_game_grid_frame->crtRow,
m_game_grid_frame->crtColumn);
}
}
});
settingsDialog->exec();
});
@ -302,6 +323,10 @@ void MainWindow::CreateConnects() {
connect(settingsDialog, &SettingsDialog::CompatibilityChanged, this,
&MainWindow::RefreshGameTable);
connect(settingsDialog, &SettingsDialog::accepted, this, &MainWindow::RefreshGameTable);
connect(settingsDialog, &SettingsDialog::rejected, this, &MainWindow::RefreshGameTable);
connect(settingsDialog, &SettingsDialog::close, this, &MainWindow::RefreshGameTable);
connect(settingsDialog, &SettingsDialog::BackgroundOpacityChanged, this,
[this](int opacity) {
Config::setBackgroundImageOpacity(opacity);