Skip to content

Commit 40385e1

Browse files
qt: Improve user experience on Steam Deck and window managers (#2103)
1 parent 90b04e8 commit 40385e1

File tree

3 files changed

+243
-274
lines changed

3 files changed

+243
-274
lines changed

src/qt_gui/cheats_patches.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,12 @@ void CheatsPatches::setupUI() {
188188
}
189189
});
190190

191+
QPushButton* closeButton = new QPushButton(tr("Close"));
192+
connect(closeButton, &QPushButton::clicked, [this]() { QWidget::close(); });
193+
191194
controlLayout->addWidget(downloadButton);
192195
controlLayout->addWidget(deleteCheatButton);
196+
controlLayout->addWidget(closeButton);
193197

194198
cheatsLayout->addLayout(controlLayout);
195199
cheatsTab->setLayout(cheatsLayout);
@@ -464,6 +468,8 @@ void CheatsPatches::onSaveButtonClicked() {
464468
} else {
465469
QMessageBox::information(this, tr("Success"), tr("Options saved successfully."));
466470
}
471+
472+
QWidget::close();
467473
}
468474

469475
QCheckBox* CheatsPatches::findCheckBoxByName(const QString& name) {

src/qt_gui/settings_dialog.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -522,22 +522,6 @@ bool SettingsDialog::eventFilter(QObject* obj, QEvent* event) {
522522
} else {
523523
ui->descriptionText->setText(defaultTextEdit);
524524
}
525-
526-
// if the text exceeds the size of the box, it will increase the size
527-
QRect currentGeometry = this->geometry();
528-
int newWidth = currentGeometry.width();
529-
530-
int documentHeight = ui->descriptionText->document()->size().height();
531-
int visibleHeight = ui->descriptionText->viewport()->height();
532-
if (documentHeight > visibleHeight) {
533-
ui->descriptionText->setMaximumSize(16777215, 110);
534-
this->setGeometry(currentGeometry.x(), currentGeometry.y(), newWidth,
535-
currentGeometry.height() + 40);
536-
} else {
537-
ui->descriptionText->setMaximumSize(16777215, 70);
538-
this->setGeometry(currentGeometry.x(), currentGeometry.y(), newWidth,
539-
initialHeight);
540-
}
541525
return true;
542526
}
543527
}

0 commit comments

Comments
 (0)