Index: scribus/ui/newdocdialog.cpp =================================================================== --- scribus/ui/newdocdialog.cpp (Revision 26436) +++ scribus/ui/newdocdialog.cpp (Arbeitskopie) @@ -60,6 +60,7 @@ IconManager &iconManager = IconManager::instance(); + m_labelVisibity = !prefsManager.appPrefs.uiPrefs.hideLabels; m_unitIndex = prefsManager.appPrefs.docSetupPrefs.docUnitIndex; m_unitRatio = unitGetRatioFromIndex(m_unitIndex); m_unitSuffix = unitGetSuffixFromIndex(m_unitIndex); @@ -191,6 +192,9 @@ pageCountSpinBox->setMaximum( 10000 ); pageCountSpinBox->setMinimum( 1 ); + IconManager &iconManager = IconManager::instance(); + pageCountLabel->setPixmap(iconManager.loadPixmap("panel-page")); + pageLayouts->updateSchemeSelector(prefsManager.appPrefs.pageSets, prefsManager.appPrefs.pageSets[pagePositioning].FirstPage); setDocLayout(pagePositioning); @@ -234,12 +238,16 @@ sectionTextFrame->setCanSaveState(true); sectionTextFrame->restorePreferences(); - // We have to calculate the width of the properties panel manually, - // because QSizePolicy::Minimum doesn't work as expected + labelColumns->setLabelVisibility(m_labelVisibity); + labelGap->setLabelVisibility(m_labelVisibity); + pageCountLabel->setLabelVisibility(m_labelVisibity); + orientationLabel->setLabelVisibility(m_labelVisibity); + pageLayouts->toggleLabelVisibility(m_labelVisibity); + + // We have to install an event filter to resize the scroll container width based on the content width. + // The content width can change after we calculated the initial ui layout. + scrollAreaWidgetContents->installEventFilter(this); scrollAreaWidgetContents->adjustSize(); - //scrollAreaWidgetContents->setFixedWidth(scrollAreaWidgetContents->width()); - scrollArea->setWidgetResizable(true); - scrollArea->setFixedWidth(scrollAreaWidgetContents->width() + qApp->style()->pixelMetric(QStyle::PM_ScrollBarExtent)); } @@ -330,6 +338,7 @@ QSignalBlocker sigFormats(listPageFormats); listPageFormats->setOrientation(m_orientation); } + } void NewDocDialog::setHeight(double) @@ -405,6 +414,17 @@ } } +bool NewDocDialog::eventFilter(QObject *object, QEvent *event) +{ + if (object->objectName() == "scrollAreaWidgetContents" && event->type() == QEvent::Resize) + { + int currentWidth = scrollArea->minimumWidth(); + scrollArea->setMinimumWidth(qMax(scrollAreaWidgetContents->sizeHint().width() + qApp->style()->pixelMetric(QStyle::PM_ScrollBarExtent), currentWidth)); + return true; + } + return false; +} + void NewDocDialog::handleAutoFrame() { bool setter = autoTextFrame->isChecked(); @@ -439,6 +459,8 @@ bleedGroup->setPageWidth(m_pageWidth); connect(widthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setWidth(double))); connect(heightSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setHeight(double))); + + } void NewDocDialog::ExitOK() @@ -523,6 +545,7 @@ marginGroup->setPageSize(size); bleedGroup->setPageSize(size); + } void NewDocDialog::setSize(const QString& gr) Index: scribus/ui/newdocdialog.h =================================================================== --- scribus/ui/newdocdialog.h (Revision 26436) +++ scribus/ui/newdocdialog.h (Arbeitskopie) @@ -137,8 +137,10 @@ double m_bleedTop { 0.0 }; double m_bleedLeft { 0.0 }; double m_bleedRight { 0.0 }; + bool m_labelVisibity {true}; void windowFitInScreen(); + bool eventFilter(QObject *object, QEvent *event); }; #endif // NEWDOC_H