forked from qt-creator/qt-creator
Do not force an artificially high minimum size on the options dialog
We want it to have a reasonable first-use size, but we can just set that manually when opening it the first time. Afterwards the geometry is restored from the settings. All pages already have a vertical scrollbar available, but that also forced a relatively large minimum size. Reduce this. Fix-up ofdba102ff61
and63be3a4024
Fixes: QTCREATORBUG-21678 Change-Id: Iff5810b6ebfe51e3fe4da528bc859598c8df2bb4 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -56,6 +56,11 @@
|
|||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
#include <QStyledItemDelegate>
|
#include <QStyledItemDelegate>
|
||||||
|
|
||||||
|
const int kInitialWidth = 750;
|
||||||
|
const int kInitialHeight = 450;
|
||||||
|
const int kMaxMinimumWidth = 250;
|
||||||
|
const int kMaxMinimumHeight = 250;
|
||||||
|
|
||||||
static const char pageKeyC[] = "General/LastPreferencePage";
|
static const char pageKeyC[] = "General/LastPreferencePage";
|
||||||
const int categoryIconSize = 24;
|
const int categoryIconSize = 24;
|
||||||
|
|
||||||
@@ -362,8 +367,8 @@ private:
|
|||||||
QSize minSize = inner->minimumSizeHint();
|
QSize minSize = inner->minimumSizeHint();
|
||||||
minSize += QSize(fw, fw);
|
minSize += QSize(fw, fw);
|
||||||
minSize += QSize(scrollBarWidth(), 0);
|
minSize += QSize(scrollBarWidth(), 0);
|
||||||
minSize.setHeight(qMin(minSize.height(), 450));
|
minSize.setWidth(qMin(minSize.width(), kMaxMinimumWidth));
|
||||||
minSize.setWidth(qMin(minSize.width(), 810));
|
minSize.setHeight(qMin(minSize.height(), kMaxMinimumHeight));
|
||||||
return minSize;
|
return minSize;
|
||||||
}
|
}
|
||||||
return QSize(0, 0);
|
return QSize(0, 0);
|
||||||
@@ -547,7 +552,6 @@ void SettingsDialog::createGui()
|
|||||||
|
|
||||||
m_stackedLayout->setMargin(0);
|
m_stackedLayout->setMargin(0);
|
||||||
QWidget *emptyWidget = new QWidget(this);
|
QWidget *emptyWidget = new QWidget(this);
|
||||||
emptyWidget->setMinimumSize(QSize(500, 500));
|
|
||||||
m_stackedLayout->addWidget(emptyWidget); // no category selected, for example when filtering
|
m_stackedLayout->addWidget(emptyWidget); // no category selected, for example when filtering
|
||||||
|
|
||||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
|
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
|
||||||
@@ -740,6 +744,8 @@ bool SettingsDialog::execDialog()
|
|||||||
static const QLatin1String kPreferenceDialogSize("Core/PreferenceDialogSize");
|
static const QLatin1String kPreferenceDialogSize("Core/PreferenceDialogSize");
|
||||||
if (ICore::settings()->contains(kPreferenceDialogSize))
|
if (ICore::settings()->contains(kPreferenceDialogSize))
|
||||||
resize(ICore::settings()->value(kPreferenceDialogSize).toSize());
|
resize(ICore::settings()->value(kPreferenceDialogSize).toSize());
|
||||||
|
else
|
||||||
|
resize(kInitialWidth, kInitialHeight);
|
||||||
exec();
|
exec();
|
||||||
m_running = false;
|
m_running = false;
|
||||||
m_instance = nullptr;
|
m_instance = nullptr;
|
||||||
|
Reference in New Issue
Block a user