mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 00:13:08 +00:00
fix descriptionText size
This commit is contained in:
parent
ddb0928f10
commit
2ece948a8c
@ -53,6 +53,7 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidge
|
||||
: QDialog(parent), ui(new Ui::SettingsDialog) {
|
||||
ui->setupUi(this);
|
||||
ui->tabWidgetSettings->setUsesScrollButtons(false);
|
||||
initialHeight = this->height();
|
||||
const auto config_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
|
||||
|
||||
ui->buttonBox->button(QDialogButtonBox::StandardButton::Close)->setFocus();
|
||||
@ -430,15 +431,22 @@ bool SettingsDialog::eventFilter(QObject* obj, QEvent* event) {
|
||||
}
|
||||
|
||||
// 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->setMinimumHeight(90);
|
||||
this->setGeometry(currentGeometry.x(), currentGeometry.y(), newWidth,
|
||||
currentGeometry.height() + 40);
|
||||
ui->descriptionText->setMaximumSize(16777215, 110);
|
||||
} else {
|
||||
ui->descriptionText->setMinimumHeight(70);
|
||||
this->setGeometry(currentGeometry.x(), currentGeometry.y(), newWidth,
|
||||
initialHeight);
|
||||
ui->descriptionText->setMaximumSize(16777215, 70);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return QDialog::eventFilter(obj, event);
|
||||
}
|
||||
}
|
@ -40,4 +40,6 @@ private:
|
||||
std::map<std::string, int> languages;
|
||||
|
||||
QString defaultTextEdit;
|
||||
|
||||
int initialHeight;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user