Wizard errors in a scroll area #6546

This commit is contained in:
Christian Kamm 2018-06-18 12:17:01 +02:00 committed by Markus Goetz
parent 8dad4406ec
commit b2fa9edd14
3 changed files with 56 additions and 18 deletions

View File

@ -51,7 +51,7 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage()
registerField(QLatin1String("OCSyncFromScratch"), _ui.cbSyncFromScratch);
_ui.resultLayout->addWidget(_progressIndi);
_ui.errorScrollContents->layout()->addWidget(_progressIndi);
stopSpinner();
setupCustomization();
@ -105,6 +105,11 @@ void OwncloudAdvancedSetupPage::initializePage()
{
WizardCommon::initErrorLabel(_ui.errorLabel);
auto labelSizeHint = _ui.errorLabel->minimumSizeHint();
_ui.errorScroll->setMinimumSize(
labelSizeHint.width(),
qMax<int>(1.3 * labelSizeHint.height(), _progressIndi->height()));
if (!ConfigFile().showExperimentalOptions()) {
// If the layout were wrapped in a widget, the auto-grouping of the
// radio buttons no longer works and there are surprising margins.
@ -181,8 +186,6 @@ void OwncloudAdvancedSetupPage::updateStatus()
}
_ui.syncModeLabel->setText(t);
_ui.syncModeLabel->setFixedHeight(_ui.syncModeLabel->sizeHint().height());
wizard()->resize(wizard()->sizeHint());
setErrorString(errorStr);
emit completeChanged();
}
@ -195,14 +198,12 @@ bool OwncloudAdvancedSetupPage::dataChanged()
void OwncloudAdvancedSetupPage::startSpinner()
{
_ui.resultLayout->setEnabled(true);
_progressIndi->setVisible(true);
_progressIndi->startAnimation();
}
void OwncloudAdvancedSetupPage::stopSpinner()
{
_ui.resultLayout->setEnabled(false);
_progressIndi->setVisible(false);
_progressIndi->stopAnimation();
}

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>912</width>
<height>635</height>
<width>917</width>
<height>604</height>
</rect>
</property>
<property name="sizePolicy">
@ -454,13 +454,6 @@
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="errorLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="syncModeLabel">
<property name="text">
@ -478,7 +471,54 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="resultLayout"/>
<widget class="QScrollArea" name="errorScroll">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="errorScrollContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>899</width>
<height>68</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="errorLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QLabel" name="bottomLabel">

View File

@ -62,9 +62,6 @@ namespace WizardCommon {
errorLabel->setStyleSheet(style);
errorLabel->setWordWrap(true);
auto sizePolicy = errorLabel->sizePolicy();
sizePolicy.setRetainSizeWhenHidden(true);
errorLabel->setSizePolicy(sizePolicy);
errorLabel->setVisible(false);
}