From 9a75453216fec710908fa1f3ddb47fb8db46c341 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Thu, 10 Feb 2022 01:37:41 +0600 Subject: [PATCH 1/2] qt: Combo boxes are no longer cramped --- src/qt/qt_styleoverride.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/qt/qt_styleoverride.cpp b/src/qt/qt_styleoverride.cpp index 06876adb2..86fa51d09 100644 --- a/src/qt/qt_styleoverride.cpp +++ b/src/qt/qt_styleoverride.cpp @@ -16,6 +16,9 @@ */ #include "qt_styleoverride.hpp" +#include +#include + int StyleOverride::styleHint( StyleHint hint, const QStyleOption *option, @@ -44,4 +47,9 @@ void StyleOverride::polish(QWidget* widget) } widget->setWindowFlag(Qt::WindowContextHelpButtonHint, false); } + + if (qobject_cast(widget)) { + widget->setMinimumWidth(widget->minimumSizeHint().width()); + qobject_cast(widget)->view()->setMinimumWidth(widget->minimumSizeHint().width()); + } } From e4997025502eab540ba722d7d7af629c52c4da5a Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Thu, 10 Feb 2022 01:38:00 +0600 Subject: [PATCH 2/2] qt: File fields are no longer cramped --- src/qt/qt_filefield.cpp | 1 + src/qt/qt_filefield.ui | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qt/qt_filefield.cpp b/src/qt/qt_filefield.cpp index 75523c20e..0639ad0fc 100644 --- a/src/qt/qt_filefield.cpp +++ b/src/qt/qt_filefield.cpp @@ -31,6 +31,7 @@ FileField::FileField(QWidget *parent) : fileName_ = ui->label->text(); emit fileSelected(ui->label->text()); }); + this->setFixedWidth(this->sizeHint().width() + ui->pushButton->sizeHint().width()); } FileField::~FileField() diff --git a/src/qt/qt_filefield.ui b/src/qt/qt_filefield.ui index 457e3916a..3a1e3e753 100644 --- a/src/qt/qt_filefield.ui +++ b/src/qt/qt_filefield.ui @@ -35,7 +35,7 @@ - + 0 0