Skip to content

Commit

Permalink
qt: Improve user experience on Steam Deck and window managers (#2103)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomboylover93 authored Jan 18, 2025
1 parent 90b04e8 commit 40385e1
Show file tree
Hide file tree
Showing 3 changed files with 243 additions and 274 deletions.
6 changes: 6 additions & 0 deletions src/qt_gui/cheats_patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,12 @@ void CheatsPatches::setupUI() {
}
});

QPushButton* closeButton = new QPushButton(tr("Close"));
connect(closeButton, &QPushButton::clicked, [this]() { QWidget::close(); });

controlLayout->addWidget(downloadButton);
controlLayout->addWidget(deleteCheatButton);
controlLayout->addWidget(closeButton);

cheatsLayout->addLayout(controlLayout);
cheatsTab->setLayout(cheatsLayout);
Expand Down Expand Up @@ -464,6 +468,8 @@ void CheatsPatches::onSaveButtonClicked() {
} else {
QMessageBox::information(this, tr("Success"), tr("Options saved successfully."));
}

QWidget::close();
}

QCheckBox* CheatsPatches::findCheckBoxByName(const QString& name) {
Expand Down
16 changes: 0 additions & 16 deletions src/qt_gui/settings_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,22 +522,6 @@ bool SettingsDialog::eventFilter(QObject* obj, QEvent* event) {
} else {
ui->descriptionText->setText(defaultTextEdit);
}

// if the text exceeds the size of the box, it will increase the size
QRect currentGeometry = this->geometry();
int newWidth = currentGeometry.width();

int documentHeight = ui->descriptionText->document()->size().height();
int visibleHeight = ui->descriptionText->viewport()->height();
if (documentHeight > visibleHeight) {
ui->descriptionText->setMaximumSize(16777215, 110);
this->setGeometry(currentGeometry.x(), currentGeometry.y(), newWidth,
currentGeometry.height() + 40);
} else {
ui->descriptionText->setMaximumSize(16777215, 70);
this->setGeometry(currentGeometry.x(), currentGeometry.y(), newWidth,
initialHeight);
}
return true;
}
}
Expand Down
Loading

0 comments on commit 40385e1

Please sign in to comment.