Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt: Improve user experience on Steam Deck and window managers #2103

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
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