Allow OSX config dialog to be resized
This commit is contained in:
committed by
craig.p.drummond
parent
caaf5a5a8e
commit
1c0d4891ef
@@ -213,6 +213,10 @@ bool ConfigDialog::setCurrentPage(const QString &id)
|
||||
setCaption(it.value().item->text());
|
||||
it.value().item->setChecked(true);
|
||||
}
|
||||
if (isVisible()) {
|
||||
it.value().widget->ensurePolished();
|
||||
ensurePolished();
|
||||
}
|
||||
int newH=it.value().widget->sizeHint().height()+toolBar->height()+buttonBox->height()+layout()->spacing()+(2*layout()->margin());
|
||||
if (isVisible()) {
|
||||
if (newH!=height()) {
|
||||
@@ -226,6 +230,8 @@ bool ConfigDialog::setCurrentPage(const QString &id)
|
||||
}
|
||||
} else {
|
||||
setFixedHeight(newH);
|
||||
resize(width(), newH);
|
||||
setMaximumHeight(QWIDGETSIZE_MAX);
|
||||
}
|
||||
#else
|
||||
pageWidget->setCurrentPage(pages[id]);
|
||||
@@ -233,6 +239,18 @@ bool ConfigDialog::setCurrentPage(const QString &id)
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
void ConfigDialog::setH(int h)
|
||||
{
|
||||
if (h==resizeAnim->endValue().toInt()) {
|
||||
setMaximumHeight(QWIDGETSIZE_MAX);
|
||||
resize(width(), h);
|
||||
} else {
|
||||
setFixedHeight(h);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
QWidget * ConfigDialog::getPage(const QString &id) const
|
||||
{
|
||||
if (!pages.contains(id)) {
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
void accept();
|
||||
void reject();
|
||||
int getH() const { return height(); }
|
||||
void setH(int h) { setFixedHeight(h); }
|
||||
void setH(int h);
|
||||
#endif
|
||||
|
||||
virtual void save()=0;
|
||||
|
||||
Reference in New Issue
Block a user