Index: Scribus.pro
===================================================================
--- Scribus.pro	(Revision 26264)
+++ Scribus.pro	(Arbeitskopie)
@@ -481,8 +481,7 @@
            scribus/ui/linecombo.h \
            scribus/ui/linkbutton.h \
            scribus/ui/loremipsum.h \
-           scribus/ui/marginpresetlayout.h \
-           scribus/ui/marginwidget.h \
+	   scribus/ui/marginpresetlayout.h \
            scribus/ui/mark2item.h \
            scribus/ui/mark2mark.h \
            scribus/ui/markanchor.h \
@@ -1083,6 +1082,7 @@
          scribus/ui/measurementsbase.ui \
          scribus/ui/multipleduplicate.ui \
          scribus/ui/multiprogressdialog.ui \
+	 scribus/ui/newdocdialog.ui \
          scribus/ui/newmarginwidgetbase.ui \
          scribus/ui/nftdialog.ui \
          scribus/ui/nftwidget.ui \
@@ -1627,8 +1627,7 @@
            scribus/ui/linecombo.cpp \
            scribus/ui/linkbutton.cpp \
            scribus/ui/loremipsum.cpp \
-           scribus/ui/marginpresetlayout.cpp \
-           scribus/ui/marginwidget.cpp \
+	   scribus/ui/marginpresetlayout.cpp \
            scribus/ui/mark2item.cpp \
            scribus/ui/mark2mark.cpp \
            scribus/ui/markanchor.cpp \
Index: resources/iconsets/1_7_0/16/page-orientation-horizontal.svg
===================================================================
--- resources/iconsets/1_7_0/16/page-orientation-horizontal.svg	(nicht existent)
+++ resources/iconsets/1_7_0/16/page-orientation-horizontal.svg	(Arbeitskopie)
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><style>@import '../colors.css';</style>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M5.41421 4L2 7.41421V12H14V4H5.41421ZM1 7L5 3H14H15V4V12V13H14H2H1V12V7Z"/>
+</svg>
Index: resources/iconsets/1_7_0/16/page-orientation-vertical.svg
===================================================================
--- resources/iconsets/1_7_0/16/page-orientation-vertical.svg	(nicht existent)
+++ resources/iconsets/1_7_0/16/page-orientation-vertical.svg	(Arbeitskopie)
@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><style>@import '../colors.css';</style>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M7.41421 2L4 5.41421V14H12V2H7.41421ZM3 5L7 1H12H13V2V14V15H12H4H3V14V5Z"/>
+</svg>
Index: resources/iconsets/1_7_0/1_7_0.xml
===================================================================
--- resources/iconsets/1_7_0/1_7_0.xml	(Revision 26264)
+++ resources/iconsets/1_7_0/1_7_0.xml	(Arbeitskopie)
@@ -387,6 +387,8 @@
 		<icon id="layer-move-up" file="16/object-level-up.svg" />
 		<icon id="page-first-left" file="16/page-first-left.svg" />
 		<icon id="page-first-right" file="16/page-first-right.svg" />
+		<icon id="page-orientation-horizontal" file="16/page-orientation-horizontal.svg" />
+		<icon id="page-orientation-vertical" file="16/page-orientation-vertical.svg" />
     
 		<!-- PDF Tools -->
 		<icon id="16/insert-button.png" file="16/pdf-button.svg" />
Index: scribus/CMakeLists_Sources.txt
===================================================================
--- scribus/CMakeLists_Sources.txt	(Revision 26264)
+++ scribus/CMakeLists_Sources.txt	(Arbeitskopie)
@@ -363,7 +363,6 @@
 	ui/marksmanager.cpp
 	ui/markvariabletext.cpp
 	ui/marginpresetlayout.cpp
-	ui/marginwidget.cpp
 	ui/newmarginwidget.cpp
 	ui/mergedoc.cpp
 	ui/missing.cpp
@@ -383,7 +382,6 @@
 	ui/outputpreview_ps.cpp
 	ui/outputpreviewbase.cpp
 	ui/pageitemattributes.cpp
-	ui/pagelayout.cpp
 	ui/pagepalette.cpp
 	ui/pagepalette_pages.cpp
 	ui/pagepalette_masterpages.cpp
@@ -560,6 +558,10 @@
 	ui/widgets/floatingwindow.cpp
 	ui/widgets/form_widget.cpp
 	ui/widgets/gradientlistbox.cpp
+	ui/widgets/pagelayout.cpp
+	ui/widgets/pagesizelist.cpp
+	ui/widgets/pagesizepreview.cpp
+	ui/widgets/pagesizeselector.cpp
 	ui/widgets/popup_menu.cpp
 	ui/widgets/section_container.cpp
 	ui/widgets/stacked_container.cpp
Index: scribus/designer/formwidget_plugin.cpp
===================================================================
--- scribus/designer/formwidget_plugin.cpp	(Revision 26264)
+++ scribus/designer/formwidget_plugin.cpp	(Arbeitskopie)
@@ -92,30 +92,25 @@
 <ui language="c++" displayname="Form Widget">
 	<widget class="FormWidget" name="formWidget">
 		<property name="sizePolicy">
-		 <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
-		  <horstretch>0</horstretch>
-		  <verstretch>0</verstretch>
-		 </sizepolicy>
+			<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+				<horstretch>0</horstretch>
+				<verstretch>0</verstretch>
+			</sizepolicy>
 		</property>
-		<property name="font">
-		 <font>
-		  <pointsize>8</pointsize>
-		 </font>
-		</property>
-			<layout class="QHBoxLayout" name="horizontalLayout">
-			  <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>
-			</layout>
+		<layout class="QHBoxLayout" name="horizontalLayout">
+			<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>
+		</layout>
 	</widget>
 	<customwidgets>
 		<customwidget>
Index: scribus/designer/sectioncontainer_plugin.cpp
===================================================================
--- scribus/designer/sectioncontainer_plugin.cpp	(Revision 26264)
+++ scribus/designer/sectioncontainer_plugin.cpp	(Arbeitskopie)
@@ -100,9 +100,9 @@
 	return QLatin1String(R"(
 <ui language="c++" displayname="Section Container">
 	<widget class="SectionContainer" name="sectionContainer">
-	 <widget class="QWidget" name="page">
-	  <layout class="QVBoxLayout" name="verticalLayout"/>
-	 </widget>
+		<widget class="QWidget" name="page">
+			<layout class="QVBoxLayout" name="verticalLayout"/>
+		</widget>
 	</widget>
 	<customwidgets>
 		<customwidget>
Index: scribus/localemgr.cpp
===================================================================
--- scribus/localemgr.cpp	(Revision 26264)
+++ scribus/localemgr.cpp	(Arbeitskopie)
@@ -32,6 +32,7 @@
 #include "scribuscore.h"
 #include "localemgr.h"
 #include "scpaths.h"
+#include "pagesize.h"
 
 LocaleManager& LocaleManager::instance()
 {
@@ -60,13 +61,13 @@
 	//Build table;
 	//No, we don't translate these, they are internal use that don't get to the GUI
 	m_localeTable.clear();
-	m_localeTable.append(LocaleDef("default","mm",   "A4"   ));
-	m_localeTable.append(LocaleDef("en",     "in",   "Letter"));
-	m_localeTable.append(LocaleDef("en_AU",  "mm",   "A4"   ));
-	m_localeTable.append(LocaleDef("en_GB",  "mm",   "A4"   ));
-	m_localeTable.append(LocaleDef("en_US",  "in",   "Letter"));
-	m_localeTable.append(LocaleDef("fr",     "mm",   "A4"   ));
-	m_localeTable.append(LocaleDef("fr_QC",  "pica", "Letter"));
+	m_localeTable.append(LocaleDef("default","mm",   QString::number(PageSizeInfo::IsoA) + "_A4"   ));
+	m_localeTable.append(LocaleDef("en",     "in",   QString::number(PageSizeInfo::USStandard) + "_Letter"));
+	m_localeTable.append(LocaleDef("en_AU",  "mm",   QString::number(PageSizeInfo::IsoA) + "_A4"   ));
+	m_localeTable.append(LocaleDef("en_GB",  "mm",   QString::number(PageSizeInfo::IsoA) + "_A4"   ));
+	m_localeTable.append(LocaleDef("en_US",  "in",   QString::number(PageSizeInfo::USStandard) + "_Letter"));
+	m_localeTable.append(LocaleDef("fr",     "mm",   QString::number(PageSizeInfo::IsoA) + "_A4"   ));
+	m_localeTable.append(LocaleDef("fr_QC",  "pica", QString::number(PageSizeInfo::USStandard) + "_Letter"));
 }
 
 void LocaleManager::printSelectedForLocale(const QString& locale)
@@ -104,8 +105,8 @@
 	//qDebug()<<"No definition for locale: "<<selectedLocale;
 	//No, we don't translate these, they are internal use that don't get to the GUI
 	if (m_sysLocale.measurementSystem()==0)
-		return "A4";
-	return "Letter";
+		return QString::number(PageSizeInfo::IsoA) + "_A4";
+	return QString::number(PageSizeInfo::USStandard) + "_Letter";
 //	qFatal("Page Size not found in LocaleManager");
 //	return "";
 }
Index: scribus/pagesize.cpp
===================================================================
--- scribus/pagesize.cpp	(Revision 26264)
+++ scribus/pagesize.cpp	(Arbeitskopie)
@@ -19,17 +19,12 @@
  *                                                                         *
  ***************************************************************************/
 
+#include "commonstrings.h"
 #include "pagesize.h"
 #include "prefsmanager.h"
-
 #include <QStringList>
+#include <QObject>
 
-#include <cmath>
-#include <iostream>
-
-#include "commonstrings.h"
-
-
 PageSize::PageSize(const QString& sizeName)
 {
 	init(sizeName);
@@ -68,6 +63,7 @@
 		m_height = it.value().height;
 		m_pageUnitIndex = it.value().pageUnitIndex;
 		m_trPageSizeName = it.value().trSizeName;
+		m_category = it.value().category;
 		valuesSet = true;
 	}
 	else //build based on translated value.
@@ -82,6 +78,7 @@
 				m_height = it.value().height;
 				m_pageUnitIndex = it.value().pageUnitIndex;
 				m_trPageSizeName = it.value().trSizeName;
+				m_category = it.value().category;
 				valuesSet = true;
 			}
 		}
@@ -95,334 +92,530 @@
 		m_pageUnitIndex = -1;
 		m_pageSizeName = CommonStrings::customPageSize;
 		m_trPageSizeName = CommonStrings::trCustomPageSize;
+		m_category = PageSizeInfo::Custom;
 	}
 }
 
-QStringList PageSize::sizeList() const
+QStringList PageSize::defaultSizesList() const
 {
-	QStringList pageSizes;
+	return {
+		QString::number(PageSizeInfo::IsoA) + "_A3",
+		QString::number(PageSizeInfo::IsoA) + "_A4",
+		QString::number(PageSizeInfo::IsoA) + "_A5",
+		QString::number(PageSizeInfo::IsoA) + "_A6",
+		QString::number(PageSizeInfo::USStandard) + "_Letter"
+		//"A3", "A4", "A5", "A6", "Letter"
+	};
+}
+
+PageSizeCategoriesMap PageSize::categories()
+{
+	PageSizeCategoriesMap map;
+
 	for (auto it = m_pageSizeList.begin(); it != m_pageSizeList.end(); ++it)
-		pageSizes.append(it.key());
-	return QStringList(pageSizes);
+		map.insert(it.value().category, categoryToString(it.value().category));
+
+	return map;
 }
 
-QStringList PageSize::sizeTRList() const
+PageSizeInfoMap PageSize::sizesByCategory(PageSizeInfo::Category category)
 {
-	QStringList pageSizes;
+	PageSizeInfoMap map;
+
 	for (auto it = m_pageSizeList.begin(); it != m_pageSizeList.end(); ++it)
-		pageSizes.append(it.value().trSizeName);
-	return QStringList(pageSizes);
+	{
+		if (it.value().category == category)
+			map.insert(it.value().sizeName, it.value());
+	}
+
+	return map;
 }
 
-QStringList PageSize::activeSizeList() const
+PageSizeInfoMap PageSize::activePageSizes()
 {
-	QStringList pageSizes = sizeList();
+	PageSizeInfoMap map;
 	if (PrefsManager::instance().appPrefs.activePageSizes.count() == 0)
-		return QStringList(pageSizes);
-	QStringList activePageSizes(PrefsManager::instance().appPrefs.activePageSizes);
-	QStringList activeSizes;
-	for (int i = 0; i < activePageSizes.size(); ++i)
+		return pageSizes();
+
+	QStringList activeList(PrefsManager::instance().appPrefs.activePageSizes);
+
+	for (auto it = m_pageSizeList.begin(); it != m_pageSizeList.end(); ++it)
 	{
-		if (pageSizes.contains(activePageSizes.at(i)))
-			activeSizes << activePageSizes.at(i);
+		if (activeList.contains(it.value().sizeName))
+			map.insert(it.value().sizeName, it.value());
 	}
-	return QStringList(activeSizes);
+
+	return map;
 }
 
-QStringList PageSize::activeSizeTRList() const
+void PageSize::addPageSize(const QString name, double width, double height, int unitIndex, PageSizeInfo::Category category)
 {
-	QStringList pageTRSizes = sizeTRList();
-	QStringList pageSizes = sizeList();
-	if (PrefsManager::instance().appPrefs.activePageSizes.count() == 0)
-		return QStringList(pageTRSizes);
-	QStringList activePageSizes(PrefsManager::instance().appPrefs.activePageSizes);
-	QStringList activeTRSizes;
-	for (int i = 0; i < activePageSizes.size(); ++i)
+
+	struct PageSizeInfo info;
+	QString unit;
+
+	switch (unitIndex)
 	{
-		int j = pageSizes.indexOf(activePageSizes.at(i));
-		if (j != -1)
-		{
-			activeTRSizes << pageTRSizes.at(j);
-		}
+	case SC_C: // cicero
+		info.width = c2pts(width);
+		info.height = c2pts(height);
+		unit = "c";
+		break;
+	case SC_CM: // centimeter
+		info.width = cm2pts(width);
+		info.height = cm2pts(height);
+		unit = "cm";
+		break;
+	case SC_IN: // inch
+		info.width = in2pts(width);
+		info.height = in2pts(height);
+		unit = "in";
+		break;
+	case SC_MM: // millimeter
+	default:
+		info.width = mm2pts(width);
+		info.height = mm2pts(height);
+		unit = "mm";
+		break;
+	case SC_P: // picas
+		info.width = p2pts(width);
+		info.height = p2pts(height);
+		unit = "p";
+		break;
 	}
-	return QStringList(activeTRSizes);
+
+	info.pageUnitIndex = unitIndex;
+	info.sizeName = QString::number(category) + "_" + name;
+	info.trSizeName = QObject::tr( name.toStdString().c_str() );
+	info.category = category;
+	info.sizeLabel = QString("%1 x %2 %3").arg(width).arg(height).arg(unit);
+	m_pageSizeList.insert(info.sizeName, info);
+
 }
 
-QStringList PageSize::untransPageSizeList(const QStringList &transList)
+QString PageSize::categoryToString(PageSizeInfo::Category category) const
 {
-	QStringList pageTRSizes = sizeTRList();
-	QStringList pageSizes = sizeList();
-	QStringList untranslatedList;
-	for (int i = 0; i < transList.size(); ++i)
+	switch (category)
 	{
-		int j = pageTRSizes.indexOf(transList.at(i));
-		if (j != -1)
-		{
-			untranslatedList << pageSizes.at(j);
-		}
+	case PageSizeInfo::Favorite:
+		return QObject::tr("Favorite");
+	case PageSizeInfo::Custom:
+		return CommonStrings::trCustomPageSize;
+	case PageSizeInfo::Book:
+		return QObject::tr("Book");
+	case PageSizeInfo::BusinessCards:
+		return QObject::tr("Business Cards");
+	case PageSizeInfo::Canadian:
+		return QObject::tr("Candian");
+	case PageSizeInfo::Chinese:
+		return QObject::tr("Chinese");
+	case PageSizeInfo::Colombian:
+		return QObject::tr("Colombian");	
+	case PageSizeInfo::French:
+		return QObject::tr("French");
+	case PageSizeInfo::German:
+		return QObject::tr("German");
+	case PageSizeInfo::IsoA:
+		return QObject::tr("ISO A Series");
+	case PageSizeInfo::IsoB:
+		return QObject::tr("ISO B Series");
+	case PageSizeInfo::IsoC:
+		return QObject::tr("ISO C Series");
+	case PageSizeInfo::IsoEnvelop:
+		return QObject::tr("ISO Envelop");
+	case PageSizeInfo::Japanese:
+		return QObject::tr("Japanese");
+	case PageSizeInfo::Newspaper:
+		return QObject::tr("Newspaper");
+	case PageSizeInfo::Other:
+		return QObject::tr("Others");
+	case PageSizeInfo::Swedish:
+		return QObject::tr("Swedish");
+	case PageSizeInfo::Transitional:
+		return QObject::tr("Transitional");
+	case PageSizeInfo::USStandard:
+		return QObject::tr("US Standard");
+	case PageSizeInfo::USLoose:
+		return QObject::tr("US Loose");
+	case PageSizeInfo::USEnvelop:
+		return QObject::tr("US Envelop");
+	default:
+		return "undefined";
+		break;
 	}
-	return QStringList(untranslatedList);
 }
 
 
 void PageSize::generateSizeList()
 {
-	/*
-	{"A5", "A6", "A7", "A8", "A9", "B0", "B1", "B2", "B3",
-	"B4", "B5", "B6", "B7", "B8", "B9", "B10", "C5E", "Comm10E", "DLE", QObject::tr("Executive"),
-	QObject::tr("Folio"), QObject::tr("Ledger"), QObject::tr("Legal"), QObject::tr("Letter"), QObject::tr("Tabloid")
-	};
-	*/
+	// https://papersizes.io/books/
+	// Books
+	PageSizeInfo::Category catBooks =  PageSizeInfo::Book;
+	addPageSize("Folio", 12.0, 19.0, SC_IN, catBooks);
+	addPageSize("Quarto", 9.5, 12.0, SC_IN, catBooks);
+	addPageSize("Imperial Octavo", 8.25, 11.5, SC_IN, catBooks);
+	addPageSize("Super Octavo", 7.0, 11.0, SC_IN, catBooks);
+	addPageSize("Royal Octavo", 6.5, 10.0, SC_IN, catBooks);
+	addPageSize("Medium Octavo", 6.5, 9.25, SC_IN, catBooks);
+	addPageSize("Octavo", 6.0, 9.0, SC_IN, catBooks);
+	addPageSize("Crown Octavo", 5.4, 8.0, SC_IN, catBooks);
+	addPageSize("12mo", 5.0, 7.4, SC_IN, catBooks);
+	addPageSize("16mo", 4.0, 6.75, SC_IN, catBooks);
+	addPageSize("18mo", 4.0, 6.5, SC_IN, catBooks);
+	addPageSize("32mo", 3.5, 5.5, SC_IN, catBooks);
+	addPageSize("48mo", 2.0, 3.0, SC_IN, catBooks);
+	addPageSize("A Format", 4.25, 7.0, SC_IN, catBooks);
+	addPageSize("B Format", 5.1, 7.75, SC_IN, catBooks);
+	addPageSize("C Format", 5.25, 8.5, SC_IN, catBooks);
 
-//	double width, height, tmp;
-	int format;
-	QString name;
-	struct PageSizeInfo info;
-	/* A series */
-//	width  = floor(1000.0 / sqrt(sqrt(2.0)) + 0.5);
-//	height = floor(sqrt(sqrt(2.0))*1000.0 + 0.5);
-	//4A0
-	info.width = mm2pts(1682.0);
-	info.height = mm2pts(2378.0);
-	info.pageUnitIndex = SC_MM;
-	info.trSizeName = QObject::tr("4A0");
-	m_pageSizeList.insert("4A0", info); 
-	//2A0
-	info.width = mm2pts(1189.0);
-	info.height = mm2pts(1682.0);
-	info.pageUnitIndex = SC_MM;
-	info.trSizeName = QObject::tr("2A0");
-	m_pageSizeList.insert("2A0", info); 
-	//Continue with rest of A series
-	// do not use the formula below, as it is correct in theory,
-	// but due to rounding errors it gives incorrect results.
-/*	for (format = 0; format <= 10; format++) {
-		info.width = mm2pts(width);
-		info.height = mm2pts(height);
-		info.pageUnitIndex = SC_MM;
-		name = QString("A%1").arg(format);
-		info.trSizeName = name;
-		pageSizeList.insert(name, info);
-		tmp = height;
-		height = width;
-		width = floor(tmp / 2.0);
-	} */
-	// all of the following data is taken from the Ghostscript manual
-	// "Appendix: Paper sizes known to Ghostscript"
-	QList<double> Awidths;
-	QList<double> Aheights;
-	Awidths  <<  841.0 << 594.0 << 420.0 << 297.0 << 210.0 << 148.0 << 105.0 <<  74.0 << 52.0 << 37.0 << 26.0;
-	Aheights << 1189.0 << 841.0 << 594.0 << 420.0 << 297.0 << 210.0 << 148.0 << 105.0 << 74.0 << 52.0 << 37.0;
-	for (format = 0; format < Awidths.count(); format++)
-	{
-		info.width = mm2pts(Awidths[format]);
-		info.height = mm2pts(Aheights[format]);
-		info.pageUnitIndex = SC_MM;
-		name = QString("A%1").arg(format);
-		info.trSizeName = name;
-		m_pageSizeList.insert(name, info);
-	}
-	
-	/* B series */
-	Awidths.clear();
-	Aheights.clear();
-	Awidths  << 1000.0 <<  707.0 << 500.0 << 353.0 << 250.0 << 176.0 << 125.0 <<  88.0 << 62.0 << 44.0 << 31.0;
-	Aheights << 1414.0 << 1000.0 << 707.0 << 500.0 << 353.0 << 250.0 << 176.0 << 125.0 << 88.0 << 62.0 << 44.0;
-	for (format = 0; format < Awidths.count(); format++)
-	{
-		info.width = mm2pts(Awidths[format]);
-		info.height = mm2pts(Aheights[format]);
-		info.pageUnitIndex = SC_MM;
-		name = QString("B%1").arg(format);
-		info.trSizeName = name;
-		m_pageSizeList.insert(name, info);
-	}
-	/* C series */
-	Awidths.clear();
-	Aheights.clear();
-	Awidths  <<  917.0 << 648.0 << 458.0 << 324.0 << 229.0 << 162.0 << 114.0 <<  81.0 << 57.0 << 40.0 << 28.0;
-	Aheights << 1297.0 << 917.0 << 648.0 << 458.0 << 324.0 << 229.0 << 162.0 << 114.0 << 81.0 << 57.0 << 40.0;
-	for (format = 0; format < Awidths.count(); format++)
-	{
-		info.width = mm2pts(Awidths[format]);
-		info.height = mm2pts(Aheights[format]);
-		info.pageUnitIndex = SC_MM;
-		name = QString("C%1").arg(format);
-		info.trSizeName = name;
-		m_pageSizeList.insert(name, info);
-	}
-/*
-	width  = 1000.0;
-	height = floor(sqrt(2.0)*1000.0 + 0.5);
+	// https://papersizes.io/business-card/
+	// Business Cards
+	PageSizeInfo::Category catBusinessCards = PageSizeInfo::BusinessCards;
+	addPageSize("Europe", 55.0, 85.0, SC_MM, catBusinessCards);
+	addPageSize("ISO 7810 ID-1", 54.0, 85.6, SC_MM, catBusinessCards);
+	addPageSize("US/Canada", 2.0, 3.5, SC_IN, catBusinessCards);
+	addPageSize("China", 54.0, 90.0, SC_MM, catBusinessCards);
+	addPageSize("Scandinavia", 55.0, 90.0, SC_MM, catBusinessCards);
+	addPageSize("Japan", 55.0, 91.0, SC_MM, catBusinessCards);
+	addPageSize("Hungary", 50.0, 90.0, SC_MM, catBusinessCards);
+	addPageSize("Iran", 48.0, 85.0, SC_MM, catBusinessCards);
+	addPageSize("ISO 216", 52.0, 74.0, SC_MM, catBusinessCards);
 
-	for (format = 0; format <= 10; format++) {
-		info.width = mm2pts(width);
-		info.height = mm2pts(height);
-		info.pageUnitIndex = SC_MM;
-		name = QString("B%1").arg(format);
-		info.trSizeName = name;
-		pageSizeList.insert(name, info);
+	// https://papersizes.io/canadian/
+	// Canadian
+	PageSizeInfo::Category catCanadian = PageSizeInfo::Canadian;
+	addPageSize("P1", 560.0, 860.0, SC_MM, catCanadian);
+	addPageSize("P2", 430.0, 560.0, SC_MM, catCanadian);
+	addPageSize("P3", 280.0, 430.0, SC_MM, catCanadian);
+	addPageSize("P4", 215.0, 280.0, SC_MM, catCanadian);
+	addPageSize("P5", 140.0, 215.0, SC_MM, catCanadian);
+	addPageSize("P6", 107.0, 140.0, SC_MM, catCanadian);
 
-		tmp = height;
-		height = width;
-		width = floor(tmp / 2.0);
-	}
+	// https://papersizes.io/chinese/
+	// Chinese
+	PageSizeInfo::Category catChinese = PageSizeInfo::Chinese;
+	addPageSize("D0", 764.0, 1064.0, SC_MM, catChinese);
+	addPageSize("D1", 532.0, 760.0, SC_MM, catChinese);
+	addPageSize("D2", 380.0, 528.0, SC_MM, catChinese);
+	addPageSize("D3", 264.0, 375.0, SC_MM, catChinese);
+	addPageSize("D4", 188.0, 260.0, SC_MM, catChinese);
+	addPageSize("D5", 130.0, 184.0, SC_MM, catChinese);
+	addPageSize("D6", 92.0, 126.0, SC_MM, catChinese);
+	addPageSize("RD0", 787.0, 1092.0, SC_MM, catChinese);
+	addPageSize("RD1", 546.0, 787.0, SC_MM, catChinese);
+	addPageSize("RD2", 393.0, 546.0, SC_MM, catChinese);
+	addPageSize("RD3", 273.0, 393.0, SC_MM, catChinese);
+	addPageSize("RD4", 196.0, 273.0, SC_MM, catChinese);
+	addPageSize("RD5", 136.0, 196.0, SC_MM, catChinese);
+	addPageSize("RD6", 98.0, 136.0, SC_MM, catChinese);
 
-	// C series
-	width  = floor(1000.0 / sqrt(sqrt(sqrt(2.0)))+0.5);
-	height = floor(sqrt(sqrt(sqrt(8.0)))*1000.0 + 0.5);
+	// https://papersizes.io/colombian/
+	// Colombian
+	PageSizeInfo::Category catColombian = PageSizeInfo::Colombian;
+	addPageSize("Carta", 216.0, 279.0, SC_MM, catColombian);
+	addPageSize("Extra Tabloide", 304.0, 457.2, SC_MM, catColombian);
+	addPageSize("Oficio", 216.0, 330.0, SC_MM, catColombian);
+	addPageSize("Pliego", 700.0, 1000.0, SC_MM, catColombian);
+	addPageSize("1/2 Pliego", 500.0, 700.0, SC_MM, catColombian);
+	addPageSize("1/4 Pliego", 350.0, 500.0, SC_MM, catColombian);
+	addPageSize("1/8 Pliego", 250.0, 350.0, SC_MM, catColombian);
 
-	for (format = 0; format <= 10; format++) {
-		info.width = mm2pts(width);
-		info.height = mm2pts(height);
-		info.pageUnitIndex = SC_MM;
-		name = QString("C%1").arg(format);
-		info.trSizeName = name;
-		pageSizeList.insert(name, info);
+	// https://papersizes.io/french/
+	// French
+	PageSizeInfo::Category catFrench = PageSizeInfo::French;
+	addPageSize("Cloche", 300.0, 400.0, SC_MM, catFrench);
+	addPageSize("Pot, écolier", 310.0, 400.0, SC_MM, catFrench);
+	addPageSize("Tellière", 340.0, 440.0, SC_MM, catFrench);
+	addPageSize("Couronne écriture", 360.0, 360.0, SC_MM, catFrench);
+	addPageSize("Couronne édition", 370.0, 470.0, SC_MM, catFrench);
+	addPageSize("Roberto", 390.0, 500.0, SC_MM, catFrench);
+	addPageSize("Écu", 400.0, 520.0, SC_MM, catFrench);
+	addPageSize("Coquille", 440.0, 560.0, SC_MM, catFrench);
+	addPageSize("Carré", 450.0, 560.0, SC_MM, catFrench);
+	addPageSize("Cavalier", 460.0, 620.0, SC_MM, catFrench);
+	addPageSize("Demi-raisin", 325.0, 500.0, SC_MM, catFrench);
+	addPageSize("Raisin", 500.0, 650.0, SC_MM, catFrench);
+	addPageSize("Double Raisin", 650.0, 1000.0, SC_MM, catFrench);
+	addPageSize("Jésus", 560.0, 760.0, SC_MM, catFrench);
+	addPageSize("Soleil", 600.0, 800.0, SC_MM, catFrench);
+	addPageSize("Colombier affiche", 600.0, 800.0, SC_MM, catFrench);
+	addPageSize("Colombier commercial", 630.0, 900.0, SC_MM, catFrench);
+	addPageSize("Petit Aigle", 700.0, 940.0, SC_MM, catFrench);
+	addPageSize("Grand Aigle", 750.0, 1050.0, SC_MM, catFrench);
+	addPageSize("Grand Monde", 900.0, 1260.0, SC_MM, catFrench);
+	addPageSize("Univers", 1000.0, 1130.0, SC_MM, catFrench);
 
-		tmp = height;
-		height = width;
-		width = floor(tmp / 2.0);
-	}
-*/
-	/* PA series */
-	double tmp;
-	double width  = 840;
-	double height = 1120;
-	for (format = 0; format <= 10; format++)
-	{
-		info.width = mm2pts(width);
-		info.height = mm2pts(height);
-		info.pageUnitIndex = SC_MM;
-		name = QString("PA%1").arg(format);
-		info.trSizeName = name;
-		m_pageSizeList.insert(name, info);
-		tmp = height;
-		height = width;
-		width = floor(tmp / 2.0);
-	}
-	
-	//Imperial
-	//http://en.wikipedia.org/wiki/Paper_sizes
-	double impWidths[]={8.0,8.0,8.5,8.0,8.5,11.0,7.25,15.5,15.0,16.5,17.5,18.0,20.0,23.0,23.5,35.0,5.5,8.5,11.0,17.0,22.0,34.0};
-	double impHeights[]={10.0,13.0,11.0,10.5,14.0,17.0,10.5,19.25,20.0,21.0,22.5,23.0,25.0,28.0,35.0,45.0,8.5,11.0,17.0,22.0,34.0,44.0};
-	QString impNames[]={"Quarto","Foolscap","Letter","Govt. Letter","Legal","Ledger","Executive","Post","Crown","Large Post","Demy","Medium","Royal","Elephant","Double Demy","Quad Demy","STMT","A","B","C","D","E"};
-	QString impTrNames[]={QObject::tr("Quarto"), QObject::tr("Foolscap"), QObject::tr("Letter"),
-		QObject::tr("Govt. Letter"), QObject::tr("Legal"), QObject::tr("Ledger"), QObject::tr("Executive"),
-		QObject::tr("Post"), QObject::tr("Crown"), QObject::tr("Large Post"), QObject::tr("Demy"),
-		QObject::tr("Medium"), QObject::tr("Royal"), QObject::tr("Elephant"), QObject::tr("Double Demy"),
-		QObject::tr("Quad Demy"), QObject::tr("STMT"), QObject::tr("A"), QObject::tr("B"), QObject::tr("C"),
-		QObject::tr("D"), QObject::tr("E")};
-	
-	size_t const num_mappings_widths = (sizeof impWidths)/(sizeof *impWidths);
-	
-	for (uint i = 0; i < num_mappings_widths; ++i)
-	{
-		info.width = in2pts(impWidths[i]);
-		info.height = in2pts(impHeights[i]);
-		info.pageUnitIndex = SC_IN;
-		info.trSizeName = impTrNames[i];
-		m_pageSizeList.insert(impNames[i], info);
-	}
-	//Comm10E
-	info.width = in2pts(4.125);
-	info.height = in2pts(9.5);
-	info.pageUnitIndex = SC_IN;
-	info.trSizeName = QObject::tr("Comm10E");
-	m_pageSizeList.insert("Comm10E", info); 
-	//DLE
-	info.width = mm2pts(110);
-	info.height = mm2pts(220);
-	info.pageUnitIndex = SC_MM;
-	info.trSizeName = QObject::tr("DLE");
-	m_pageSizeList.insert("DLE", info); 
-	// additional page sizes used by Viva Designer
-	//Compact Disc
-	info.width = mm2pts(119.9);
-	info.height = mm2pts(120.7);
-	info.pageUnitIndex = SC_MM;
-	info.trSizeName = QObject::tr("Compact Disc");
-	m_pageSizeList.insert("Compact Disc", info);
-	//Letter Half
-	info.width = mm2pts(139.7);
-	info.height = mm2pts(215.9);
-	info.pageUnitIndex = SC_MM;
-	info.trSizeName = QObject::tr("Letter Half");
-	m_pageSizeList.insert("Letter Half", info);
-	//US Letter
-	info.width = mm2pts(215.9);
-	info.height = mm2pts(279.4);
-	info.pageUnitIndex = SC_MM;
-	info.trSizeName = QObject::tr("US Letter");
-	m_pageSizeList.insert("US Letter", info);
-	//US Legal
-	info.width = mm2pts(215.9);
-	info.height = mm2pts(355.6);
-	info.pageUnitIndex = SC_MM;
-	info.trSizeName = QObject::tr("US Legal");
-	m_pageSizeList.insert("US Legal", info);
-	//11x17
-	info.width = in2pts(11);
-	info.height = in2pts(17);
-	info.pageUnitIndex = SC_IN;
-	info.trSizeName = QObject::tr("11x17");
-	m_pageSizeList.insert("11x17", info);
+	// https://papersizes.io/german/
+	// German
+	PageSizeInfo::Category catGerman = PageSizeInfo::German;
+	addPageSize("DIN D0", 771.0, 1090.0, SC_MM, catGerman);
+	addPageSize("DIN D1", 545.0, 771.0, SC_MM, catGerman);
+	addPageSize("DIN D2", 385.0, 545.0, SC_MM, catGerman);
+	addPageSize("DIN D3", 272.0, 385.0, SC_MM, catGerman);
+	addPageSize("DIN D4", 192.0, 272.0, SC_MM, catGerman);
+	addPageSize("DIN D5", 136.0, 192.0, SC_MM, catGerman);
+	addPageSize("DIN D6", 96.0, 136.0, SC_MM, catGerman);
+	addPageSize("DIN D7", 68.0, 96.0, SC_MM, catGerman);
+	addPageSize("DIN D8", 48.0, 68.0, SC_MM, catGerman);
 
-	// Arch A 9 × 12
-	info.width = in2pts(9);
-	info.height = in2pts(12);
-	info.pageUnitIndex = SC_IN;
-	info.trSizeName = QObject::tr("9x12 (Arch A)");
-	m_pageSizeList.insert("9x12 (Arch A)", info);
-	// Arch B 12 × 18
-	info.width = in2pts(12);
-	info.height = in2pts(18);
-	info.pageUnitIndex = SC_IN;
-	info.trSizeName = QObject::tr("12x18 (Arch B)");
-	m_pageSizeList.insert("12x18 (Arch B)", info);
-	// Arch C 18 × 24
-	info.width = in2pts(18);
-	info.height = in2pts(24);
-	info.pageUnitIndex = SC_IN;
-	info.trSizeName = QObject::tr("18x24 (Arch C)");
-	m_pageSizeList.insert("18x (Arch C)", info);
-	// Arch D 24 × 36
-	info.width = in2pts(24);
-	info.height = in2pts(36);
-	info.pageUnitIndex = SC_IN;
-	info.trSizeName = QObject::tr("24x36 (Arch D)");
-	m_pageSizeList.insert("24x36 (Arch D)", info);
-	// Arch E 36 × 48
-	info.width = in2pts(36);
-	info.height = in2pts(48);
-	info.pageUnitIndex = SC_IN;
-	info.trSizeName = QObject::tr("36x48 (Arch E)");
-	m_pageSizeList.insert("36x48 (Arch E)", info);
-	// Arch E1 30 × 42
-	info.width = in2pts(30);
-	info.height = in2pts(42);
-	info.pageUnitIndex = SC_IN;
-	info.trSizeName = QObject::tr("30x42 (Arch E1)");
-	m_pageSizeList.insert("30x42 (Arch E1)", info);
-	// Arch E2 26 × 38
-	info.width = in2pts(26);
-	info.height = in2pts(38);
-	info.pageUnitIndex = SC_IN;
-	info.trSizeName = QObject::tr("26x38 (Arch E2)");
-	m_pageSizeList.insert("26x38 (Arch E2)", info);
-	// Arch E3 27 × 39
-	info.width = in2pts(27);
-	info.height = in2pts(39);
-	info.pageUnitIndex = SC_IN;
-	info.trSizeName = QObject::tr("27x39 (Arch E3)");
-	m_pageSizeList.insert("27x39 (Arch E3)", info);
+	// https://papersizes.io/a/
+	// ISO A series
+	PageSizeInfo::Category catIsoA = PageSizeInfo::IsoA;
+	addPageSize("A0", 841.0, 1189.0, SC_MM, catIsoA);
+	addPageSize("A1", 594.0, 841.0, SC_MM, catIsoA);
+	addPageSize("A2", 420.0, 594.0, SC_MM, catIsoA);
+	addPageSize("A3", 297.0, 420.0, SC_MM, catIsoA);
+	addPageSize("A4", 210.0, 297.0, SC_MM, catIsoA);
+	addPageSize("A5", 148.0, 210.0, SC_MM, catIsoA);
+	addPageSize("A6", 105.0, 148.0, SC_MM, catIsoA);
+	addPageSize("A7", 74.0, 105.0, SC_MM, catIsoA);
+	addPageSize("A8", 52.0, 74.0, SC_MM, catIsoA);
+	addPageSize("A9", 37.0, 52.0, SC_MM, catIsoA);
+	addPageSize("A10", 26.0, 37.0, SC_MM, catIsoA);
+	addPageSize("A11", 18.0, 26.0, SC_MM, catIsoA);
+	addPageSize("A12", 13.0, 18.0, SC_MM, catIsoA);
+	addPageSize("A13", 9.0, 13.0, SC_MM, catIsoA);
+	addPageSize("2A0", 1189.0, 1682.0, SC_MM, catIsoA);
+	addPageSize("4A0", 1682.0, 2378.0, SC_MM, catIsoA);
+	addPageSize("A0+", 914.0, 1292.0, SC_MM, catIsoA);
+	addPageSize("A1+", 609.0, 914.0, SC_MM, catIsoA);
+	addPageSize("A3+", 329.0, 483.0, SC_MM, catIsoA);
 
-	//Executive
-	//Folio
-	//Ledger
-	//Legal
-	//Letter
-	//Tabloid
+
+	// https://papersizes.io/b/
+	// ISO B series
+	PageSizeInfo::Category catIsoB = PageSizeInfo::IsoB;
+	addPageSize("B0", 1000.0, 1414.0, SC_MM, catIsoB);
+	addPageSize("B1", 707.0, 1000.0, SC_MM, catIsoB);
+	addPageSize("B2", 500.0, 707.0, SC_MM, catIsoB);
+	addPageSize("B3", 353.0, 500.0, SC_MM, catIsoB);
+	addPageSize("B4", 250.0, 353.0, SC_MM, catIsoB);
+	addPageSize("B5", 176.0, 250.0, SC_MM, catIsoB);
+	addPageSize("B6", 125.0, 176.0, SC_MM, catIsoB);
+	addPageSize("B7", 88.0, 125.0, SC_MM, catIsoB);
+	addPageSize("B8", 62.0, 88.0, SC_MM, catIsoB);
+	addPageSize("B9", 44.0, 62.0, SC_MM, catIsoB);
+	addPageSize("B10", 31.0, 44.0, SC_MM, catIsoB);
+	addPageSize("B11", 22.0, 31.0, SC_MM, catIsoB);
+	addPageSize("B12", 15.0, 22.0, SC_MM, catIsoB);
+	addPageSize("B13", 11.0, 15.0, SC_MM, catIsoB);
+	addPageSize("B0+", 1118.0, 1580.0, SC_MM, catIsoB);
+	addPageSize("B1+", 720.0, 1020.0, SC_MM, catIsoB);
+	addPageSize("B2+", 520.0, 720.0, SC_MM, catIsoB);
+
+	// https://papersizes.io/c-envelope/
+	// ISO C series
+	PageSizeInfo::Category catIsoC = PageSizeInfo::IsoC;
+	addPageSize("C0", 917.0, 1297.0, SC_MM, catIsoC);
+	addPageSize("C1", 648.0, 917.0, SC_MM, catIsoC);
+	addPageSize("C2", 458.0, 648.0, SC_MM, catIsoC);
+	addPageSize("C3", 324.0, 458.0, SC_MM, catIsoC);
+	addPageSize("C4", 229.0, 324.0, SC_MM, catIsoC);
+	addPageSize("C5", 162.0, 229.0, SC_MM, catIsoC);
+	addPageSize("C6", 114.0, 162.0, SC_MM, catIsoC);
+	addPageSize("C7", 81.0, 114.0, SC_MM, catIsoC);
+	addPageSize("C8", 57.0, 81.0, SC_MM, catIsoC);
+	addPageSize("C9", 40.0, 57.0, SC_MM, catIsoC);
+	addPageSize("C10", 28.0, 40.0, SC_MM, catIsoC);
+
+	// https://papersizes.io/international-envelope/
+	// ISO Envelopes
+	PageSizeInfo::Category catIsoEnvelop = PageSizeInfo::IsoEnvelop;
+	addPageSize("DL/E65", 110.0, 220.0, SC_MM, catIsoEnvelop);
+	addPageSize("B4", 250.0, 353.0, SC_MM, catIsoEnvelop);
+	addPageSize("B5", 176.0, 250.0, SC_MM, catIsoEnvelop);
+	addPageSize("B6", 125.0, 176.0, SC_MM, catIsoEnvelop);
+	addPageSize("C3", 324.0, 458.0, SC_MM, catIsoEnvelop);
+	addPageSize("C4", 229.0, 324.0, SC_MM, catIsoEnvelop);
+	addPageSize("C4M", 229.0, 318.0, SC_MM, catIsoEnvelop);
+	addPageSize("C5", 162.0, 229.0, SC_MM, catIsoEnvelop);
+	addPageSize("C6/C5", 114.0, 229.0, SC_MM, catIsoEnvelop);
+	addPageSize("C6", 114.0, 162.0, SC_MM, catIsoEnvelop);
+	addPageSize("C64M", 114.0, 318.0, SC_MM, catIsoEnvelop);
+	addPageSize("C7", 81.0, 114.0, SC_MM, catIsoEnvelop);
+	addPageSize("C7/C6", 81.0, 162.0, SC_MM, catIsoEnvelop);
+	addPageSize("B6/C4", 125.0, 324.0, SC_MM, catIsoEnvelop);
+	addPageSize("E4", 220.0, 312.0, SC_MM, catIsoEnvelop);
+	addPageSize("E5", 115.0, 220.0, SC_MM, catIsoEnvelop);
+	addPageSize("E56", 115.0, 115.0, SC_MM, catIsoEnvelop);
+	addPageSize("E6", 110.0, 155.0, SC_MM, catIsoEnvelop);
+	addPageSize("EC45", 220.0, 229.0, SC_MM, catIsoEnvelop);
+	addPageSize("EC5", 155.0, 229.0, SC_MM, catIsoEnvelop);
+	addPageSize("R7", 120.0, 135.0, SC_MM, catIsoEnvelop);
+	addPageSize("S4", 250.0, 330.0, SC_MM, catIsoEnvelop);
+	addPageSize("S5", 185.0, 255.0, SC_MM, catIsoEnvelop);
+	addPageSize("S65", 110.0, 225.0, SC_MM, catIsoEnvelop);
+	addPageSize("X5", 105.0, 216.0, SC_MM, catIsoEnvelop);
+	addPageSize("EX5", 115.0, 216.0, SC_MM, catIsoEnvelop);
+
+	// https://papersizes.io/japanese/
+	// Japanese
+	PageSizeInfo::Category catJapanese = PageSizeInfo::Japanese;
+	addPageSize("JB0", 1030.0, 1456.0, SC_MM, catJapanese);
+	addPageSize("JB1", 728.0, 1030.0, SC_MM, catJapanese);
+	addPageSize("JB2", 515.0, 728.0, SC_MM, catJapanese);
+	addPageSize("JB3", 364.0, 515.0, SC_MM, catJapanese);
+	addPageSize("JB4", 257.0, 364.0, SC_MM, catJapanese);
+	addPageSize("JB5", 182.0, 257.0, SC_MM, catJapanese);
+	addPageSize("JB6", 128.0, 182.0, SC_MM, catJapanese);
+	addPageSize("JB7", 91.0, 128.0, SC_MM, catJapanese);
+	addPageSize("JB8", 64.0, 91.0, SC_MM, catJapanese);
+	addPageSize("JB9", 45.0, 64.0, SC_MM, catJapanese);
+	addPageSize("JB10", 32.0, 45.0, SC_MM, catJapanese);
+	addPageSize("JB11", 22.0, 32.0, SC_MM, catJapanese);
+	addPageSize("JB12", 16.0, 22.0, SC_MM, catJapanese);
+	addPageSize("Shiroku ban 4", 264.0, 379.0, SC_MM, catJapanese);
+	addPageSize("Shiroku ban 5", 189.0, 262.0, SC_MM, catJapanese);
+	addPageSize("Shiroku ban 6", 127.0, 188.0, SC_MM, catJapanese);
+	addPageSize("Kiku 4", 227.0, 306.0, SC_MM, catJapanese);
+	addPageSize("Kiku 5", 151.0, 227.0, SC_MM, catJapanese);
+
+	// https://papersizes.io/newspaper/
+	// Newspaper
+	PageSizeInfo::Category catNewspaper = PageSizeInfo::Newspaper;
+	addPageSize("Berliner", 315.0, 470.0, SC_MM, catNewspaper);
+	addPageSize("Broadsheet", 597.0, 749.0, SC_MM, catNewspaper);
+	addPageSize("US Broadsheet", 15.0, 22.75, SC_IN, catNewspaper);
+	addPageSize("British Broadsheet", 375.0, 597.0, SC_MM, catNewspaper);
+	addPageSize("South African Broadsheet", 410.0, 578.0, SC_MM, catNewspaper);
+	addPageSize("Ciner", 350.0, 500.0, SC_MM, catNewspaper);
+	addPageSize("Compact", 280.0, 430.0, SC_MM, catNewspaper);
+	addPageSize("Nordisch", 400.0, 570.0, SC_MM, catNewspaper);
+	addPageSize("Rhenish", 350.0, 520.0, SC_MM, catNewspaper);
+	addPageSize("Swiss", 320.0, 475.0, SC_MM, catNewspaper);
+	addPageSize("Tabloid (Newspaper)", 280.0, 430.0, SC_MM, catNewspaper);
+	addPageSize("Canadian Tabloid", 260.0, 368.0, SC_MM, catNewspaper);
+	addPageSize("Norwegian Tabloid", 280.0, 400.0, SC_MM, catNewspaper);
+	addPageSize("New York Times", 12.0, 22.0, SC_IN, catNewspaper);
+	addPageSize("Wall Street Journal", 12.0, 22.75, SC_IN, catNewspaper);
+
+	// https://papersizes.io/swedish/
+	// Swedish
+	PageSizeInfo::Category catSwedish = PageSizeInfo::Swedish;
+	addPageSize("SIS D0", 1091.0, 1542.0, SC_MM, catSwedish);
+	addPageSize("SIS D1", 771.0, 1091.0, SC_MM, catSwedish);
+	addPageSize("SIS D2", 545.0, 771.0, SC_MM, catSwedish);
+	addPageSize("SIS D3", 386.0, 545.0, SC_MM, catSwedish);
+	addPageSize("SIS D4", 273.0, 386.0, SC_MM, catSwedish);
+	addPageSize("SIS D5", 193.0, 273.0, SC_MM, catSwedish);
+	addPageSize("SIS D6", 136.0, 193.0, SC_MM, catSwedish);
+	addPageSize("SIS D7", 96.0, 136.0, SC_MM, catSwedish);
+	addPageSize("SIS D8", 68.0, 96.0, SC_MM, catSwedish);
+	addPageSize("SIS D9", 48.0, 68.0, SC_MM, catSwedish);
+	addPageSize("SIS D10", 34.0, 48.0, SC_MM, catSwedish);
+	addPageSize("SIS E0", 878.0, 1242.0, SC_MM, catSwedish);
+	addPageSize("SIS E1", 621.0, 878.0, SC_MM, catSwedish);
+	addPageSize("SIS E2", 439.0, 621.0, SC_MM, catSwedish);
+	addPageSize("SIS E3", 310.0, 439.0, SC_MM, catSwedish);
+	addPageSize("SIS E4", 220.0, 310.0, SC_MM, catSwedish);
+	addPageSize("SIS E5", 155.0, 220.0, SC_MM, catSwedish);
+	addPageSize("SIS E6", 110.0, 155.0, SC_MM, catSwedish);
+	addPageSize("SIS E7", 78.0, 110.0, SC_MM, catSwedish);
+	addPageSize("SIS E8", 55.0, 78.0, SC_MM, catSwedish);
+	addPageSize("SIS E9", 39.0, 55.0, SC_MM, catSwedish);
+	addPageSize("SIS E10", 27.0, 39.0, SC_MM, catSwedish);
+	addPageSize("SIS F0", 958.0, 1354.0, SC_MM, catSwedish);
+	addPageSize("SIS F1", 677.0, 958.0, SC_MM, catSwedish);
+	addPageSize("SIS F2", 479.0, 677.0, SC_MM, catSwedish);
+	addPageSize("SIS F3", 339.0, 479.0, SC_MM, catSwedish);
+	addPageSize("SIS F4", 239.0, 339.0, SC_MM, catSwedish);
+	addPageSize("SIS F5", 169.0, 239.0, SC_MM, catSwedish);
+	addPageSize("SIS F6", 120.0, 169.0, SC_MM, catSwedish);
+	addPageSize("SIS F7", 85.0, 120.0, SC_MM, catSwedish);
+	addPageSize("SIS F8", 60.0, 85.0, SC_MM, catSwedish);
+	addPageSize("SIS F9", 42.0, 60.0, SC_MM, catSwedish);
+	addPageSize("SIS F10", 30.0, 42.0, SC_MM, catSwedish);
+	addPageSize("SIS G0", 1044.0, 1477.0, SC_MM, catSwedish);
+	addPageSize("SIS G1", 738.0, 1044.0, SC_MM, catSwedish);
+	addPageSize("SIS G2", 522.0, 738.0, SC_MM, catSwedish);
+	addPageSize("SIS G3", 369.0, 522.0, SC_MM, catSwedish);
+	addPageSize("SIS G4", 261.0, 369.0, SC_MM, catSwedish);
+	addPageSize("SIS G5", 185.0, 261.0, SC_MM, catSwedish);
+	addPageSize("SIS G6", 131.0, 185.0, SC_MM, catSwedish);
+	addPageSize("SIS G7", 92.0, 131.0, SC_MM, catSwedish);
+	addPageSize("SIS G8", 65.0, 92.0, SC_MM, catSwedish);
+	addPageSize("SIS G9", 46.0, 65.0, SC_MM, catSwedish);
+	addPageSize("SIS G10", 33.0, 46.0, SC_MM, catSwedish);
+
+	// Transitional
+	PageSizeInfo::Category catTransitional = PageSizeInfo::Transitional;
+	addPageSize("F0", 841.0, 1321.0, SC_MM, catTransitional);
+	addPageSize("F1", 660.0, 841.0, SC_MM, catTransitional);
+	addPageSize("F2", 420.0, 660.0, SC_MM, catTransitional);
+	addPageSize("F3", 330.0, 420.0, SC_MM, catTransitional);
+	addPageSize("F4", 210.0, 330.0, SC_MM, catTransitional);
+	addPageSize("F5", 165.0, 210.0, SC_MM, catTransitional);
+	addPageSize("F6", 105.0, 165.0, SC_MM, catTransitional);
+	addPageSize("F7", 82.0, 105.0, SC_MM, catTransitional);
+	addPageSize("F8", 52.0, 82.0, SC_MM, catTransitional);
+	addPageSize("F9", 41.0, 52.0, SC_MM, catTransitional);
+	addPageSize("F10", 26.0, 41.0, SC_MM, catTransitional);
+	addPageSize("PA0", 840.0, 1120.0, SC_MM, catTransitional);
+	addPageSize("PA1", 560.0, 840.0, SC_MM, catTransitional);
+	addPageSize("PA2", 420.0, 560.0, SC_MM, catTransitional);
+	addPageSize("PA3", 280.0, 420.0, SC_MM, catTransitional);
+	addPageSize("PA4", 210.0, 280.0, SC_MM, catTransitional);
+	addPageSize("PA5", 140.0, 210.0, SC_MM, catTransitional);
+	addPageSize("PA6", 105.0, 140.0, SC_MM, catTransitional);
+	addPageSize("PA7", 70.0, 105.0, SC_MM, catTransitional);
+	addPageSize("PA8", 52.0, 70.0, SC_MM, catTransitional);
+	addPageSize("PA9", 35.0, 52.0, SC_MM, catTransitional);
+	addPageSize("PA10", 26.0, 35.0, SC_MM, catTransitional);
+
+
+	// US Paper Size
+	// https://papersizes.io/us/
+	PageSizeInfo::Category catUSStandard = PageSizeInfo::USStandard;
+	addPageSize("Letter", 8.5, 11.0, SC_IN, catUSStandard);
+	addPageSize("Legal", 8.5, 14.0, SC_IN, catUSStandard);
+	addPageSize("Ledger, Tabloid", 11.0, 17.0, SC_IN, catUSStandard);
+	addPageSize("Junior Legal", 5.0, 8.0, SC_IN, catUSStandard);
+	addPageSize("Half Letter", 5.5, 8.5, SC_IN, catUSStandard);
+	addPageSize("Government Letter", 8.0, 10.5, SC_IN, catUSStandard);
+	addPageSize("Government Legal", 8.5, 13.0, SC_IN, catUSStandard);
+	addPageSize("ANSI A", 8.5, 11.0, SC_IN, catUSStandard);
+	addPageSize("ANSI B", 11.0, 17.0, SC_IN, catUSStandard);
+	addPageSize("ANSI C", 17.0, 22.0, SC_IN, catUSStandard);
+	addPageSize("ANSI D", 22.0, 34.0, SC_IN, catUSStandard);
+	addPageSize("ANSI E", 34.0, 44.0, SC_IN, catUSStandard);
+	addPageSize("Arch A", 9.0, 12.0, SC_IN, catUSStandard);
+	addPageSize("Arch B", 12.0, 18.0, SC_IN, catUSStandard);
+	addPageSize("Arch C", 18.0, 24.0, SC_IN, catUSStandard);
+	addPageSize("Arch D", 24.0, 36.0, SC_IN, catUSStandard);
+	addPageSize("Arch E", 36.0, 48.0, SC_IN, catUSStandard);
+	addPageSize("Arch E1", 30.0, 42.0, SC_IN, catUSStandard);
+	addPageSize("Arch E2", 26.0, 38.0, SC_IN, catUSStandard);
+	addPageSize("Arch E3", 27.0, 39.0, SC_IN, catUSStandard);
+
+	// US Loose paper Sizes
+	PageSizeInfo::Category catUSLoose = PageSizeInfo::USLoose;
+	addPageSize("5x7", 5.0, 7.0, SC_IN, catUSLoose);
+	addPageSize("7x9", 7.0, 9.0, SC_IN, catUSLoose);
+	addPageSize("10x11", 10.0, 11.0, SC_IN, catUSLoose);
+	addPageSize("10x13", 10.0, 13.0, SC_IN, catUSLoose);
+	addPageSize("10x14", 10.0, 14.0, SC_IN, catUSLoose);
+	addPageSize("11x12", 11.0, 12.0, SC_IN, catUSLoose);
+	addPageSize("11x15", 11.0, 15.0, SC_IN, catUSLoose);
+
+	// US Envelope
+	// https://www.wsel.com/envelopes/standard-sizes
+	PageSizeInfo::Category catUSEnvelop = PageSizeInfo::USEnvelop;
+	addPageSize("Commerical 5", 3.125, 5.5, SC_IN, catUSEnvelop);
+	addPageSize("Commerical 6 1/4", 3.5, 6.0, SC_IN, catUSEnvelop);
+	addPageSize("Commerical 6 3/4", 3.625, 6.5, SC_IN, catUSEnvelop);
+	addPageSize("Commerical 7", 3.75, 6.75, SC_IN, catUSEnvelop);
+	addPageSize("Commerical 7 1/2", 3.9375, 7.5, SC_IN, catUSEnvelop);
+	addPageSize("Commerical 8 5/8", 3.625, 8.625, SC_IN, catUSEnvelop);
+	addPageSize("Commerical 9", 3.875, 8.875, SC_IN, catUSEnvelop);
+	addPageSize("Commerical 10", 4.125, 9.5, SC_IN, catUSEnvelop);
+	addPageSize("Commerical 11", 4.5, 10.375, SC_IN, catUSEnvelop);
+	addPageSize("Commerical 12", 4.75, 11, SC_IN, catUSEnvelop);
+	addPageSize("Commerical 14", 5.0, 11.5, SC_IN, catUSEnvelop);
+
+	// Other Formats
+	PageSizeInfo::Category catOther = PageSizeInfo::Other;
+	addPageSize("Compact Disc", 119.9, 120.7, SC_MM, catOther);
+
 }
 
 void PageSize::printSizeList() const
@@ -432,7 +625,7 @@
 		std::cout << it.key().leftJustified(6).toStdString() << ": ";
 		std::cout << it.value().width << " x " << it.value().height << ",  ";
 		std::cout << it.value().width * unitGetRatioFromIndex(it.value().pageUnitIndex) << " x " << it.value().height * unitGetRatioFromIndex(it.value().pageUnitIndex) << ",  ";
-		std::cout << it.value().trSizeName.toStdString() << std::endl;
+		std::cout << it.value().trSizeName.toStdString() << categoryToString(it.value().category).toStdString() << std::endl;
 	}
 }
 
Index: scribus/pagesize.h
===================================================================
--- scribus/pagesize.h	(Revision 26264)
+++ scribus/pagesize.h	(Arbeitskopie)
@@ -29,17 +29,50 @@
 
 struct PageSizeInfo
 {
+	enum Category {
+
+		Custom = 0, // don't use for presets, it is reserved for custom sizes
+		Favorite = 1, // don't use for presets, it is reserved for user favorite sizes
+		IsoA = 2,
+		IsoB = 3,
+		IsoC = 4,
+		IsoEnvelop = 5,
+		USStandard = 6,
+		USLoose = 7,
+		USEnvelop = 8,
+
+		Book = 20,
+		BusinessCards = 21,
+		Newspaper = 22,
+		Transitional = 23,
+
+		Other = 30,
+
+		Canadian = 40,
+		Chinese = 41,
+		Colombian = 42,
+		French = 43,
+		German = 44,
+		Japanese = 45,
+		Swedish = 46,
+	};
+
 	double width;
 	double height;
 	QString trSizeName;
+	QString sizeName;
+	QString sizeLabel;
 	int pageUnitIndex;
+	Category category;
 };
 
 using PageSizeInfoMap = QMap<QString, PageSizeInfo>;
+using PageSizeCategoriesMap = QMap<PageSizeInfo::Category, QString>;
 
 class SCRIBUS_API PageSize
 {
 public:
+
 	PageSize(const QString&);
 	PageSize(const double, const double);
 	PageSize& operator=(const PageSize& other);
@@ -46,18 +79,19 @@
 	void init(const QString&);
 	QString name() const { return m_pageSizeName; }
 	QString nameTR() const { return m_trPageSizeName; }
+	PageSizeInfo::Category category() { return m_category; };
 	double width() const { return m_width; }
 	double height() const { return m_height; }
 	double originalWidth() const { return m_width * unitGetRatioFromIndex(m_pageUnitIndex); }
 	double originalHeight() const { return m_height * unitGetRatioFromIndex(m_pageUnitIndex); }
 	QString originalUnit() const { return unitGetSuffixFromIndex(m_pageUnitIndex); }
-	QStringList sizeList() const;
-	QStringList sizeTRList() const;
-	QStringList activeSizeList() const;
-	QStringList activeSizeTRList() const;
-	void generateSizeList();
+	QStringList defaultSizesList() const;
+	PageSizeCategoriesMap categories();
+	PageSizeInfoMap sizesByCategory(PageSizeInfo::Category category);
+	PageSizeInfoMap activePageSizes();
+	PageSizeInfoMap pageSizes() const { return m_pageSizeList; };
 	void printSizeList() const;
-	QStringList untransPageSizeList(const QStringList &transList);
+	QString categoryToString(PageSizeInfo::Category category) const;
 
 private:
 	PageSizeInfoMap m_pageSizeList;
@@ -66,6 +100,11 @@
 	int m_pageUnitIndex { -1 };
 	QString m_pageSizeName;
 	QString m_trPageSizeName;
+	PageSizeInfo::Category m_category {PageSizeInfo::Custom};
+
+	void generateSizeList();
+	void addPageSize(const QString name, double width, double height, int unitIndex, PageSizeInfo::Category category);
+
 };
 
 #endif
Index: scribus/prefsmanager.cpp
===================================================================
--- scribus/prefsmanager.cpp	(Revision 26264)
+++ scribus/prefsmanager.cpp	(Arbeitskopie)
@@ -521,7 +521,7 @@
 	appPrefs.imageCachePrefs.maxCacheEntries = 1000;
 	appPrefs.imageCachePrefs.compressionLevel = 1;
 	appPrefs.activePageSizes.clear();
-	appPrefs.activePageSizes << "A3" << "A4" << "A5" << "A6" << "Letter";
+	appPrefs.activePageSizes = defaultPageSize.defaultSizesList();
 
 	//Attribute setup
 	appPrefs.itemAttrPrefs.defaultItemAttributes.clear();
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(Revision 26264)
+++ scribus/scribus.cpp	(Arbeitskopie)
@@ -183,7 +183,6 @@
 #include "ui/javadocs.h"
 #include "ui/layers.h"
 #include "ui/loremipsum.h"
-#include "ui/marginwidget.h"
 #include "ui/mark2item.h"
 #include "ui/mark2mark.h"
 #include "ui/markanchor.h"
@@ -2016,12 +2015,12 @@
 		if (dia->tabSelected() == NewDocDialog::NewDocumentTab)
 		{
 			int facingPages = dia->choosenLayout();
-			int firstPage = dia->firstPage->currentIndex();
+			int firstPage = dia->pageLayouts->firstPage();//firstPage->currentIndex();
 			docSet = dia->startDocSetup->isChecked();
-			double topMargin = dia->marginGroup->top();
-			double bottomMargin = dia->marginGroup->bottom();
-			double leftMargin = dia->marginGroup->left();
-			double rightMargin = dia->marginGroup->right();
+			double topMargin = dia->marginGroup->margins().top();
+			double bottomMargin = dia->marginGroup->margins().bottom();
+			double leftMargin = dia->marginGroup->margins().left();
+			double rightMargin = dia->marginGroup->margins().right();
 			double columnDistance = dia->distance();
 			double pageWidth = dia->pageWidth();
 			double pageHeight = dia->pageHeight();
@@ -2029,15 +2028,8 @@
 			bool autoframes = dia->autoTextFrame->isChecked();
 			int orientation = dia->orientation();
 			int pageCount = dia->pageCountSpinBox->value();
-			QString pagesize;
-			if (dia->pageSizeComboBox->currentText() == CommonStrings::trCustomPageSize)
-				pagesize = CommonStrings::customPageSize;
-			else
-			{
-				PageSize ps2(dia->pageSizeComboBox->currentText());
-				pagesize = ps2.name();
-			}
-			doFileNew(pageWidth, pageHeight, topMargin, leftMargin, rightMargin, bottomMargin, columnDistance, numberCols, autoframes, facingPages, dia->unitOfMeasureComboBox->currentIndex(), firstPage, orientation, 1, pagesize, true, pageCount, true, dia->marginGroup->getMarginPreset());
+			QString pagesize = dia->pageSizeName();
+			doFileNew(pageWidth, pageHeight, topMargin, leftMargin, rightMargin, bottomMargin, columnDistance, numberCols, autoframes, facingPages, dia->unitOfMeasureComboBox->currentIndex(), firstPage, orientation, 1, pagesize, true, pageCount, true, dia->marginGroup->marginPreset());
 			doc->setPageSetFirstPage(facingPages, firstPage);
 			doc->bleeds()->set(dia->bleedTop(), dia->bleedLeft(), dia->bleedBottom(), dia->bleedRight());
 			HaveNewDoc();
@@ -2099,12 +2091,12 @@
 		return false;
 
 	int facingPages = dia->choosenLayout();
-	int firstPage = dia->firstPage->currentIndex();
+	int firstPage = dia->pageLayouts->firstPage();
 	bool docSet = dia->startDocSetup->isChecked();
-	double topMargin = dia->marginGroup->top();
-	double bottomMargin = dia->marginGroup->bottom();
-	double leftMargin = dia->marginGroup->left();
-	double rightMargin = dia->marginGroup->right();
+	double topMargin = dia->marginGroup->margins().top();
+	double bottomMargin = dia->marginGroup->margins().bottom();
+	double leftMargin = dia->marginGroup->margins().left();
+	double rightMargin = dia->marginGroup->margins().right();
 	double columnDistance = dia->distance();
 	double pageWidth = dia->pageWidth();
 	double pageHeight = dia->pageHeight();
@@ -2112,16 +2104,10 @@
 	bool autoframes = dia->autoTextFrame->isChecked();
 	int orientation = dia->orientation();
 	int pageCount = dia->pageCountSpinBox->value();
-	QString pagesize;
-	if (dia->pageSizeComboBox->currentText() == CommonStrings::trCustomPageSize)
-		pagesize = CommonStrings::customPageSize;
-	else
+	QString pagesize = dia->pageSizeName();
+
+	if (doFileNew(pageWidth, pageHeight, topMargin, leftMargin, rightMargin, bottomMargin, columnDistance, numberCols, autoframes, facingPages, dia->unitOfMeasureComboBox->currentIndex(), firstPage, orientation, 1, pagesize, true, pageCount, true, dia->marginGroup->marginPreset()))
 	{
-		PageSize ps2(dia->pageSizeComboBox->currentText());
-		pagesize = ps2.name();
-	}
-	if (doFileNew(pageWidth, pageHeight, topMargin, leftMargin, rightMargin, bottomMargin, columnDistance, numberCols, autoframes, facingPages, dia->unitOfMeasureComboBox->currentIndex(), firstPage, orientation, 1, pagesize, true, pageCount, true, dia->marginGroup->getMarginPreset()))
-	{
 		doc->setPageSetFirstPage(facingPages, firstPage);
 		doc->bleeds()->set(dia->bleedTop(), dia->bleedLeft(), dia->bleedBottom(), dia->bleedRight());
 		m_mainWindowStatusLabel->setText( tr("Ready"));
Index: scribus/ui/delegates/sclistitemdelegate.cpp
===================================================================
--- scribus/ui/delegates/sclistitemdelegate.cpp	(Revision 26264)
+++ scribus/ui/delegates/sclistitemdelegate.cpp	(Arbeitskopie)
@@ -33,6 +33,9 @@
 	cHighlight.setAlphaF(0.2f);
 	QBrush fillSelected(cHighlight);
 
+	QFont subFont = QFont();
+	subFont.setPointSize(8);
+
 	if(m_style == Style::Simple)
 	{
 		radius = 0;
@@ -42,6 +45,7 @@
 	}
 
 	QTextOption tOptions;
+	QTextOption sOptions;
 
 	QRect rIcon = option.rect;
 	QRect rText = option.rect;
@@ -68,6 +72,7 @@
 	// Item Data
 	QIcon ic = qvariant_cast<QIcon>(index.data(Qt::DecorationRole));
 	QString title = index.data(Qt::DisplayRole).toString();
+	QString subTitle = index.data(Qt::UserRole).toString();
 
 	switch (m_textPosition)
 	{
@@ -80,7 +85,8 @@
 			rIcon = QRect(p.x() + hSpace, p.y() + vSpace, m_iconSize.width(), m_iconSize.height());
 
 			rText = option.rect.adjusted(padding, padding + m_iconSize.height(), -padding, -padding);
-			tOptions.setFlags(QFlag(Qt::AlignBottom|Qt::AlignHCenter|Qt::TextWordWrap));
+			tOptions.setFlags(QFlag(Qt::AlignTop|Qt::AlignHCenter|Qt::TextWordWrap));
+			sOptions.setFlags(QFlag(Qt::AlignBottom|Qt::AlignHCenter|Qt::TextWordWrap));
 		}
 		break;
 	case TextPosition::Right:
@@ -89,7 +95,8 @@
 			rIcon = QRect(p.x() + padding, p.y() + padding, m_iconSize.width(), m_iconSize.height());
 
 			rText = option.rect.adjusted(padding * 2 + m_iconSize.width(), padding, -padding, -padding);
-			tOptions.setFlags(QFlag(Qt::AlignVCenter|Qt::AlignLeft|Qt::TextWordWrap));
+			tOptions.setFlags(QFlag(Qt::AlignTop|Qt::AlignLeft|Qt::TextWordWrap));
+			sOptions.setFlags(QFlag(Qt::AlignBottom|Qt::AlignLeft|Qt::TextWordWrap));
 		}
 		break;
 	}
@@ -103,9 +110,15 @@
 	// Label
 	if (!title.isEmpty())
 	{
+		QRect rectNorm = rText.normalized();
+
 		painter->setPen(fontPen);
+		painter->setBrush(Qt::NoBrush);
 		painter->setFont(QFont());
-		painter->drawText(rText, tOptions.flags(), title, &rText);
+		painter->drawText(rText, tOptions.flags(), title, &rectNorm);
+
+		painter->setFont(subFont);
+		painter->drawText(rText, sOptions.flags(), subTitle);
 	}
 
 	painter->restore();
Index: scribus/ui/inspage.cpp
===================================================================
--- scribus/ui/inspage.cpp	(Revision 26264)
+++ scribus/ui/inspage.cpp	(Arbeitskopie)
@@ -34,11 +34,11 @@
 	setWindowIcon(IconManager::instance().loadIcon("AppIcon.png"));
 
 	dialogLayout = new QVBoxLayout(this);
-	dialogLayout->setSpacing(6);
-	dialogLayout->setContentsMargins(9, 9, 9, 9);
+	dialogLayout->setSpacing(4);
+	dialogLayout->setContentsMargins(8, 8, 8, 8);
 
 	whereLayout = new QGridLayout();
-	whereLayout->setSpacing(6);
+	whereLayout->setSpacing(4);
 	whereLayout->setContentsMargins(0, 0, 0, 0);
 
 	insCountData = new QSpinBox(this);
@@ -75,8 +75,8 @@
 	masterPageGroup->setTitle( tr( "Master Pages" ) );
 	masterPageLayout = new QGridLayout( masterPageGroup );
 	masterPageLayout->setAlignment(Qt::AlignTop);
-	masterPageLayout->setSpacing(6);
-	masterPageLayout->setContentsMargins(9, 9, 9, 9);
+	masterPageLayout->setSpacing(4);
+	masterPageLayout->setContentsMargins(8, 8, 8, 8);
 	if (m_doc->pagePositioning() == 0)
 	{
 		QComboBox* pageData = new QComboBox(masterPageGroup);
@@ -230,31 +230,18 @@
 	dsGroupBox7 = new QGroupBox( this );
 	dsGroupBox7->setTitle( tr( "Page Size" ) );
 	dsGroupBox7Layout = new QGridLayout(dsGroupBox7);
-	dsGroupBox7Layout->setSpacing(6);
-	dsGroupBox7Layout->setContentsMargins(9, 9, 9, 9);
+	dsGroupBox7Layout->setSpacing(4);
+	dsGroupBox7Layout->setContentsMargins(8, 8, 8, 8);
 	textLabel1 = new QLabel( tr( "&Size:" ), dsGroupBox7);
-	dsGroupBox7Layout->addWidget(textLabel1, 0, 0);
-
+	dsGroupBox7Layout->addWidget(textLabel1, 0, 0, Qt::AlignTop | Qt::AlignRight);
 	QScopedPointer<PageSize> ps(new PageSize(m_doc->pageSize()));
 	prefsPageSizeName = ps->name();
-	sizeQComboBox = new QComboBox(dsGroupBox7);
-	QStringList insertList(ps->activeSizeTRList());
-	if (insertList.indexOf(prefsPageSizeName) == -1)
-		insertList << prefsPageSizeName;
-	insertList.sort();
-	insertList << CommonStrings::trCustomPageSize;
-	sizeQComboBox->addItems(insertList);
-	int sizeIndex = insertList.indexOf(ps->nameTR());
-	if (sizeIndex != -1)
-		sizeQComboBox->setCurrentIndex(sizeIndex);
-	else
-		sizeQComboBox->setCurrentIndex(sizeQComboBox->count() - 1);
-
-	textLabel1->setBuddy(sizeQComboBox);
-	dsGroupBox7Layout->addWidget(sizeQComboBox, 0, 1, 1, 3);
-
+	pageSizeSelector = new PageSizeSelector(dsGroupBox7);
+	pageSizeSelector->setPageSize(m_doc->pageSize());
+	textLabel1->setBuddy(pageSizeSelector);
+	dsGroupBox7Layout->addWidget(pageSizeSelector, 0, 1);
 	textLabel2 = new QLabel( tr( "Orie&ntation:" ), dsGroupBox7);
-	dsGroupBox7Layout->addWidget(textLabel2, 1, 0);
+	dsGroupBox7Layout->addWidget(textLabel2, 1, 0, Qt::AlignRight);
 
 	orientationQComboBox = new QComboBox(dsGroupBox7);
 	orientationQComboBox->addItem( tr( "Portrait" ) );
@@ -261,13 +248,13 @@
 	orientationQComboBox->addItem( tr( "Landscape" ) );
 	orientationQComboBox->setCurrentIndex(m_doc->pageOrientation() );
 	textLabel2->setBuddy(orientationQComboBox);
-	dsGroupBox7Layout->addWidget(orientationQComboBox, 1, 1, 1, 3);
+	dsGroupBox7Layout->addWidget(orientationQComboBox, 1, 1);
 
 	widthSpinBox = new ScrSpinBox(1, 10000, dsGroupBox7, m_doc->unitIndex());
 	widthQLabel = new QLabel( tr( "&Width:" ), dsGroupBox7);
 	widthSpinBox->setValue(m_doc->pageWidth() * m_doc->unitRatio());
 	widthQLabel->setBuddy(widthSpinBox);
-	dsGroupBox7Layout->addWidget(widthQLabel, 2, 0);
+	dsGroupBox7Layout->addWidget(widthQLabel, 2, 0, Qt::AlignRight);
 	dsGroupBox7Layout->addWidget(widthSpinBox, 2, 1);
 
 	heightSpinBox = new ScrSpinBox(1, 10000, dsGroupBox7, m_doc->unitIndex());
@@ -274,17 +261,17 @@
 	heightSpinBox->setValue(m_doc->pageHeight() * m_doc->unitRatio());
 	heightQLabel = new QLabel( tr( "&Height:" ), dsGroupBox7);
 	heightQLabel->setBuddy(heightSpinBox);
-	dsGroupBox7Layout->addWidget(heightQLabel, 3, 0);
+	dsGroupBox7Layout->addWidget(heightQLabel, 3, 0, Qt::AlignRight);
 	dsGroupBox7Layout->addWidget(heightSpinBox, 3, 1);
 
 	moveObjectsCheckBox = new QCheckBox( dsGroupBox7);
 	moveObjectsCheckBox->setText( tr( "Move Objects with their Page" ) );
 	moveObjectsCheckBox->setChecked(true);
-	dsGroupBox7Layout->addWidget(moveObjectsCheckBox, 4, 0, 1, 4);
+	dsGroupBox7Layout->addWidget(moveObjectsCheckBox, 4, 0, 1, 2);
 	dialogLayout->addWidget(dsGroupBox7);
 
 	dsGroupBox7->setEnabled(false);
-	bool b = (sizeQComboBox->currentText() == CommonStrings::trCustomPageSize);
+	bool b = (pageSizeSelector->pageSizeTR() == CommonStrings::trCustomPageSize);
 	heightSpinBox->setEnabled(b);
 	widthSpinBox->setEnabled(b);
 
@@ -298,7 +285,7 @@
 	connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
 	connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
 	connect(orientationQComboBox, SIGNAL(activated(int)), this, SLOT(setOrientation(int)));
-	connect(sizeQComboBox, SIGNAL(textActivated(QString)), this, SLOT(setSize(QString)));
+	connect(pageSizeSelector, SIGNAL(pageSizeChanged(QString)), this, SLOT(setSize(QString)));
 	connect(overrideMPSizingCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableSizingControls(int)));
 }
 
@@ -325,10 +312,10 @@
 void InsPage::setOrientation(int ori)
 {
 	double br;
-	setSize(sizeQComboBox->currentText());
+	setSize(pageSizeSelector->pageSizeTR());
 	if (ori == 0)
 	{
-		if (sizeQComboBox->currentText() == CommonStrings::trCustomPageSize)
+		if (pageSizeSelector->pageSizeTR() == CommonStrings::trCustomPageSize)
 		{
 			br = widthSpinBox->value();
 			widthSpinBox->setValue(heightSpinBox->value());
Index: scribus/ui/inspage.h
===================================================================
--- scribus/ui/inspage.h	(Revision 26264)
+++ scribus/ui/inspage.h	(Arbeitskopie)
@@ -8,6 +8,7 @@
 #define INSPAGE_H
 
 #include "scribusapi.h"
+#include "widgets/pagesizeselector.h"
 #include <QDialog>
 #include <QDialogButtonBox>
 #include <QList>
@@ -71,7 +72,8 @@
 	QLabel*	    heightQLabel { nullptr };
 	QLabel*     textLabel1 { nullptr };
 	QLabel*     textLabel2 { nullptr };
-	QComboBox*  sizeQComboBox { nullptr };
+	PageSizeSelector* pageSizeSelector { nullptr };
+//	QComboBox*  sizeQComboBox { nullptr };
 	QComboBox*  orientationQComboBox { nullptr };
 	QCheckBox*  moveObjectsCheckBox { nullptr };
 	QCheckBox*  overrideMPSizingCheckBox { nullptr };
Index: scribus/ui/marginwidget.cpp
===================================================================
--- scribus/ui/marginwidget.cpp	(Revision 26264)
+++ scribus/ui/marginwidget.cpp	(nicht existent)
@@ -1,623 +0,0 @@
-/*
-For general Scribus (>=1.3.2) copyright and licensing information please refer
-to the COPYING file provided with the program. Following this notice may exist
-a copyright and/or license notice that predates the release of Scribus 1.3.2
-for which a new license (GPL+exception) is in place.
-*/
-#include "marginwidget.h"
-
-#include <QHBoxLayout>
-#include <QGridLayout>
-#include <QLabel>
-#include <QToolTip>
-#include <QCheckBox>
-#include <QLabel>
-#include <QPushButton>
-
-#include "scrspinbox.h"
-#include "units.h"
-#include "ui/useprintermarginsdialog.h"
-
-
-MarginWidget::MarginWidget( QWidget* parent, const QString& /*title*/, const MarginStruct* margs, int unitIndex, bool showChangeAll, bool showBleeds) : QTabWidget(parent),
-	m_useBleeds(showBleeds)
-{
-	marginData = *margs;
-	m_savedMargins = *margs;
-	m_savedPresetItem = PresetLayout::none; //we don't recheck if we are using a layout but always start at none
-	marginPage = new QWidget(this);
-
-	presetCombo = new PresetLayout(marginPage);
-	presetLabel = new QLabel( tr("Preset Layouts:"), marginPage);
-	presetLabel->setBuddy(presetCombo);
-	m_unitIndex = unitIndex;
-	m_unitRatio = unitGetRatioFromIndex(unitIndex);
-	leftR = new ScrSpinBox( 0, 1000, marginPage, unitIndex );
-	rightR = new ScrSpinBox( 0, 1000, marginPage, unitIndex );
-	topR = new ScrSpinBox( 0, 1000, marginPage, unitIndex );
-	bottomR = new ScrSpinBox( 0, 1000, marginPage, unitIndex );
-	updateMarginSpinValues();
-
-	bText = new QLabel( tr( "&Bottom:" ), marginPage);
-	bText->setBuddy(bottomR);
-	tText = new QLabel( tr( "&Top:" ), marginPage);
-	tText->setBuddy(topR);
-	rText = new QLabel( tr( "&Right:" ), marginPage);
-	rText->setBuddy(rightR);
-	lText = new QLabel( tr( "&Left:" ), marginPage);
-	lText->setBuddy(leftR);
-
-	linkMargins = new LinkButton( marginPage );
-	linkMargins->setCheckable( true );
-	linkMargins->setChecked(false);
-	linkMargins->setAutoRaise( true );
-	linkMargins->setMinimumSize( QSize( 15, 0 ) );
-	linkMargins->setMaximumSize( QSize( 15, 32767 ) );
-
-	// layout
-	GroupLayout = new QGridLayout( marginPage );
-	GroupLayout->setSpacing(6);
-	GroupLayout->setContentsMargins(9, 9, 9, 9);
-	GroupLayout->addWidget(presetLabel, 0, 0);
-	GroupLayout->addWidget(presetCombo, 0, 1);
-	GroupLayout->addWidget( leftR, 1, 1 );
-	GroupLayout->addWidget( rightR, 2, 1 );
-	GroupLayout->addWidget( topR, 3, 1 );
-	GroupLayout->addWidget( bottomR, 4, 1 );
-	GroupLayout->addWidget( lText, 1, 0 );
-	GroupLayout->addWidget( rText, 2, 0 );
-	GroupLayout->addWidget( tText, 3, 0 );
-	GroupLayout->addWidget( bText, 4, 0 );
-	GroupLayout->addWidget( linkMargins, 1, 2, 4, 1 );
-	if (showChangeAll)
-	{
-		marginsForPagesLayout = new QHBoxLayout;
-		marginsForPagesLayout->setContentsMargins(9, 9, 9, 9);
-		marginsForPagesLayout->setSpacing(6);
-		marginsForPages = new QLabel( tr( "Apply settings to:" ), marginPage );
-		marginsForPagesLayout->addWidget(marginsForPages);
-		marginsForAllPages = new QCheckBox( marginPage );
-		marginsForAllPages->setText( tr( "All Document Pages" ) );
-		marginsForAllPages->setChecked( false );
-		marginsForPagesLayout->addWidget(marginsForAllPages);
-		marginsForAllMasterPages = new QCheckBox( marginPage );
-		marginsForAllMasterPages->setText( tr( "All Master Pages" ) );
-		marginsForAllMasterPages->setChecked( false );
-		marginsForPagesLayout->addWidget(marginsForAllMasterPages);
-		GroupLayout->addLayout( marginsForPagesLayout, 6, 0, 1, 2 );
-		marginsForAllPages->setToolTip( "<qt>" + tr( "Apply the margin changes to all existing pages in the document" ) + "</qt>" );
-		marginsForAllMasterPages->setToolTip( "<qt>" + tr( "Apply the margin changes to all existing master pages in the document" ) + "</qt>" );
-	}
-
-	usePrinterMarginsButton = nullptr;
-	usePrinterMarginsButton = new QPushButton( tr("Printer Margins..."),marginPage );
-	GroupLayout->addWidget( usePrinterMarginsButton, 5, 1 );
-	usePrinterMarginsButton->setToolTip( "<qt>" + tr( "Import the margins for the selected page size from the available printers" ) + "</qt>");
-	connect(usePrinterMarginsButton, SIGNAL(clicked()), this, SLOT(setMarginsToPrinterMargins()));
-
-	addTab(marginPage, tr("Margin Guides"));
-
-	if (m_useBleeds)
-	{
-		bleedPage = new QWidget(this);
-		BleedGroupLayout = new QGridLayout( bleedPage );
-		BleedGroupLayout->setSpacing(6);
-		BleedGroupLayout->setContentsMargins(9, 9, 9, 9);
-		BleedGroupLayout->setAlignment( Qt::AlignTop );
-		BleedTxt3 = new QLabel( bleedPage );
-		BleedGroupLayout->addWidget( BleedTxt3, 0, 0 );
-		BleedLeft = new ScrSpinBox( 0, 3000*m_unitRatio, bleedPage, unitIndex );
-		BleedGroupLayout->addWidget( BleedLeft, 0, 1 );
-		BleedTxt4 = new QLabel( bleedPage );
-		BleedGroupLayout->addWidget( BleedTxt4, 1, 0 );
-		BleedRight = new ScrSpinBox( 0, 3000*m_unitRatio, bleedPage, unitIndex );
-		BleedGroupLayout->addWidget( BleedRight, 1, 1 );
-		BleedTxt1 = new QLabel( bleedPage );
-		BleedTxt1->setText( tr( "Top:" ) );
-		BleedGroupLayout->addWidget( BleedTxt1, 2, 0 );
-		BleedTop = new ScrSpinBox( 0, 3000*m_unitRatio, bleedPage, unitIndex );
-		BleedGroupLayout->addWidget( BleedTop, 2, 1 );
-		BleedTxt2 = new QLabel( bleedPage );
-		BleedTxt2->setText( tr( "Bottom:" ) );
-		BleedGroupLayout->addWidget( BleedTxt2, 3, 0 );
-		BleedBottom = new ScrSpinBox( 0, 3000*m_unitRatio, bleedPage, unitIndex );
-		BleedGroupLayout->addWidget( BleedBottom, 3, 1 );
-		linkBleeds = new LinkButton( bleedPage );
-/** Fix Me to move this to the prefsmanager.cpp someday */		
-		linkBleeds->setCheckable( true );
-		linkBleeds->setChecked(true);
-		linkBleeds->setAutoRaise( true );
-		linkBleeds->setMinimumSize( QSize( 15, 0 ) );
-		linkBleeds->setMaximumSize( QSize( 15, 32767 ) );
-		BleedGroupLayout->addWidget( linkBleeds, 0, 2, 4, 1 );
-		BleedTop->setToolTip( "<qt>" + tr( "Distance for bleed from the top of the physical page" ) + "</qt>" );
-		BleedBottom->setToolTip( "<qt>" + tr( "Distance for bleed from the bottom of the physical page" ) + "</qt>" );
-		BleedLeft->setToolTip( "<qt>" + tr( "Distance for bleed from the left of the physical page" ) + "</qt>" );
-		BleedRight->setToolTip( "<qt>" + tr( "Distance for bleed from the right of the physical page" )  + "</qt>");
-		linkBleeds->setToolTip( "<qt>" + tr( "Ensure all bleeds have the same value" )  + "</qt>");
-		connect(BleedLeft, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-		connect(BleedRight, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-		connect(BleedTop, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-		connect(BleedBottom, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-		connect(linkBleeds, SIGNAL(clicked()), this, SLOT(slotLinkBleeds()));
-		addTab(bleedPage, tr("Bleeds"));
-	}
-
-	// hints
-	topR->setToolTip( "<qt>" + tr( "Distance between the top margin guide and the edge of the page" ) + "</qt>");
-	bottomR->setToolTip( "<qt>" + tr( "Distance between the bottom margin guide and the edge of the page" ) + "</qt>");
-	leftR->setToolTip( "<qt>" + tr( "Distance between the left margin guide and the edge of the page. If a double-sided, 3 or 4-fold layout is selected, this margin space can be used to achieve the correct margins for binding.") + "</qt>");
-	rightR->setToolTip( "<qt>" + tr( "Distance between the right margin guide and the edge of the page. If a double-sided, 3 or 4-fold layout is selected, this margin space can be used to achieve the correct margins for binding.") + "</qt>");
-	linkMargins->setToolTip( "<qt>" + tr( "Ensure all margins have the same value") + "</qt>");
-
-	// signals&slots
-	connect(topR, SIGNAL(valueChanged(double)), this, SLOT(setTop()));
-	connect(bottomR, SIGNAL(valueChanged(double)), this, SLOT(setBottom()));
-	connect(leftR, SIGNAL(valueChanged(double)), this, SLOT(setLeft()));
-	connect(rightR, SIGNAL(valueChanged(double)), this, SLOT(setRight()));
-	connect(presetCombo, SIGNAL(activated(int)), this, SLOT(setPreset()));
-	connect(linkMargins, SIGNAL(clicked()), this, SLOT(slotLinkMargins()));
-}
-
-void MarginWidget::slotLinkBleeds()
-{
-	disconnect(BleedLeft, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-	disconnect(BleedRight, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-	disconnect(BleedTop, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-	disconnect(BleedBottom, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-
-	double bleedValue = BleedLeft->value();
-	if (BleedLeft->hasFocus())
-	{
-		BleedLeft->clearFocus();
-		bleedValue = BleedLeft->value();
-	}
-	if (BleedRight->hasFocus())
-	{
-		BleedRight->clearFocus();
-		bleedValue = BleedRight->value();
-	}
-	if (BleedTop->hasFocus())
-	{
-		BleedTop->clearFocus();
-		bleedValue = BleedTop->value();
-	}
-	if (BleedBottom->hasFocus())
-	{
-		BleedBottom->clearFocus();
-		bleedValue = BleedBottom->value();
-	}
-
-	if (linkBleeds->isChecked())
-	{
-		BleedLeft->setValue(bleedValue);
-		BleedTop->setValue(bleedValue);
-		BleedBottom->setValue(bleedValue);
-		BleedRight->setValue(bleedValue);
-	}
-
-	connect(BleedLeft, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-	connect(BleedRight, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-	connect(BleedTop, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-	connect(BleedBottom, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-}
-
-void MarginWidget::changeBleeds()
-{
-	if (linkBleeds->isChecked())
-	{
-		double val = 0.0;
-		if (BleedTop == sender())
-			val = BleedTop->value();
-		else if (BleedBottom == sender())
-			val = BleedBottom->value();
-		else if (BleedLeft == sender())
-			val = BleedLeft->value();
-		else if (BleedRight == sender())
-			val = BleedRight->value();
-		val = val / m_unitRatio;
-		MarginStruct v(val,val,val,val);
-		setNewBleeds(v);
-	}
-}
-
-void MarginWidget::setFacingPages(bool facing, int pagetype)
-{
-	m_facingPages = facing;
-	m_pageType = pagetype;
-	lText->setText(facing ? tr( "&Inside:" ) : tr( "&Left:" ));
-	rText->setText(facing ? tr( "O&utside:" ) : tr( "&Right:" ));
-	if (m_useBleeds)
-	{
-		if (facing)
-		{
-			BleedTxt3->setText( tr( "Inside:" ) );
-			BleedTxt4->setText( tr( "Outside:" ) );
-		}
-		else
-		{
-			BleedTxt3->setText( tr( "Left:" ) );
-			BleedTxt4->setText( tr( "Right:" ) );
-		}
-	}
-	setPreset();
-}
-
-void MarginWidget::setPageWidthHeight(double width, double height)
-{
-	rightR->setMaximum(qMax(0.0, width * m_unitRatio - leftR->value()));
-	leftR->setMaximum(qMax(0.0, width * m_unitRatio - rightR->value()));
-	m_pageWidth = width;
-	topR->setMaximum(qMax(0.0, height * m_unitRatio - bottomR->value()));
-	bottomR->setMaximum(qMax(0.0, height * m_unitRatio - topR->value()));
-	m_pageHeight = height;
-	setPreset();
-}
-
-void MarginWidget::setPageWidth(double width)
-{
-	rightR->setMaximum(qMax(0.0, width * m_unitRatio - leftR->value()));
-	leftR->setMaximum(qMax(0.0,width * m_unitRatio - rightR->value()));
-	m_pageWidth = width;
-	setPreset();
-}
-
-void MarginWidget::setPageHeight(double height)
-{
-	topR->setMaximum(qMax(0.0, height * m_unitRatio - bottomR->value()));
-	bottomR->setMaximum(qMax(0.0,height * m_unitRatio - topR->value()));
-	m_pageHeight = height;
-	setPreset();
-}
-
-void MarginWidget::setTop()
-{
-	double newVal = topR->value() / m_unitRatio;
-	bottomR->setMaximum(qMax(0.0, m_pageHeight * m_unitRatio - topR->value()));
-	if (linkMargins->isChecked() && m_savedPresetItem == PresetLayout::none)
-	{
-		marginData.set(newVal, newVal, newVal, newVal);
-		updateMarginSpinValues();
-	}
-	else
-		marginData.setTop(newVal);
-	setPreset();
-}
-
-void MarginWidget::setBottom()
-{
-	double newVal = bottomR->value() / m_unitRatio;
-	topR->setMaximum(qMax(0.0, m_pageHeight * m_unitRatio - bottomR->value()));
-	if (linkMargins->isChecked() && m_savedPresetItem == PresetLayout::none)
-	{
-		marginData.set(newVal, newVal, newVal, newVal);
-		updateMarginSpinValues();
-	}
-	else
-		marginData.setBottom(newVal);
-	setPreset();
-}
-
-void MarginWidget::setLeft()
-{
-	double newVal = leftR->value() / m_unitRatio;
-	rightR->setMaximum(qMax(0.0, m_pageWidth * m_unitRatio - leftR->value()));
-	if (linkMargins->isChecked() && m_savedPresetItem == PresetLayout::none)
-	{
-		marginData.set(newVal, newVal, newVal, newVal);
-		updateMarginSpinValues();
-	}
-	else
-		marginData.setLeft(newVal);
-	setPreset();
-}
-
-void MarginWidget::setRight()
-{
-	double newVal = rightR->value() / m_unitRatio;
-	leftR->setMaximum(qMax(0.0, m_pageWidth * m_unitRatio - rightR->value()));
-	if (linkMargins->isChecked() && m_savedPresetItem == PresetLayout::none)
-	{
-		marginData.set(newVal, newVal, newVal, newVal);
-		updateMarginSpinValues();
-	}
-	else
-		marginData.setRight(newVal);
-	setPreset();
-}
-
-void MarginWidget::setNewUnit(int newUnitIndex)
-{
-	disconnect(topR, SIGNAL(valueChanged(double)), this, SLOT(setTop()));
-	disconnect(bottomR, SIGNAL(valueChanged(double)), this, SLOT(setBottom()));
-	disconnect(leftR, SIGNAL(valueChanged(double)), this, SLOT(setLeft()));
-	disconnect(rightR, SIGNAL(valueChanged(double)), this, SLOT(setRight()));
-	m_unitIndex = newUnitIndex;
-	m_unitRatio = unitGetRatioFromIndex(newUnitIndex);
-	topR->setNewUnit(newUnitIndex);
-	bottomR->setNewUnit(newUnitIndex);
-	leftR->setNewUnit(newUnitIndex);
-	rightR->setNewUnit(newUnitIndex);
-	
-	if (m_useBleeds)
-	{
-		disconnect(BleedLeft, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-		disconnect(BleedRight, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-		disconnect(BleedTop, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-		disconnect(BleedBottom, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-		BleedBottom->setNewUnit(newUnitIndex);
-		BleedTop->setNewUnit(newUnitIndex);
-		BleedRight->setNewUnit(newUnitIndex);
-		BleedLeft->setNewUnit(newUnitIndex);
-		connect(BleedLeft, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-		connect(BleedRight, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-		connect(BleedTop, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-		connect(BleedBottom, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-	}
-	connect(topR, SIGNAL(valueChanged(double)), this, SLOT(setTop()));
-	connect(bottomR, SIGNAL(valueChanged(double)), this, SLOT(setBottom()));
-	connect(leftR, SIGNAL(valueChanged(double)), this, SLOT(setLeft()));
-	connect(rightR, SIGNAL(valueChanged(double)), this, SLOT(setRight()));
-}
-
-void MarginWidget::setPreset()
-{
-	disconnect(topR, SIGNAL(valueChanged(double)), this, SLOT(setTop()));
-	disconnect(bottomR, SIGNAL(valueChanged(double)), this, SLOT(setBottom()));
-	disconnect(leftR, SIGNAL(valueChanged(double)), this, SLOT(setLeft()));
-	disconnect(rightR, SIGNAL(valueChanged(double)), this, SLOT(setRight()));
-	if (m_savedPresetItem == PresetLayout::none)
-		m_savedMargins = marginData;
-	int item = presetCombo->currentIndex();
-
-	MarginStruct marg = presetCombo->getMargins(item, m_pageWidth, m_pageHeight, leftR->value() / m_unitRatio);
-	presetCombo->setEnabled(m_facingPages);
-
-	bool restoringValues = false;
-	if ((item == PresetLayout::none) && (m_savedPresetItem != PresetLayout::none))
-	{
-		marg = m_savedMargins;
-		restoringValues = true;
-	}
-	if (restoringValues || (presetCombo->needUpdate() && m_facingPages))
-	{
-		marginData.set(qMax(0.0, marg.top()), qMax(0.0, marg.left()), qMax(0.0, marg.bottom()), qMax(0.0, marg.right()));
-		updateMarginSpinValues();
-		
-		bottomR->setMaximum(qMax(0.0, m_pageHeight * m_unitRatio - topR->value()));
-		topR->setMaximum(qMax(0.0, m_pageHeight * m_unitRatio - bottomR->value()));
-		rightR->setMaximum(qMax(0.0, m_pageWidth * m_unitRatio - leftR->value()));
-		leftR->setMaximum(qMax(0.0, m_pageWidth * m_unitRatio - rightR->value()));
-		rightR->setEnabled(restoringValues);
-		topR->setEnabled(restoringValues);
-		bottomR->setEnabled(restoringValues);
-	}
-	else
-	{
-		rightR->setEnabled(true);
-		topR->setEnabled(true);
-		bottomR->setEnabled(true);
-	}
-	if (m_pageType == 1)
-		rightR->setEnabled(false);
-	leftR->setEnabled(item != PresetLayout::nineparts);
-	if (item != PresetLayout::none)
-		linkMargins->setChecked(false);
-	linkMargins->setEnabled(item == PresetLayout::none || !presetCombo->isEnabled());
-	connect(topR, SIGNAL(valueChanged(double)), this, SLOT(setTop()));
-	connect(bottomR, SIGNAL(valueChanged(double)), this, SLOT(setBottom()));
-	connect(leftR, SIGNAL(valueChanged(double)), this, SLOT(setLeft()));
-	connect(rightR, SIGNAL(valueChanged(double)), this, SLOT(setRight()));
-	m_savedPresetItem = item;
-}
-
-void MarginWidget::setPageSize(const QString& pageSize)
-{
-	m_pageSize = pageSize;
-}
-
-void MarginWidget::setMarginsToPrinterMargins()
-{
-	QSizeF pageDimensions(m_pageWidth, m_pageHeight);
-	UsePrinterMarginsDialog upm(parentWidget(), pageDimensions, m_pageSize, unitGetRatioFromIndex(m_unitIndex), unitGetSuffixFromIndex(m_unitIndex));
-	if (upm.exec() != QDialog::Accepted)
-		return;
-
-	double t, b, l, r;
-	upm.getNewPrinterMargins(t, b, l, r);
-	presetCombo->setCurrentIndex(PresetLayout::none);
-		
-	marginData.setTop(t);
-	marginData.setBottom(b);
-	marginData.setLeft(l);
-	marginData.setRight(r);
-	updateMarginSpinValues();
-
-	bottomR->setMaximum((qMax(0.0, m_pageHeight - t) * m_unitRatio));
-	topR->setMaximum((qMax(0.0, m_pageHeight - b) * m_unitRatio));
-	rightR->setMaximum((qMax(0.0, m_pageWidth - l) * m_unitRatio));
-	leftR->setMaximum((qMax(0.0, m_pageWidth - r) * m_unitRatio));
-
-	rightR->setEnabled(true);
-	topR->setEnabled(true);
-	bottomR->setEnabled(true);
-}
-
-double MarginWidget::top() const
-{
-	return marginData.top();
-}
-
-double MarginWidget::bottom() const
-{
-	return marginData.bottom();
-}
-
-double MarginWidget::left() const
-{
-	return marginData.left();
-}
-
-double MarginWidget::right() const
-{
-	return marginData.right();
-}
-
-void MarginWidget::setNewMargins(MarginStruct &m)
-{
-	disconnect(topR, SIGNAL(valueChanged(double)), this, SLOT(setTop()));
-	disconnect(bottomR, SIGNAL(valueChanged(double)), this, SLOT(setBottom()));
-	disconnect(leftR, SIGNAL(valueChanged(double)), this, SLOT(setLeft()));
-	disconnect(rightR, SIGNAL(valueChanged(double)), this, SLOT(setRight()));
-	marginData = m;
-	updateMarginSpinValues();
-	connect(topR, SIGNAL(valueChanged(double)), this, SLOT(setTop()));
-	connect(bottomR, SIGNAL(valueChanged(double)), this, SLOT(setBottom()));
-	connect(leftR, SIGNAL(valueChanged(double)), this, SLOT(setLeft()));
-	connect(rightR, SIGNAL(valueChanged(double)), this, SLOT(setRight()));
-}
-
-void MarginWidget::setMarginPreset(int p)
-{
-	disconnect(presetCombo, SIGNAL(activated(int)), this, SLOT(setPreset()));
-	m_savedPresetItem = p;
-	presetCombo->setCurrentIndex(p);
-	if (m_savedPresetItem == PresetLayout::none)
-		m_savedMargins = marginData;
-	int item = presetCombo->currentIndex();
-	presetCombo->setEnabled(m_facingPages);
-	bool restoringValues = false;
-	if ((item == PresetLayout::none) && (m_savedPresetItem != PresetLayout::none))
-	{
-		restoringValues = true;
-	}
-	if (restoringValues || (presetCombo->needUpdate() && m_facingPages))
-	{
-		rightR->setEnabled(restoringValues);
-		topR->setEnabled(restoringValues);
-		bottomR->setEnabled(restoringValues);
-	}
-	else
-	{
-		rightR->setEnabled(true);
-		topR->setEnabled(true);
-		bottomR->setEnabled(true);
-	}
-	if (m_pageType == 1)
-		rightR->setEnabled(false);
-	leftR->setEnabled(item != PresetLayout::nineparts);
-	if (item != PresetLayout::none)
-		linkMargins->setChecked(false);
-	linkMargins->setEnabled(item == PresetLayout::none);
-	connect(presetCombo, SIGNAL(activated(int)), this, SLOT(setPreset()));
-}
-
-int MarginWidget::getMarginPreset()
-{
-	return presetCombo->currentIndex();
-}
-
-bool MarginWidget::getMarginsForAllPages() const
-{
-	return marginsForAllPages->isChecked();
-}
-
-bool MarginWidget::getMarginsForAllMasterPages() const
-{
-	return marginsForAllMasterPages->isChecked();
-}
-
-void MarginWidget::setNewBleeds(MarginStruct& b)
-{
-	disconnect(BleedLeft, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-	disconnect(BleedRight, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-	disconnect(BleedTop, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-	disconnect(BleedBottom, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-	BleedTop->setValue(b.top() * m_unitRatio);
-	BleedBottom->setValue(b.bottom() * m_unitRatio);
-	BleedLeft->setValue(b.left() * m_unitRatio);
-	BleedRight->setValue(b.right() * m_unitRatio);
-	connect(BleedLeft, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-	connect(BleedRight, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-	connect(BleedTop, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-	connect(BleedBottom, SIGNAL(valueChanged(double)), this, SLOT(changeBleeds()));
-}
-
-double MarginWidget::topBleed() const
-{
-	return BleedTop->value() / m_unitRatio;
-}
-
-double MarginWidget::bottomBleed() const
-{
-	return BleedBottom->value() / m_unitRatio;
-}
-
-double MarginWidget::leftBleed() const
-{
-	return BleedLeft->value() / m_unitRatio;
-}
-
-double MarginWidget::rightBleed() const
-{
-	return BleedRight->value() / m_unitRatio;
-}
-
-const MarginStruct & MarginWidget::margins() const
-{
-	return marginData;
-}
-
-void MarginWidget::slotLinkMargins()
-{
-	disconnect(topR, SIGNAL(valueChanged(double)), this, SLOT(setTop()));
-	disconnect(bottomR, SIGNAL(valueChanged(double)), this, SLOT(setBottom()));
-	disconnect(leftR, SIGNAL(valueChanged(double)), this, SLOT(setLeft()));
-	disconnect(rightR, SIGNAL(valueChanged(double)), this, SLOT(setRight()));
-
-	double marginValue = leftR->value();
-	if (leftR->hasFocus())
-	{
-		leftR->clearFocus();
-		marginValue = leftR->value();
-	}
-	if (rightR->hasFocus())
-	{
-		rightR->clearFocus();
-		marginValue = rightR->value();
-	}
-	if (topR->hasFocus())
-	{
-		topR->clearFocus();
-		marginValue = topR->value();
-	}
-	if (bottomR->hasFocus())
-	{
-		bottomR->clearFocus();
-		marginValue = bottomR->value();
-	}
-
-	if (linkMargins->isChecked())
-	{
-		leftR->setValue(marginValue);
-		bottomR->setValue(marginValue);
-		topR->setValue(marginValue);
-		rightR->setValue(marginValue);
-		double newVal = marginValue / m_unitRatio;
-		marginData.set(newVal, newVal, newVal, newVal);
-	}
-
-	connect(topR, SIGNAL(valueChanged(double)), this, SLOT(setTop()));
-	connect(bottomR, SIGNAL(valueChanged(double)), this, SLOT(setBottom()));
-	connect(leftR, SIGNAL(valueChanged(double)), this, SLOT(setLeft()));
-	connect(rightR, SIGNAL(valueChanged(double)), this, SLOT(setRight()));
-	
-}
-
-void MarginWidget::updateMarginSpinValues()
-{
-	topR->setValue(marginData.top() * m_unitRatio);
-	rightR->setValue(marginData.right() * m_unitRatio);
-	bottomR->setValue(marginData.bottom() * m_unitRatio);
-	leftR->setValue(marginData.left() * m_unitRatio);
-}

Property changes on: scribus/ui/marginwidget.cpp
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Author Date Id Revision
\ No newline at end of property
Index: scribus/ui/marginwidget.h
===================================================================
--- scribus/ui/marginwidget.h	(Revision 26264)
+++ scribus/ui/marginwidget.h	(nicht existent)
@@ -1,178 +0,0 @@
-/*
-For general Scribus (>=1.3.2) copyright and licensing information please refer
-to the COPYING file provided with the program. Following this notice may exist
-a copyright and/or license notice that predates the release of Scribus 1.3.2
-for which a new license (GPL+exception) is in place.
-*/
-#ifndef MARGINWIDGET_H
-#define MARGINWIDGET_H
-
-#include "scribusapi.h"
-#include "scribusstructs.h"
-
-#include <QComboBox>
-#include <QTabWidget>
-#include "linkbutton.h"
-#include "marginpresetlayout.h"
-
-class QCheckBox;
-class QPushButton;
-class QLabel;
-class QGridLayout;
-class QHBoxLayout;
-class ScrSpinBox;
-
-
-/*! \brief Widget for Margins setting.
-Used e.g. in "New Doc Dialog" or "Preferences".
-*/
-class SCRIBUS_API MarginWidget : public QTabWidget
-{
-	Q_OBJECT
-
-public:
-	/*! \brief It creates an user interface for base margin settings for the document.
-	\param parent Parent widget (used as standard in Qt)
-	\param title Title of the Group box
-	\param margs A reference to the margins in the preferences.
-	\param unitIndex and index of the unit combobox
-	\param showChangeAll show "apply to all pages" related items
-	*/
-	MarginWidget(QWidget* parent, const QString& title, const MarginStruct* margs, int unitIndex, bool showChangeAll = false, bool showBleeds = true);
-	~MarginWidget() {}
-	/*! \brief Setup the labels by facing pages option */
-	void setFacingPages(bool facing, int pagetype = 0);
-	/*! \brief Setup the spinboxes properties (min/max value etc.) by width and height */
-	void setPageWidthHeight(double width, double height);
-	/*! \brief Setup the spinboxes properties (min/max value etc.) by width */
-	void setPageWidth(double width);
-	/*! \brief Setup the spinboxes properties (min/max value etc.) by height */
-	void setPageHeight(double height);
-	/*! \brief Setup the widgets by new options */
-	void setNewUnit(int newUnitIndex);
-	/*! \brief Set the page size for margin getting from cups */
-	void setPageSize(const QString& pageSize);
-	
-	/*! \brief Margins
-	\retval MarginStruct data */
-	const MarginStruct& margins() const;
-	/*! \brief Top Margin
-	\retval double margin size */
-	double top() const;
-	/*! \brief Bottom Margin
-	\retval double margin size */
-	double bottom() const;
-	/*! \brief Left Margin
-	\retval double margin size */
-	double left() const;
-	/*! \brief Right Margin
-	\retval double margin size */
-	double right() const;
-
-	/*! \brief set new margin values for the dialog
-	It calls overridden setTop(), setBottom() etc. slots itself
-	via signals emitted from spinboxes.
-	\param m MarginStruct 
-	*/
-	void setNewMargins(MarginStruct& m);
-	
-	/*! \brief Setup the presetCombo without changing the margin values, only used by tabdocument */
-	void setMarginPreset(int p);
-	int getMarginPreset();
-	
-	/*! \brief Top Bleed
-	\retval double bleed size */
-	double topBleed() const;
-	/*! \brief Bottom Bleed
-	\retval double bleed size */
-	double bottomBleed() const;
-	/*! \brief Left Bleed
-	\retval double bleed size */
-	double leftBleed() const;
-	/*! \brief Right Bleed
-	\retval double bleed size */
-	double rightBleed() const;
-
-	/*! \brief set new bleed values for the dialog
-	\param b MarginStruct
-	*/
-	void setNewBleeds(MarginStruct& b);
-	
-	/*! \brief Return marginsForAllPages property
-	\retval bool true to apply for all pages */
-	bool getMarginsForAllPages() const;
-	bool getMarginsForAllMasterPages() const;
-
-private:
-	/*! Tabs */
-	QWidget *marginPage { nullptr };
-	QWidget* bleedPage { nullptr };
-	/*! Spinboxes */
-	ScrSpinBox* topR { nullptr };
-	ScrSpinBox* bottomR { nullptr };
-	ScrSpinBox* rightR { nullptr };
-	ScrSpinBox* leftR { nullptr };
-	ScrSpinBox* BleedBottom { nullptr };
-	ScrSpinBox* BleedLeft { nullptr };
-	ScrSpinBox* BleedRight { nullptr };
-	ScrSpinBox* BleedTop { nullptr };
-	PresetLayout* presetCombo { nullptr };
-	/*! Labels */
-	QLabel* lText { nullptr };
-	QLabel* rText { nullptr };
-	QLabel* tText { nullptr };
-	QLabel* bText { nullptr };
-	QLabel* presetLabel { nullptr };
-	QLabel* marginsForPages { nullptr };
-	QLabel* BleedTxt1 { nullptr };
-	QLabel* BleedTxt2 { nullptr };
-	QLabel* BleedTxt3 { nullptr };
-	QLabel* BleedTxt4 { nullptr };
-	QCheckBox* marginsForAllPages { nullptr };
-	QCheckBox* marginsForAllMasterPages { nullptr };
-	QPushButton* usePrinterMarginsButton { nullptr };
-	LinkButton* linkBleeds { nullptr };
-	LinkButton* linkMargins { nullptr };
-
-	/*! \brief Margin values converted by unitRatio */
-	MarginStruct marginData;
-
-	/*! \brief Internally used page width */
-	double m_pageWidth { 0.0 };
-	/*! \brief Internally used page height */
-	double m_pageHeight { 0.0 };
-
-public slots:
-	/*! \brief Recompute the values after spinbox change */
-	void setTop();
-	void setBottom();
-	void setLeft();
-	void setRight();
-	/*! \brief Recompute margins in PresetLayout combobox and disable/enable widgets. */
-	void setPreset();
-	void slotLinkBleeds();
-	void slotLinkMargins();
-	void changeBleeds();
-	
-protected slots:	
-	virtual void setMarginsToPrinterMargins();
-
-protected:
-	void updateMarginSpinValues();
-
-	QGridLayout* GroupLayout { nullptr };
-	QHBoxLayout* marginsForPagesLayout { nullptr };
-	QGridLayout* BleedGroupLayout { nullptr };
-
-	QString m_pageSize;
-	int     m_unitIndex { 0 };
-	double  m_unitRatio { 1.0 };
-	//! \brief if the outer facing palette points to the facing pages item
-	bool m_facingPages { false };
-	bool m_useBleeds { false };
-	int  m_pageType { 0 };
-	MarginStruct m_savedMargins;
-	int m_savedPresetItem { PresetLayout::none };
-};
-
-#endif

Property changes on: scribus/ui/marginwidget.h
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Author Date Id Revision
\ No newline at end of property
Index: scribus/ui/newdocdialog.cpp
===================================================================
--- scribus/ui/newdocdialog.cpp	(Revision 26264)
+++ scribus/ui/newdocdialog.cpp	(Arbeitskopie)
@@ -12,6 +12,7 @@
 #include <QHBoxLayout>
 #include <QVBoxLayout>
 
+#include <QButtonGroup>
 #include <QCheckBox>
 #include <QComboBox>
 #include <QDir>
@@ -29,14 +30,13 @@
 #include <QStringList>
 #include <QTabWidget>
 #include <QToolTip>
+#include <QVBoxLayout>
 
-#include "scconfig.h"
-
 #include "commonstrings.h"
 #include "filedialogeventcatcher.h"
 #include "fileloader.h"
 #include "iconmanager.h"
-#include "marginwidget.h"
+#include "newmarginwidget.h"
 #include "pagesize.h"
 #include "pagestructs.h"
 #include "prefsfile.h"
@@ -43,63 +43,20 @@
 #include "prefsmanager.h"
 #include "scrspinbox.h"
 #include "units.h"
-#include "ui/delegates/sclistitemdelegate.h"
+#include "ui/widgets/pagesizelist.h"
 
-PageLayoutsWidget::PageLayoutsWidget(QWidget* parent) :
-	QListWidget(parent)
-{
-	setDragEnabled(false);
-	setViewMode(QListView::IconMode);
-	setFlow(QListView::LeftToRight);
-	setSortingEnabled(false);
-	setWrapping(false);
-	setWordWrap(true);
-	setAcceptDrops(false);
-	setDropIndicatorShown(false);
-	setDragDropMode(QAbstractItemView::NoDragDrop);
-	setResizeMode(QListView::Adjust);
-	setSelectionMode(QAbstractItemView::SingleSelection);
-	setFocusPolicy(Qt::NoFocus);
-	setIconSize(QSize(32, 32));
-	clear();
-	setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
-	setGridSize(QSize(96, 96));
-	setItemDelegate(new ScListItemDelegate(QListWidget::IconMode, QSize(32,32)));
-}
 
-void PageLayoutsWidget::arrangeIcons()
-{
-	int startY = 5;
-	int startX = 5;
-	int maxSizeY = 0;
-
-	setResizeMode(QListView::Fixed);
-
-	for (int i = 0; i < count(); ++i)
-	{
-		QListWidgetItem* itemWidget = item(i);
-		QRect itemRect = visualItemRect(itemWidget);
-		setPositionForIndex(QPoint(startX, startY), indexFromItem(itemWidget));
-		startX += itemRect.width() + 5;
-		maxSizeY = qMax(maxSizeY, itemRect.height());
-	}
-
-	maxX = startX;
-	maxY = maxSizeY + 10;
-}
-
-QSize PageLayoutsWidget::minimumSizeHint() const
-{
-	return QSize(maxX, maxY);
-}
-
 NewDocDialog::NewDocDialog(QWidget* parent, const QStringList& recentDocs, bool startUp, const QString& lang) : QDialog(parent),
 	prefsManager(PrefsManager::instance()),
 	m_onStartup(startUp)
 {
+	setupUi(this);
+
 	setObjectName(QString::fromLocal8Bit("NewDocumentWindow"));
 	setModal(true);
 
+	IconManager &iconManager = IconManager::instance();
+
 	m_unitIndex = prefsManager.appPrefs.docSetupPrefs.docUnitIndex;
 	m_unitRatio = unitGetRatioFromIndex(m_unitIndex);
 	m_unitSuffix = unitGetSuffixFromIndex(m_unitIndex);
@@ -106,58 +63,35 @@
 	m_orientation = prefsManager.appPrefs.docSetupPrefs.pageOrientation;
 
 	setWindowTitle( tr( "New Document" ) );
-	setWindowIcon(IconManager::instance().loadIcon("AppIcon.png"));
-	if (startUp)
-		setContentsMargins(0, 0, 0, 0);
-	else
-		setContentsMargins(9, 9, 9, 9);
-	TabbedNewDocLayout = new QVBoxLayout( this );
-	if (startUp)
-		TabbedNewDocLayout->setContentsMargins(9, 9, 9, 9);
-	else
-		TabbedNewDocLayout->setContentsMargins(0, 0, 0, 0);
-	TabbedNewDocLayout->setSpacing(6);
+	setWindowIcon(iconManager.loadIcon("AppIcon.png"));
+
+	buttonVertical->setIcon(iconManager.loadIcon("page-orientation-vertical"));
+	buttonHorizontal->setIcon(iconManager.loadIcon("page-orientation-horizontal"));
+
 	createNewDocPage();
 	if (startUp)
 	{
-		tabWidget = new QTabWidget( this );
-		tabWidget->addTab(newDocFrame, tr("&New Document"));
-		createNewFromTempPage();
 		nftGui->setupSettings(lang);
-		tabWidget->addTab(newFromTempFrame, tr("New &from Template"));
 		createOpenDocPage();
-		tabWidget->addTab(openDocFrame, tr("Open &Existing Document"));
 		recentDocList = recentDocs;
- 		createRecentDocPage();
- 		tabWidget->addTab(recentDocFrame, tr("Open Recent &Document"));
- 		TabbedNewDocLayout->addWidget(tabWidget);
+		createRecentDocPage();
+		startUpDialog->setChecked(!prefsManager.appPrefs.uiPrefs.showStartupDialog);
 	}
 	else
-		TabbedNewDocLayout->addWidget(newDocFrame);
-
-	Layout1 = new QHBoxLayout;
-	Layout1->setContentsMargins(0, 0, 0, 0);
-	Layout1->setSpacing(6);
-	if (startUp)
 	{
-		startUpDialog = new QCheckBox( tr( "Do not show this dialog again" ), this );
-		startUpDialog->setChecked(!prefsManager.appPrefs.uiPrefs.showStartupDialog);
-		Layout1->addWidget( startUpDialog );
+		tabWidget->removeTab(3);
+		tabWidget->removeTab(2);
+		tabWidget->removeTab(1);
 	}
-	QSpacerItem* spacer = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
-	Layout1->addItem( spacer );
-	buttonBox = new QDialogButtonBox();
-	Layout1->addWidget(buttonBox);
-	okButton = new QPushButton( CommonStrings::tr_OK, this );
-	okButton->setDefault( true );
-	buttonBox->addButton(okButton, QDialogButtonBox::AcceptRole);
-	cancelButton = new QPushButton( CommonStrings::tr_Cancel, this );
-	cancelButton->setAutoDefault( false );
-	buttonBox->addButton(cancelButton, QDialogButtonBox::RejectRole);
-	TabbedNewDocLayout->addLayout( Layout1 );
+
+
+	tabWidget->setCurrentIndex(0);
+	startUpDialog->setVisible(startUp);
+
 	//tooltips
-	pageSizeComboBox->setToolTip( tr( "Document page size, either a standard size or a custom size" ) );
-	pageOrientationComboBox->setToolTip( tr( "Orientation of the document's pages" ) );
+	listPageFormats->setToolTip( tr( "Document page size, either a standard size or a custom size" ) );
+	buttonVertical->setToolTip( tr( "Vertical orientation of the document's pages" ) );
+	buttonHorizontal->setToolTip( tr( "Horizontal orientation of the document's pages" ) );
 	widthSpinBox->setToolTip( tr( "Width of the document's pages, editable if you have chosen a custom page size" ) );
 	heightSpinBox->setToolTip( tr( "Height of the document's pages, editable if you have chosen a custom page size" ) );
 	pageCountSpinBox->setToolTip( tr( "Initial number of pages of the document" ) );
@@ -170,15 +104,16 @@
 	connect(buttonBox, &QDialogButtonBox::accepted, this, &NewDocDialog::ExitOK);
 	connect(buttonBox, &QDialogButtonBox::rejected, this, &NewDocDialog::reject);
 
-	connect(pageSizeComboBox, SIGNAL(textActivated(QString)), this, SLOT(setPageSize(QString)));
-	connect(pageOrientationComboBox, SIGNAL(activated(int)), this, SLOT(setOrientation(int)));
+	connect(pageOrientationButtons, &QButtonGroup::idClicked, this, &NewDocDialog::setOrientation);
 	connect(unitOfMeasureComboBox, SIGNAL(activated(int)), this, SLOT(setUnit(int)));
 	connect(Distance, SIGNAL(valueChanged(double)), this, SLOT(setDistance(double)));
 	connect(autoTextFrame, SIGNAL(clicked()), this, SLOT(handleAutoFrame()));
-	connect(layoutsView, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(itemSelected(QListWidgetItem*)));
-	connect(layoutsView, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(itemSelected(QListWidgetItem*)));
-	connect(layoutsView, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(itemSelected(QListWidgetItem*)));
-	connect(layoutsView, SIGNAL(itemPressed(QListWidgetItem*)), this, SLOT(itemSelected(QListWidgetItem*)));
+	connect(listPageFormats, &PageSizeList::itemClicked, this, &NewDocDialog::changePageSize);
+	connect(pageSizeSelector, &PageSizeSelector::pageCategoryChanged, this, &NewDocDialog::changeCategory);
+	connect(pageLayouts, &PageLayouts::schemeChanged, this, &NewDocDialog::changeScheme);
+	connect(pageLayouts, &PageLayouts::firstPageChanged, this, &NewDocDialog::changeFirstPage);
+	connect(marginGroup, &NewMarginWidget::marginChanged, this, &NewDocDialog::changeMargin);
+	connect(bleedGroup, &NewMarginWidget::marginChanged, this, &NewDocDialog::changeMargin);
 	if (startUp)
 	{
 		connect(nftGui, SIGNAL(leaveOK()), this, SLOT(ExitOK()));
@@ -189,180 +124,90 @@
 
 void NewDocDialog::createNewDocPage()
 {
-	newDocFrame = new QFrame(this);
+	int orientation = prefsManager.appPrefs.docSetupPrefs.pageOrientation;
+	int pagePositioning = prefsManager.appPrefs.docSetupPrefs.pagePositioning;
+	QString pageSize = prefsManager.appPrefs.docSetupPrefs.pageSize;
+	double pageHeight = prefsManager.appPrefs.docSetupPrefs.pageHeight;
+	double pageWidth = prefsManager.appPrefs.docSetupPrefs.pageWidth;
 
-	pageSizeGroupBox = new QGroupBox(newDocFrame );
-	pageSizeGroupBox->setTitle( tr( "Document Layout" ) );
-	pageSizeGroupBoxLayout = new QGridLayout( pageSizeGroupBox );
-	pageSizeGroupBoxLayout->setContentsMargins(9, 9, 9, 9);
-	pageSizeGroupBoxLayout->setSpacing(6);
-	pageSizeGroupBoxLayout->setAlignment( Qt::AlignTop );
+	pageOrientationButtons = new QButtonGroup();
+	pageOrientationButtons->addButton(buttonVertical, 0);
+	pageOrientationButtons->addButton(buttonHorizontal, 1);
+	pageOrientationButtons->button(orientation)->setChecked(true);
 
-	layoutsView = new PageLayoutsWidget( pageSizeGroupBox );
-	layoutsView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
-	for (int i = 0; i < prefsManager.appPrefs.pageSets.count(); ++i)
-	{
-		QListWidgetItem *ic;
-		QString psname = CommonStrings::translatePageSetString(prefsManager.appPrefs.pageSets[i].Name);
-		if (i == 0)
-		{
-			ic = new QListWidgetItem( IconManager::instance().loadIcon("32/page-simple.png"), psname, layoutsView );
-			ic->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
-		}
-		else if (i == 1)
-		{
-			ic = new QListWidgetItem( IconManager::instance().loadIcon("32/page-doublesided.png"), psname, layoutsView );
-			ic->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
-		}
-		else if (i == 2 && prefsManager.appPrefs.docSetupPrefs.pagePositioning == 2)
-		{
-			ic = new QListWidgetItem( IconManager::instance().loadIcon("32/page-3fold.png"), psname, layoutsView );
-			ic->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
-		}
-		else if (i == 3 && prefsManager.appPrefs.docSetupPrefs.pagePositioning == 3)
-		{
-			ic = new QListWidgetItem( IconManager::instance().loadIcon("32/page-4fold.png"), psname, layoutsView );
-			ic->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
-		}
-	}
-	layoutsView->arrangeIcons();
-	pageSizeGroupBoxLayout->addWidget( layoutsView, 0, 0, 5, 1 );
-	layoutsView->arrangeIcons();
+	listPageFormats->setFormat(pageSize);
+	listPageFormats->setOrientation(orientation);
+	listPageFormats->setCategory(PageSizeInfo::Favorite);
 
-	TextLabel1 = new QLabel( tr( "&Size:" ), pageSizeGroupBox );
-	pageSizeGroupBoxLayout->addWidget( TextLabel1, 0, 1 );
-	PageSize ps(prefsManager.appPrefs.docSetupPrefs.pageSize);
-	pageSizeComboBox = new QComboBox( pageSizeGroupBox );
-	pageSizeComboBox->addItems(ps.activeSizeTRList());
-	pageSizeComboBox->addItem( CommonStrings::trCustomPageSize );
-	pageSizeComboBox->setEditable(false);
-	TextLabel1->setBuddy(pageSizeComboBox);
-	pageSizeGroupBoxLayout->addWidget(pageSizeComboBox, 0, 2 );
-	TextLabel2 = new QLabel( tr( "Orie&ntation:" ), pageSizeGroupBox );
-	pageSizeGroupBoxLayout->addWidget( TextLabel2, 1, 1 );
-	pageOrientationComboBox = new QComboBox( pageSizeGroupBox );
-	pageOrientationComboBox->addItem( tr( "Portrait" ) );
-	pageOrientationComboBox->addItem( tr( "Landscape" ) );
-	pageOrientationComboBox->setEditable(false);
-	pageOrientationComboBox->setCurrentIndex(prefsManager.appPrefs.docSetupPrefs.pageOrientation);
-	TextLabel2->setBuddy(pageOrientationComboBox);
-	pageSizeGroupBoxLayout->addWidget( pageOrientationComboBox, 1, 2 );
+	pageSizeSelector->setHasFormatSelector(false);
+	pageSizeSelector->setHasCustom(false);
+	pageSizeSelector->setPageSize(pageSize);
+	pageSizeSelector->setCurrentCategory(PageSizeInfo::Favorite);
 
-	TextLabel1_2 = new QLabel( tr( "&Width:" ), pageSizeGroupBox );
-	pageSizeGroupBoxLayout->addWidget(TextLabel1_2, 2, 1 );
-	widthSpinBox = new ScrSpinBox(pts2value(1.0, m_unitIndex), 16777215, pageSizeGroupBox, m_unitIndex );
+	widthSpinBox->setMinimum(pts2value(1.0, m_unitIndex));
+	widthSpinBox->setMaximum(16777215);
+	widthSpinBox->setNewUnit(m_unitIndex);
 	widthSpinBox->setSuffix(m_unitSuffix);
-	TextLabel1_2->setBuddy(widthSpinBox);
-	pageSizeGroupBoxLayout->addWidget(widthSpinBox, 2, 2 );
-	TextLabel2_2 = new QLabel( tr( "&Height:" ), pageSizeGroupBox );
-	pageSizeGroupBoxLayout->addWidget(TextLabel2_2, 3, 1 );
-	heightSpinBox = new ScrSpinBox( pts2value(1.0, m_unitIndex), 16777215, pageSizeGroupBox, m_unitIndex );
+
+	heightSpinBox->setMinimum(pts2value(1.0, m_unitIndex));
+	heightSpinBox->setMaximum(16777215);
+	heightSpinBox->setNewUnit(m_unitIndex);
 	heightSpinBox->setSuffix(m_unitSuffix);
-	TextLabel2_2->setBuddy(heightSpinBox);
-	pageSizeGroupBoxLayout->addWidget(heightSpinBox, 3, 2 );
 
-	unitOfMeasureLabel = new QLabel( tr( "&Default Unit:" ), pageSizeGroupBox );
-	unitOfMeasureComboBox = new QComboBox( pageSizeGroupBox );
 	unitOfMeasureComboBox->addItems(unitGetTextUnitList());
 	unitOfMeasureComboBox->setCurrentIndex(m_unitIndex);
 	unitOfMeasureComboBox->setEditable(false);
-	unitOfMeasureLabel->setBuddy(unitOfMeasureComboBox);
-	pageSizeGroupBoxLayout->addWidget( unitOfMeasureLabel, 4, 1 );
-	pageSizeGroupBoxLayout->addWidget( unitOfMeasureComboBox, 4, 2 );
 
 	MarginStruct marg(prefsManager.appPrefs.docSetupPrefs.margins);
-	marginGroup = new MarginWidget(newDocFrame,  tr( "Margin Guides" ), &marg, m_unitIndex );
-	marginGroup->setPageWidthHeight(prefsManager.appPrefs.docSetupPrefs.pageWidth, prefsManager.appPrefs.docSetupPrefs.pageHeight);
-	marginGroup->setFacingPages(!(prefsManager.appPrefs.docSetupPrefs.pagePositioning == singlePage));
-	widthSpinBox->setValue(prefsManager.appPrefs.docSetupPrefs.pageWidth * m_unitRatio);
-	heightSpinBox->setValue(prefsManager.appPrefs.docSetupPrefs.pageHeight * m_unitRatio);
-	QStringList pageSizes = ps.activeSizeTRList();
-	int sizeIndex = pageSizes.indexOf(ps.nameTR());
-	if (sizeIndex != -1)
-		pageSizeComboBox->setCurrentIndex(sizeIndex);
-	else
-		pageSizeComboBox->setCurrentIndex(pageSizeComboBox->count() - 1);
-	marginGroup->setPageSize(pageSizeComboBox->currentText());
-	marginGroup->setNewBleeds(prefsManager.appPrefs.docSetupPrefs.bleeds);
+	marginGroup->setup(marg, !(pagePositioning == singlePage), m_unitIndex, NewMarginWidget::MarginWidgetFlags);
+	marginGroup->setPageHeight(pageHeight);
+	marginGroup->setPageWidth(pageWidth);
+	marginGroup->setFacingPages(!(pagePositioning == singlePage));
+
+	MarginStruct bleed;
+	bleed.resetToZero();
+
+	bleedGroup->setup(bleed, !(pagePositioning == singlePage), m_unitIndex, NewMarginWidget::BleedWidgetFlags);
+	bleedGroup->setPageHeight(pageHeight);
+	bleedGroup->setPageWidth(pageWidth);
+	bleedGroup->setFacingPages(!(pagePositioning == singlePage));
+	widthSpinBox->setValue(pageWidth * m_unitRatio);
+	heightSpinBox->setValue(pageHeight * m_unitRatio);
+
+	marginGroup->setPageSize(pageSize);
 	marginGroup->setMarginPreset(prefsManager.appPrefs.docSetupPrefs.marginPreset);
+	bleedGroup->setPageSize(pageSize);
+	bleedGroup->setMarginPreset(prefsManager.appPrefs.docSetupPrefs.marginPreset);
 
-	optionsGroupBox = new QGroupBox( newDocFrame );
-	optionsGroupBox->setTitle( tr( "Options" ) );
-	optionsGroupBoxLayout = new QGridLayout( optionsGroupBox );
-	optionsGroupBoxLayout->setSpacing(6);
-	optionsGroupBoxLayout->setContentsMargins(9, 9, 9, 9);
-	optionsGroupBoxLayout->setAlignment( Qt::AlignTop );
-	pageCountLabel = new QLabel( tr( "N&umber of Pages:" ), optionsGroupBox );
-
-	pageCountSpinBox = new QSpinBox( optionsGroupBox );
 	pageCountSpinBox->setMaximum( 10000 );
 	pageCountSpinBox->setMinimum( 1 );
-	pageCountLabel->setBuddy(pageCountSpinBox);
-	optionsGroupBoxLayout->addWidget(pageCountLabel, 0, 0, Qt::AlignLeft);
-	optionsGroupBoxLayout->addWidget(pageCountSpinBox, 0, 1);
 
-	layoutLabel1 = new QLabel( optionsGroupBox );
-	layoutLabel1->setText( tr( "First Page is:" ) );
-	firstPage = new QComboBox( optionsGroupBox );
-	firstPage->clear();
-	selectItem(prefsManager.appPrefs.docSetupPrefs.pagePositioning);
-	optionsGroupBoxLayout->addWidget(layoutLabel1, 1, 0, Qt::AlignLeft);
-	optionsGroupBoxLayout->addWidget(firstPage, 1, 1);
-	firstPage->setCurrentIndex(prefsManager.appPrefs.pageSets[prefsManager.appPrefs.docSetupPrefs.pagePositioning].FirstPage);
+	pageLayouts->updateSchemeSelector(prefsManager.appPrefs.pageSets, prefsManager.appPrefs.pageSets[pagePositioning].FirstPage);
 
-	setDocLayout(prefsManager.appPrefs.docSetupPrefs.pagePositioning);
-	setSize(prefsManager.appPrefs.docSetupPrefs.pageSize);
-	setOrientation(prefsManager.appPrefs.docSetupPrefs.pageOrientation);
+	setDocLayout(pagePositioning);
+	setSize(pageSize);
+	setOrientation(orientation);
 
-	autoTextFrame = new QCheckBox( optionsGroupBox );
-	autoTextFrame->setText( tr( "&Automatic Text Frames" ) );
-	optionsGroupBoxLayout->addWidget(autoTextFrame, 2, 0, 1, 2, Qt::AlignLeft);
-
-	TextLabel3 = new QLabel( tr( "Colu&mns:" ), optionsGroupBox );
-	numberOfCols = new QSpinBox( optionsGroupBox );
 	numberOfCols->setButtonSymbols( QSpinBox::UpDownArrows );
 	numberOfCols->setMinimum( 1 );
 	numberOfCols->setValue( 1 );
-	TextLabel3->setBuddy(numberOfCols);
-	optionsGroupBoxLayout->addWidget(TextLabel3, 3, 0, Qt::AlignLeft);
-	optionsGroupBoxLayout->addWidget(numberOfCols, 3, 1);
 
-	TextLabel4 = new QLabel( tr( "&Gap:" ), optionsGroupBox );
-	Distance = new ScrSpinBox( 0, 1000, optionsGroupBox, m_unitIndex );
+	Distance->setMinimum(0);
+	Distance->setMaximum(1000);
+	Distance->setNewUnit(m_unitIndex);
 	Distance->setValue(11 * m_unitRatio);
-	TextLabel4->setBuddy(Distance);
-	optionsGroupBoxLayout->addWidget(TextLabel4, 4, 0, Qt::AlignLeft);
-	optionsGroupBoxLayout->addWidget(Distance, 4, 1);
 
-	firstPage->setMinimumWidth(Distance->width());
-
-	TextLabel3->setEnabled(false);
-	TextLabel4->setEnabled(false);
+	labelColumns->setEnabled(false);
+	labelGap->setEnabled(false);
 	Distance->setEnabled(false);
 	numberOfCols->setEnabled(false);
-	startDocSetup = new QCheckBox( optionsGroupBox );
+
 	startDocSetup->setText( tr( "Show Document Settings After Creation" ) );
 	startDocSetup->setChecked(false);
-	optionsGroupBoxLayout->addWidget(startDocSetup, 5, 0, 1, 2, Qt::AlignLeft);
 
-	NewDocLayout = new QGridLayout( newDocFrame );
-	if (m_onStartup)
-		NewDocLayout->setContentsMargins(9, 9, 9, 9);
-	else
-		NewDocLayout->setContentsMargins(0, 0, 0, 0);
-	NewDocLayout->setSpacing(6);
-	NewDocLayout->addWidget( marginGroup, 1, 0 );
-	NewDocLayout->addWidget( optionsGroupBox, 1, 1 );
-	NewDocLayout->addWidget( pageSizeGroupBox, 0, 0, 1, 2);
-}
+	sectionBleeds->collapse();
+	sectionTextFrame->collapse();
 
-void NewDocDialog::createNewFromTempPage()
-{
-	newFromTempFrame = new QFrame(this);
-	verticalLayout = new QVBoxLayout(newFromTempFrame);
-	verticalLayout->setContentsMargins(9, 9, 9, 9);
-	nftGui = new nftwidget(newFromTempFrame);
-	verticalLayout->addWidget(nftGui);
 }
 
 void NewDocDialog::createOpenDocPage()
@@ -376,10 +221,9 @@
 		docDir = docContext->get("docsopen", ".");
 	QString formats(FileLoader::getLoadFilterString());
 //	formats.remove("PDF (*.pdf *.PDF);;");
-	openDocFrame = new QFrame(this);
-	openDocLayout = new QVBoxLayout(openDocFrame);
+	QVBoxLayout *openDocLayout = new QVBoxLayout(tab_3);
 	openDocLayout->setContentsMargins(0, 0, 0, 0);
-	openDocLayout->setSpacing(6);
+	openDocLayout->setSpacing(4);
 	m_selectedFile = "";
 
 	// With Qt 5.15 we have to be in careful so that new document dialog doesn't display too large on startup.
@@ -386,7 +230,7 @@
 	// To avoid this we have to use QFileDialog(QWidget *parent, Qt::WindowFlags flags) constructor, then
 	// set the QFileDialog::DontUseNativeDialog option as early as possible, and nonetheless set again
 	// the Qt::Widget window flag before adding the widget to layout.
-	fileDialog = new QFileDialog(openDocFrame, Qt::Widget);
+	fileDialog = new QFileDialog(tab_3, Qt::Widget);
 	fileDialog->setOption(QFileDialog::DontUseNativeDialog);
 	fileDialog->setWindowTitle(tr("Open"));
 	fileDialog->setDirectory(docDir);
@@ -404,6 +248,7 @@
 	fileDialog->setWindowFlags(Qt::Widget);
 	openDocLayout->addWidget(fileDialog);
 
+
 	FileDialogEventCatcher* keyCatcher = new FileDialogEventCatcher(this);
 	QList<QListView *> listViews = fileDialog->findChildren<QListView *>();
 	for (auto listView : std::as_const(listViews))
@@ -426,12 +271,6 @@
 
 void NewDocDialog::createRecentDocPage()
 {
-	recentDocFrame = new QFrame(this);
-	recentDocLayout = new QVBoxLayout(recentDocFrame);
-	recentDocLayout->setContentsMargins(9, 9, 9, 9);
-	recentDocLayout->setSpacing(6);
-	recentDocListBox = new QListWidget(recentDocFrame);
-	recentDocLayout->addWidget(recentDocListBox);
 	int max = qMin(prefsManager.appPrefs.uiPrefs.recentDocCount, recentDocList.count());
 	for (int i = 0; i < max; ++i)
 		recentDocListBox->addItem(QDir::toNativeSeparators(recentDocList[i]));
@@ -443,16 +282,20 @@
 {
 	m_pageWidth = widthSpinBox->value() / m_unitRatio;
 	marginGroup->setPageWidth(m_pageWidth);
-	QString psText = pageSizeComboBox->currentText();
-	if (psText != CommonStrings::trCustomPageSize && psText != CommonStrings::customPageSize)
-		pageSizeComboBox->setCurrentIndex(pageSizeComboBox->count() - 1);
+	bleedGroup->setPageWidth(m_pageWidth);
+	listPageFormats->clearSelection();
+	m_pageSize = CommonStrings::customPageSize;
+	pagePreview->setPage(m_pageHeight, m_pageWidth, marginGroup->margins(), bleedGroup->margins(), m_pageSize, m_choosenLayout, pageLayouts->firstPage());
+
 	int newOrientation = (widthSpinBox->value() > heightSpinBox->value()) ? landscapePage : portraitPage;
 	if (newOrientation != m_orientation)
 	{
-		pageOrientationComboBox->blockSignals(true);
-		pageOrientationComboBox->setCurrentIndex(newOrientation);
-		pageOrientationComboBox->blockSignals(false);
 		m_orientation = newOrientation;
+
+		QSignalBlocker sigOri(pageOrientationButtons);
+		pageOrientationButtons->button(newOrientation)->setChecked(true);
+		QSignalBlocker sigFormats(listPageFormats);
+		listPageFormats->setOrientation(m_orientation);
 	}
 }
 
@@ -460,68 +303,64 @@
 {
 	m_pageHeight = heightSpinBox->value() / m_unitRatio;
 	marginGroup->setPageHeight(m_pageHeight);
-	QString psText = pageSizeComboBox->currentText();
-	if (psText != CommonStrings::trCustomPageSize && psText != CommonStrings::customPageSize)
-		pageSizeComboBox->setCurrentIndex(pageSizeComboBox->count() - 1);
+	bleedGroup->setPageHeight(m_pageHeight);	
+	listPageFormats->clearSelection();
+	m_pageSize = CommonStrings::customPageSize;
+	pagePreview->setPage(m_pageHeight, m_pageWidth, marginGroup->margins(), bleedGroup->margins(), m_pageSize, m_choosenLayout, pageLayouts->firstPage());
+
 	int newOrientation = (widthSpinBox->value() > heightSpinBox->value()) ? landscapePage : portraitPage;
 	if (newOrientation != m_orientation)
 	{
-		pageOrientationComboBox->blockSignals(true);
-		pageOrientationComboBox->setCurrentIndex(newOrientation);
-		pageOrientationComboBox->blockSignals(false);
 		m_orientation = newOrientation;
+
+		QSignalBlocker sigOri(pageOrientationButtons);
+		pageOrientationButtons->button(newOrientation)->setChecked(true);
+		QSignalBlocker sigFormats(listPageFormats);
+		listPageFormats->setOrientation(m_orientation);
 	}
 }
 
 void NewDocDialog::selectItem(uint nr)
 {
-	disconnect(layoutsView, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(itemSelected(QListWidgetItem*)));
-	disconnect(layoutsView, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(itemSelected(QListWidgetItem*)));
-	disconnect(layoutsView, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(itemSelected(QListWidgetItem*)));
-	disconnect(layoutsView, SIGNAL(itemPressed(QListWidgetItem*)), this, SLOT(itemSelected(QListWidgetItem*)));
-	if (nr > 0)
-	{
-		const QStringList& pageNames = prefsManager.appPrefs.pageSets[nr].pageNames;
-		firstPage->setEnabled(true);
-		firstPage->clear();
-		for (auto pNames = pageNames.begin(); pNames != pageNames.end(); ++pNames)
-			firstPage->addItem(CommonStrings::translatePageSetLocString((*pNames)));
-	}
-	else
-	{
-		firstPage->clear();
-		firstPage->addItem(" ");
-		firstPage->setEnabled(false);
-	}
-	layoutsView->setCurrentRow(nr);
-	layoutsView->item(nr)->setSelected(true);
-	connect(layoutsView, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(itemSelected(QListWidgetItem*)));
-	connect(layoutsView, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(itemSelected(QListWidgetItem*)));
-	connect(layoutsView, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(itemSelected(QListWidgetItem*)));
-	connect(layoutsView, SIGNAL(itemPressed(QListWidgetItem*)), this, SLOT(itemSelected(QListWidgetItem*)));
+	pageLayouts->setScheme(nr);
+	pageLayouts->setFirstPage(nr);
 }
 
-void NewDocDialog::itemSelected(QListWidgetItem* ic)
+void NewDocDialog::changePageSize(QListWidgetItem *ic)
 {
 	if (ic == nullptr)
 		return;
-	selectItem(layoutsView->row(ic));
-	setDocLayout(layoutsView->row(ic));
+
+	int unit = ic->data(Qt::UserRole + 1).toInt();
+	QString size = ic->data(Qt::UserRole + 3).toString();
+
+	setUnit(unit);
+	setPageSize(size);
+
+	QSignalBlocker sig(unitOfMeasureComboBox);
+	unitOfMeasureComboBox->setCurrentIndex(unit);
+
 }
 
+void NewDocDialog::changeScheme(int ic)
+{
+	selectItem(ic);
+	setDocLayout(ic);
+}
+
 void NewDocDialog::handleAutoFrame()
 {
 	if (autoTextFrame->isChecked())
 	{
-		TextLabel3->setEnabled(true);
-		TextLabel4->setEnabled(true);
+		labelColumns->setEnabled(true);
+		labelGap->setEnabled(true);
 		Distance->setEnabled(true);
 		numberOfCols->setEnabled(true);
 	}
 	else
 	{
-		TextLabel3->setEnabled(false);
-		TextLabel4->setEnabled(false);
+		labelColumns->setEnabled(false);
+		labelGap->setEnabled(false);
 		Distance->setEnabled(false);
 		numberOfCols->setEnabled(false);
 	}
@@ -547,6 +386,9 @@
 	marginGroup->setNewUnit(m_unitIndex);
 	marginGroup->setPageHeight(m_pageHeight);
 	marginGroup->setPageWidth(m_pageWidth);
+	bleedGroup->setNewUnit(m_unitIndex);
+	bleedGroup->setPageHeight(m_pageHeight);
+	bleedGroup->setPageWidth(m_pageWidth);
 	connect(widthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setWidth(double)));
 	connect(heightSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setHeight(double)));
 }
@@ -555,10 +397,10 @@
 {
 	m_pageWidth = widthSpinBox->value() / m_unitRatio;
 	m_pageHeight = heightSpinBox->value() / m_unitRatio;
-	m_bleedBottom = marginGroup->bottomBleed();
-	m_bleedTop = marginGroup->topBleed();
-	m_bleedLeft = marginGroup->leftBleed();
-	m_bleedRight = marginGroup->rightBleed();
+	m_bleedBottom = bleedGroup->margins().bottom();
+	m_bleedTop = bleedGroup->margins().top();
+	m_bleedLeft = bleedGroup->margins().left();
+	m_bleedRight = bleedGroup->margins().right();
 	if (m_onStartup)
 	{
 		m_tabSelected = tabWidget->currentIndex();
@@ -612,16 +454,14 @@
 	}
 	// #869 pv - defined constants added + code repeat (check w/h)
 	(ori == portraitPage) ? m_orientation = portraitPage : m_orientation = landscapePage;
-	if (pageSizeComboBox->currentText() == CommonStrings::trCustomPageSize)
-	{
-		if (widthSpinBox->value() > heightSpinBox->value())
-			pageOrientationComboBox->setCurrentIndex(landscapePage);
-		else
-			pageOrientationComboBox->setCurrentIndex(portraitPage);
-	}
+	listPageFormats->setOrientation(ori);
 	// end of #869
 	marginGroup->setPageHeight(m_pageHeight);
 	marginGroup->setPageWidth(m_pageWidth);
+	bleedGroup->setPageHeight(m_pageHeight);
+	bleedGroup->setPageWidth(m_pageWidth);
+	pagePreview->setPage(m_pageHeight, m_pageWidth, marginGroup->margins(), bleedGroup->margins(), m_pageSize, m_choosenLayout, pageLayouts->firstPage());
+
 	connect(widthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setWidth(double)));
 	connect(heightSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setHeight(double)));
 }
@@ -628,14 +468,13 @@
 
 void NewDocDialog::setPageSize(const QString &size)
 {
-	if (size == CommonStrings::trCustomPageSize)
-		setSize(size);
-	else
-	{
-		setSize(size);
-		setOrientation(pageOrientationComboBox->currentIndex());
-	}
+	setSize(size);
+
+	if (size != CommonStrings::customPageSize)
+		setOrientation(pageOrientationButtons->checkedId());
+
 	marginGroup->setPageSize(size);
+	bleedGroup->setPageSize(size);
 }
 
 void NewDocDialog::setSize(const QString& gr)
@@ -642,6 +481,7 @@
 {
 	m_pageWidth = widthSpinBox->value() / m_unitRatio;
 	m_pageHeight = heightSpinBox->value() / m_unitRatio;
+	m_pageSize = gr;
 
 	disconnect(widthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setWidth(double)));
 	disconnect(heightSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setHeight(double)));
@@ -653,7 +493,7 @@
 	else
 	{
 		PageSize ps2(gr);
-		if (pageOrientationComboBox->currentIndex() == portraitPage)
+		if (pageOrientationButtons->checkedId() == portraitPage)
 		{
 			m_pageWidth = ps2.width();
 			m_pageHeight = ps2.height();
@@ -668,15 +508,23 @@
 	heightSpinBox->setValue(m_pageHeight * m_unitRatio);
 	marginGroup->setPageHeight(m_pageHeight);
 	marginGroup->setPageWidth(m_pageWidth);
+	bleedGroup->setPageHeight(m_pageHeight);
+	bleedGroup->setPageWidth(m_pageWidth);
+	pagePreview->setPage(m_pageHeight, m_pageWidth, marginGroup->margins(), bleedGroup->margins(), m_pageSize, m_choosenLayout, pageLayouts->firstPage());
+
 	connect(widthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setWidth(double)));
 	connect(heightSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setHeight(double)));
+
 }
 
 void NewDocDialog::setDocLayout(int layout)
 {
 	marginGroup->setFacingPages(layout != singlePage);
+	bleedGroup->setFacingPages(layout != singlePage);
 	m_choosenLayout = layout;
-	firstPage->setCurrentIndex(prefsManager.appPrefs.pageSets[m_choosenLayout].FirstPage);
+	pageLayouts->setScheme(m_choosenLayout);
+	pageLayouts->setFirstPage(prefsManager.appPrefs.pageSets[m_choosenLayout].FirstPage);
+	pagePreview->setPage(m_pageHeight, m_pageWidth, marginGroup->margins(), bleedGroup->margins(), m_pageSize, m_choosenLayout, pageLayouts->firstPage());
 }
 
 void NewDocDialog::recentDocListBox_doubleClicked()
@@ -698,7 +546,7 @@
 		setWindowTitle(tr("Open Recent Document"));
 	else
 		setWindowTitle(tr("New Document"));
-	okButton->setEnabled(tab!=2);
+	//okButton->setEnabled(tab!=2);
 }
 
 void NewDocDialog::locationDropped(const QString& fileUrl)
@@ -750,5 +598,29 @@
 
 void NewDocDialog::openFileDialogFileClicked(const QString& path)
 {
-	okButton->setEnabled(!path.isEmpty());
+	//okButton->setEnabled(!path.isEmpty());
 }
+
+void NewDocDialog::changeMargin(MarginStruct margin)
+{
+	pagePreview->setMargins(margin);
+}
+
+void NewDocDialog::changeBleed(MarginStruct bleed)
+{
+	pagePreview->setBleeds(bleed);
+}
+
+void NewDocDialog::changeFirstPage(int firstPage)
+{
+	pagePreview->setFirstPage(firstPage);
+}
+
+void NewDocDialog::changeCategory(PageSizeInfo::Category category)
+{
+	if (listPageFormats->category() == category)
+		return;
+
+	listPageFormats->setFormat(m_pageSize);
+	listPageFormats->setCategory(category);
+}
Index: scribus/ui/newdocdialog.h
===================================================================
--- scribus/ui/newdocdialog.h	(Revision 26264)
+++ scribus/ui/newdocdialog.h	(Arbeitskopie)
@@ -33,31 +33,19 @@
 #include "ui/customfdialog.h"
 #include "ui/nftwidget.h"
 
+#include "ui_newdocdialog.h"
+
 class PrefsManager;
-class MarginWidget;
+class NewMarginWidget;
 class ScrSpinBox;
 class QFileDialog;
 
-class SCRIBUS_API PageLayoutsWidget : public QListWidget
+class SCRIBUS_API NewDocDialog : public QDialog, public Ui::newDocDialog
 {
 	Q_OBJECT
 
 public:
-	PageLayoutsWidget(QWidget* parent);
-	~PageLayoutsWidget() = default;
-	void arrangeIcons();
-	QSize minimumSizeHint() const override;
-	int maxX {0};
-	int maxY {0};
-};
 
-
-class SCRIBUS_API NewDocDialog : public QDialog
-{
-	Q_OBJECT
-
-public:
-
 	//! \brief Indexes of the dialog's tabs.
 	enum {
 		NewDocumentTab = 0,
@@ -70,48 +58,12 @@
 	~NewDocDialog() = default;
 
 	void createNewDocPage();
-	void createNewFromTempPage();
 	void createOpenDocPage();
 	void createRecentDocPage();
 	void setSize(const QString& gr);
+	QString pageSizeName() { return m_pageSize; };
 
-	QTabWidget* tabWidget {nullptr};
-	QFrame* newDocFrame {nullptr};
-	PageLayoutsWidget* layoutsView {nullptr};
-	QLabel* layoutLabel1 {nullptr};
-	QComboBox* firstPage {nullptr};
-	QGroupBox* pageSizeGroupBox {nullptr};
-	MarginWidget* marginGroup {nullptr};
-	QGroupBox* optionsGroupBox {nullptr};
-	QLabel* TextLabel1 {nullptr};
-	QLabel* TextLabel2 {nullptr};
-	QLabel* TextLabel3 {nullptr};
-	QLabel* TextLabel4 {nullptr};
-	QLabel* TextLabel1_2 {nullptr};
-	QLabel* TextLabel1_3 {nullptr};
-	QLabel* pageCountLabel {nullptr};
-	QLabel* TextLabel2_2 {nullptr};
-	QLabel* unitOfMeasureLabel {nullptr};
-	QComboBox* pageSizeComboBox {nullptr};
-	QComboBox* pageOrientationComboBox {nullptr};
-	QComboBox* unitOfMeasureComboBox {nullptr};
-	QCheckBox* startUpDialog {nullptr};
-	QCheckBox* autoTextFrame {nullptr};
-	QCheckBox* startDocSetup {nullptr};
-	ScrSpinBox* Distance {nullptr};
-	QSpinBox* numberOfCols {nullptr};
-	QSpinBox* pageCountSpinBox {nullptr};
-	ScrSpinBox* widthSpinBox {nullptr};
-	ScrSpinBox* heightSpinBox {nullptr};
-	QFrame* openDocFrame {nullptr};
 	QFileDialog *fileDialog {nullptr};
-	QFrame* newFromTempFrame {nullptr};
-	nftwidget *nftGui {nullptr};
-	QFrame* recentDocFrame {nullptr};
-	QListWidget* recentDocListBox {nullptr};
-	QDialogButtonBox* buttonBox {nullptr};
-	QPushButton* okButton {nullptr};
-	QPushButton* cancelButton {nullptr};
 
 	bool onStartup() const { return m_onStartup;}
 	int tabSelected() const { return m_tabSelected;}
@@ -134,8 +86,7 @@
 public slots:
 	void setHeight(double v);
 	void setWidth(double v);
-	void selectItem(uint nr);
-	void itemSelected(QListWidgetItem* ic);
+	void selectItem(uint nr);	
 	void handleAutoFrame();
 	void setDistance(double v);
 	void setUnit(int u);
@@ -156,17 +107,18 @@
 	void gotoHomeDirectory();
 	void openFileDialogFileClicked(const QString &path);
 
+private slots:
+	void changeMargin(MarginStruct margin);
+	void changeBleed(MarginStruct bleed);
+	void changeFirstPage(int firstPage);
+	void changeCategory(PageSizeInfo::Category category);
+	void changePageSize(QListWidgetItem* ic);
+	void changeScheme(int ic);
+
 protected:
-	QVBoxLayout* TabbedNewDocLayout {nullptr};
-	QHBoxLayout* Layout1 {nullptr};
-	QGridLayout* NewDocLayout {nullptr};
-	QGridLayout* pageSizeGroupBoxLayout {nullptr};
-	QGridLayout* optionsGroupBoxLayout {nullptr};
-	QVBoxLayout* openDocLayout {nullptr};
-	QVBoxLayout* recentDocLayout {nullptr};
-	QVBoxLayout *verticalLayout {nullptr};
 	PrefsManager& prefsManager;
 	QStringList recentDocList;
+	QButtonGroup* pageOrientationButtons;
 
 	double m_unitRatio { 1.0 };
 	int m_orientation { 0 };
@@ -176,6 +128,7 @@
 	double m_distance { 11.0 };
 	QString m_unitSuffix;
 	QString m_selectedFile;
+	QString m_pageSize;
 	int m_unitIndex { 0 };
 	int m_tabSelected { 0 };
 	bool m_onStartup { false };
Index: scribus/ui/newdocdialog.ui
===================================================================
--- scribus/ui/newdocdialog.ui	(nicht existent)
+++ scribus/ui/newdocdialog.ui	(Arbeitskopie)
@@ -0,0 +1,755 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>newDocDialog</class>
+ <widget class="QDialog" name="newDocDialog">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>938</width>
+    <height>606</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <widget class="QTabWidget" name="tabWidget">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <property name="tabBarAutoHide">
+      <bool>true</bool>
+     </property>
+     <widget class="QWidget" name="tab">
+      <attribute name="title">
+       <string>New Document</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout" columnstretch="1,0,0">
+       <property name="leftMargin">
+        <number>8</number>
+       </property>
+       <property name="topMargin">
+        <number>8</number>
+       </property>
+       <property name="rightMargin">
+        <number>8</number>
+       </property>
+       <property name="bottomMargin">
+        <number>8</number>
+       </property>
+       <property name="spacing">
+        <number>4</number>
+       </property>
+       <item row="1" column="0">
+        <widget class="PageSizeList" name="listPageFormats"/>
+       </item>
+       <item row="3" column="0">
+        <widget class="QCheckBox" name="startDocSetup">
+         <property name="text">
+          <string>Show Document Settings After Creation</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="0">
+        <layout class="QHBoxLayout" name="horizontalLayout_8">
+         <property name="spacing">
+          <number>4</number>
+         </property>
+         <item>
+          <widget class="PageSizeSelector" name="pageSizeSelector" native="true"/>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_4">
+           <property name="orientation">
+            <enum>Qt::Orientation::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>16</width>
+             <height>0</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QComboBox" name="unitOfMeasureComboBox"/>
+         </item>
+        </layout>
+       </item>
+       <item row="0" column="1" rowspan="3" colspan="2">
+        <widget class="QScrollArea" name="scrollArea">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="minimumSize">
+          <size>
+           <width>380</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="frameShape">
+          <enum>QFrame::Shape::NoFrame</enum>
+         </property>
+         <property name="widgetResizable">
+          <bool>true</bool>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
+         </property>
+         <widget class="QWidget" name="scrollAreaWidgetContents">
+          <property name="geometry">
+           <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>366</width>
+            <height>531</height>
+           </rect>
+          </property>
+          <layout class="QVBoxLayout" name="verticalLayout_7">
+           <property name="spacing">
+            <number>0</number>
+           </property>
+           <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="SectionContainer" name="sectionPreview">
+             <property name="title" stdset="0">
+              <string>Preview</string>
+             </property>
+             <widget class="QWidget" name="page_5">
+              <layout class="QVBoxLayout" name="verticalLayout_4">
+               <property name="spacing">
+                <number>0</number>
+               </property>
+               <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="PageSizePreview" name="pagePreview" native="true">
+                 <property name="minimumSize">
+                  <size>
+                   <width>120</width>
+                   <height>120</height>
+                  </size>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </widget>
+            </widget>
+           </item>
+           <item>
+            <widget class="SectionContainer" name="sectionDocument">
+             <property name="title" stdset="0">
+              <string>Document</string>
+             </property>
+             <widget class="QWidget" name="page">
+              <layout class="QVBoxLayout" name="verticalLayout_6">
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_10">
+                 <item>
+                  <widget class="FormWidget" name="labelPageWidth">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                   <property name="label" stdset="0">
+                    <string>Width</string>
+                   </property>
+                   <layout class="QHBoxLayout" name="horizontalLayout_9">
+                    <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="ScrSpinBox" name="widthSpinBox"/>
+                    </item>
+                   </layout>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="FormWidget" name="labelPageHeight">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                   <property name="label" stdset="0">
+                    <string>Height</string>
+                   </property>
+                   <layout class="QHBoxLayout" name="horizontalLayout_11">
+                    <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="ScrSpinBox" name="heightSpinBox"/>
+                    </item>
+                   </layout>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_5">
+                   <property name="orientation">
+                    <enum>Qt::Orientation::Horizontal</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>0</width>
+                     <height>0</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_12" stretch="0,0,0,0,0,1">
+                 <item>
+                  <widget class="FormWidget" name="pageCountLabel">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                   <property name="label" stdset="0">
+                    <string>Pages</string>
+                   </property>
+                   <layout class="QHBoxLayout" name="horizontalLayout_2">
+                    <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="QSpinBox" name="pageCountSpinBox"/>
+                    </item>
+                   </layout>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_7">
+                   <property name="orientation">
+                    <enum>Qt::Orientation::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Policy::Fixed</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>16</width>
+                     <height>0</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item>
+                  <widget class="FormWidget" name="formWidget">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                   <property name="label" stdset="0">
+                    <string>Orientation</string>
+                   </property>
+                   <layout class="QHBoxLayout" name="horizontalLayout_4">
+                    <property name="spacing">
+                     <number>4</number>
+                    </property>
+                    <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>
+                     <spacer name="horizontalSpacer_3">
+                      <property name="orientation">
+                       <enum>Qt::Orientation::Horizontal</enum>
+                      </property>
+                      <property name="sizeHint" stdset="0">
+                       <size>
+                        <width>0</width>
+                        <height>0</height>
+                       </size>
+                      </property>
+                     </spacer>
+                    </item>
+                    <item>
+                     <widget class="QToolButton" name="buttonVertical">
+                      <property name="text">
+                       <string/>
+                      </property>
+                      <property name="checkable">
+                       <bool>true</bool>
+                      </property>
+                      <property name="checked">
+                       <bool>true</bool>
+                      </property>
+                      <property name="autoExclusive">
+                       <bool>true</bool>
+                      </property>
+                     </widget>
+                    </item>
+                    <item>
+                     <widget class="QToolButton" name="buttonHorizontal">
+                      <property name="text">
+                       <string/>
+                      </property>
+                      <property name="checkable">
+                       <bool>true</bool>
+                      </property>
+                      <property name="autoExclusive">
+                       <bool>true</bool>
+                      </property>
+                     </widget>
+                    </item>
+                    <item>
+                     <spacer name="horizontalSpacer_8">
+                      <property name="orientation">
+                       <enum>Qt::Orientation::Horizontal</enum>
+                      </property>
+                      <property name="sizeHint" stdset="0">
+                       <size>
+                        <width>0</width>
+                        <height>0</height>
+                       </size>
+                      </property>
+                     </spacer>
+                    </item>
+                   </layout>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_2">
+                   <property name="orientation">
+                    <enum>Qt::Orientation::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Policy::Fixed</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>16</width>
+                     <height>0</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item>
+                  <widget class="PageLayouts" name="pageLayouts" native="true"/>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_6">
+                   <property name="orientation">
+                    <enum>Qt::Orientation::Horizontal</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>0</width>
+                     <height>0</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+              </layout>
+             </widget>
+            </widget>
+           </item>
+           <item>
+            <widget class="SectionContainer" name="sectionMargins">
+             <property name="title" stdset="0">
+              <string>Margins</string>
+             </property>
+             <widget class="QWidget" name="page_2">
+              <layout class="QVBoxLayout" name="verticalLayout_8">
+               <item>
+                <widget class="NewMarginWidget" name="marginGroup" native="true"/>
+               </item>
+              </layout>
+             </widget>
+            </widget>
+           </item>
+           <item>
+            <widget class="SectionContainer" name="sectionBleeds">
+             <property name="title" stdset="0">
+              <string>Bleeds</string>
+             </property>
+             <widget class="QWidget" name="page_3">
+              <layout class="QVBoxLayout" name="verticalLayout_9">
+               <item>
+                <widget class="NewMarginWidget" name="bleedGroup" native="true"/>
+               </item>
+              </layout>
+             </widget>
+            </widget>
+           </item>
+           <item>
+            <widget class="SectionContainer" name="sectionTextFrame">
+             <property name="title" stdset="0">
+              <string>Text Frame</string>
+             </property>
+             <property name="isCollapsed">
+              <bool>false</bool>
+             </property>
+             <widget class="QWidget" name="page_4">
+              <layout class="QVBoxLayout" name="verticalLayout_10">
+               <item>
+                <widget class="QCheckBox" name="autoTextFrame">
+                 <property name="text">
+                  <string>&amp;Automatic Text Frame</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_3">
+                 <item>
+                  <widget class="FormWidget" name="labelColumns">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                   <property name="label" stdset="0">
+                    <string>Columns</string>
+                   </property>
+                   <layout class="QHBoxLayout" name="horizontalLayout_5">
+                    <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="QSpinBox" name="numberOfCols"/>
+                    </item>
+                   </layout>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="FormWidget" name="labelGap">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                   <property name="label" stdset="0">
+                    <string>Gap</string>
+                   </property>
+                   <layout class="QHBoxLayout" name="horizontalLayout_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="ScrSpinBox" name="Distance"/>
+                    </item>
+                   </layout>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer">
+                   <property name="orientation">
+                    <enum>Qt::Orientation::Horizontal</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>0</width>
+                     <height>0</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+              </layout>
+             </widget>
+            </widget>
+           </item>
+           <item>
+            <spacer name="verticalSpacer">
+             <property name="orientation">
+              <enum>Qt::Orientation::Vertical</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>0</width>
+               <height>0</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+          </layout>
+         </widget>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_2">
+      <attribute name="title">
+       <string>New from Template</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <property name="spacing">
+        <number>4</number>
+       </property>
+       <property name="leftMargin">
+        <number>8</number>
+       </property>
+       <property name="topMargin">
+        <number>8</number>
+       </property>
+       <property name="rightMargin">
+        <number>8</number>
+       </property>
+       <property name="bottomMargin">
+        <number>8</number>
+       </property>
+       <item>
+        <widget class="nftwidget" name="nftGui" native="true"/>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_3">
+      <attribute name="title">
+       <string>Open Existing Document</string>
+      </attribute>
+     </widget>
+     <widget class="QWidget" name="tab_4">
+      <attribute name="title">
+       <string>Open Recent Document</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_3">
+       <property name="spacing">
+        <number>4</number>
+       </property>
+       <property name="leftMargin">
+        <number>8</number>
+       </property>
+       <property name="topMargin">
+        <number>8</number>
+       </property>
+       <property name="rightMargin">
+        <number>8</number>
+       </property>
+       <property name="bottomMargin">
+        <number>8</number>
+       </property>
+       <item>
+        <widget class="QListWidget" name="recentDocListBox"/>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <property name="leftMargin">
+      <number>8</number>
+     </property>
+     <item>
+      <widget class="QCheckBox" name="startUpDialog">
+       <property name="text">
+        <string>Do not show this dialog again</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QDialogButtonBox" name="buttonBox">
+       <property name="orientation">
+        <enum>Qt::Orientation::Horizontal</enum>
+       </property>
+       <property name="standardButtons">
+        <set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>FormWidget</class>
+   <extends>QWidget</extends>
+   <header>ui/widgets/form_widget.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>SectionContainer</class>
+   <extends>QWidget</extends>
+   <header>ui/widgets/section_container.h</header>
+   <addpagemethod>setWidget</addpagemethod>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>ScrSpinBox</class>
+   <extends>QDoubleSpinBox</extends>
+   <header location="global">ui/scrspinbox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>NewMarginWidget</class>
+   <extends>QWidget</extends>
+   <header location="global">ui/newmarginwidget.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>PageLayouts</class>
+   <extends>QWidget</extends>
+   <header location="global">ui/widgets/pagelayout.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>PageSizeList</class>
+   <extends>QListWidget</extends>
+   <header>ui/widgets/pagesizelist.h</header>
+  </customwidget>
+  <customwidget>
+   <class>nftwidget</class>
+   <extends>QWidget</extends>
+   <header>ui/nftwidget.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>PageSizePreview</class>
+   <extends>QWidget</extends>
+   <header>ui/widgets/pagesizepreview.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>PageSizeSelector</class>
+   <extends>QWidget</extends>
+   <header>ui/widgets/pagesizeselector.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <tabstops>
+  <tabstop>tabWidget</tabstop>
+  <tabstop>listPageFormats</tabstop>
+  <tabstop>unitOfMeasureComboBox</tabstop>
+  <tabstop>scrollArea</tabstop>
+  <tabstop>widthSpinBox</tabstop>
+  <tabstop>heightSpinBox</tabstop>
+  <tabstop>pageCountSpinBox</tabstop>
+  <tabstop>buttonVertical</tabstop>
+  <tabstop>buttonHorizontal</tabstop>
+  <tabstop>autoTextFrame</tabstop>
+  <tabstop>numberOfCols</tabstop>
+  <tabstop>Distance</tabstop>
+  <tabstop>startDocSetup</tabstop>
+  <tabstop>startUpDialog</tabstop>
+  <tabstop>recentDocListBox</tabstop>
+ </tabstops>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>newDocDialog</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>248</x>
+     <y>254</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>157</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>newDocDialog</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
Index: scribus/ui/newmarginwidget.cpp
===================================================================
--- scribus/ui/newmarginwidget.cpp	(Revision 26264)
+++ scribus/ui/newmarginwidget.cpp	(Arbeitskopie)
@@ -10,6 +10,7 @@
 #include "units.h"
 #include "ui/marginpresetlayout.h"
 #include "ui/useprintermarginsdialog.h"
+#include "scribusapp.h"
 
 NewMarginWidget::NewMarginWidget(QWidget* parent)
 	: QWidget(parent)
@@ -39,8 +40,8 @@
 		presetLayoutLabel->resize(0,0);
 		presetLayoutComboBox->hide();
 		presetLayoutLabel->hide();
-		gridLayout->removeWidget(presetLayoutComboBox);
-		gridLayout->removeWidget(presetLayoutLabel);
+		horizontalLayout->removeWidget(presetLayoutComboBox);
+		horizontalLayout->removeWidget(presetLayoutLabel);
 	}
 	if ((m_flags & ShowPrinterMargins) == 0)
 	{
@@ -47,14 +48,14 @@
 		printerMarginsPushButton->blockSignals(true);
 		printerMarginsPushButton->resize(0,0);
 		printerMarginsPushButton->hide();
-		gridLayout->removeWidget(printerMarginsPushButton);
+		horizontalLayout->removeWidget(printerMarginsPushButton);
 	}
 	setFacingPages(!(layoutType == singlePage));
 
-	gridLayout->invalidate();
-
 	languageChange();
+	iconSetChange();
 
+	connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange()));
 	connect(topMarginSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setTop()));
 	connect(bottomMarginSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setBottom()));
 	connect(leftMarginSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setLeft()));
@@ -83,8 +84,15 @@
 		marginLinkButton->setToolTip( "<qt>" + tr( "Ensure all bleeds have the same value" ) + "</qt>");
 	}
 	printerMarginsPushButton->setToolTip( "<qt>" + tr( "Import the margins for the selected page size from the available printers" ) + "</qt>");
+
+	leftMarginLabel->setText( m_facingPages ? tr("Inside") : tr("Left"));
+	rightMarginLabel->setText( m_facingPages ? tr("Outside") : tr("Right"));
 }
 
+void NewMarginWidget::iconSetChange()
+{
+}
+
 void NewMarginWidget::setNewValues(const MarginStruct& margs)
 {
 	m_marginData = m_savedMarginData = margs;
@@ -234,6 +242,8 @@
 	topMarginSpinBox->blockSignals(false);
 	bottomMarginSpinBox->blockSignals(false);
 	m_savedPresetItem = item;
+
+	emit marginChanged(m_marginData);
 }
 
 void NewMarginWidget::setPageSize(const QString& pageSize)
@@ -274,6 +284,8 @@
 		rightMarginSpinBox->setValue(leftMarginSpinBox->value());
 		double newVal = leftMarginSpinBox->value() / m_unitRatio;
 		m_marginData.set(newVal, newVal, newVal, newVal);
+
+		emit marginChanged(m_marginData);
 	}
 
 	leftMarginSpinBox->blockSignals(leftBlocked);
@@ -324,8 +336,10 @@
 {
 	m_facingPages = facing;
 	m_pageType = pageType;
-	leftMarginLabel->setText(facing ? tr( "&Inside:" ) : tr( "&Left:" ));
-	rightMarginLabel->setText(facing ? tr( "O&utside:" ) : tr( "&Right:" ));
+
+	leftMarginLabel->setText( m_facingPages ? tr("Inside") : tr("Left"));
+	rightMarginLabel->setText( m_facingPages ? tr("Outside") : tr("Right"));
+
 	setPreset();
 }
 
Index: scribus/ui/newmarginwidget.h
===================================================================
--- scribus/ui/newmarginwidget.h	(Revision 26264)
+++ scribus/ui/newmarginwidget.h	(Arbeitskopie)
@@ -41,10 +41,12 @@
 		void setNewValues(const MarginStruct& margs);
 		/*! \brief Setup the presetCombo without changing the margin values, only used by tabdocument */
 		void setMarginPreset(int p);
+		int marginPreset() { return m_savedPresetItem; };
 		const MarginStruct & margins() const { return m_marginData; };
 
 	public slots:
 		void languageChange();
+		void iconSetChange();
 		void setTop();
 		void setBottom();
 		void setLeft();
@@ -69,6 +71,9 @@
 		int    m_pageType {0};
 		int    m_savedPresetItem {PresetLayout::none};
 		int    m_unitIndex {0};
+
+signals:
+		void marginChanged(MarginStruct);
 };
 
 #endif // NEWMARGINWIDGET_H
Index: scribus/ui/newmarginwidgetbase.ui
===================================================================
--- scribus/ui/newmarginwidgetbase.ui	(Revision 26264)
+++ scribus/ui/newmarginwidgetbase.ui	(Arbeitskopie)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>308</width>
-    <height>230</height>
+    <width>180</width>
+    <height>186</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -16,82 +16,35 @@
     <verstretch>0</verstretch>
    </sizepolicy>
   </property>
-  <layout class="QGridLayout" name="gridLayout_2">
+  <layout class="QGridLayout" name="gridLayout">
    <property name="leftMargin">
-    <number>0</number>
+    <number>8</number>
    </property>
    <property name="topMargin">
-    <number>0</number>
+    <number>8</number>
    </property>
    <property name="rightMargin">
-    <number>0</number>
+    <number>8</number>
    </property>
    <property name="bottomMargin">
-    <number>0</number>
+    <number>8</number>
    </property>
-   <item row="0" column="0">
-    <layout class="QGridLayout" name="gridLayout">
-     <item row="4" column="0">
-      <widget class="QLabel" name="bottomMarginLabel">
-       <property name="text">
-        <string>Bottom:</string>
-       </property>
-       <property name="buddy">
-        <cstring>bottomMarginSpinBox</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="0">
-      <widget class="QLabel" name="leftMarginLabel">
-       <property name="text">
-        <string>Left:</string>
-       </property>
-       <property name="buddy">
-        <cstring>leftMarginSpinBox</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="4" column="1">
-      <widget class="ScrSpinBox" name="bottomMarginSpinBox">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="0">
-      <widget class="QLabel" name="rightMarginLabel">
-       <property name="text">
-        <string>Right:</string>
-       </property>
-       <property name="buddy">
-        <cstring>rightMarginSpinBox</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="0">
+   <property name="spacing">
+    <number>4</number>
+   </property>
+   <item row="0" column="1" colspan="3">
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
       <widget class="QLabel" name="presetLayoutLabel">
        <property name="text">
-        <string>Preset Layouts:</string>
+        <string>Preset:</string>
        </property>
       </widget>
      </item>
-     <item row="3" column="0">
-      <widget class="QLabel" name="topMarginLabel">
-       <property name="text">
-        <string>Top:</string>
-       </property>
-       <property name="buddy">
-        <cstring>topMarginSpinBox</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="1">
-      <widget class="ScrSpinBox" name="leftMarginSpinBox">
+     <item>
+      <widget class="PresetLayout" name="presetLayoutComboBox">
        <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
@@ -98,37 +51,159 @@
        </property>
       </widget>
      </item>
-     <item row="2" column="1">
-      <widget class="ScrSpinBox" name="rightMarginSpinBox">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
+     <item>
+      <spacer name="horizontalSpacer_5">
+       <property name="orientation">
+        <enum>Qt::Orientation::Horizontal</enum>
        </property>
-      </widget>
-     </item>
-     <item row="3" column="1">
-      <widget class="ScrSpinBox" name="topMarginSpinBox">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>0</width>
+         <height>0</height>
+        </size>
        </property>
-      </widget>
+      </spacer>
      </item>
-     <item row="0" column="1">
-      <widget class="PresetLayout" name="presetLayoutComboBox">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-      </widget>
-     </item>
-     <item row="5" column="1">
+    </layout>
+   </item>
+   <item row="1" column="2" rowspan="2">
+    <widget class="FormWidget" name="formWidget">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="label" stdset="0">
+      <string/>
+     </property>
+     <property name="font">
+      <font>
+       <pointsize>8</pointsize>
+      </font>
+     </property>
+     <property name="preserveLabelSpace">
+      <bool>true</bool>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_2">
+      <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="LinkButton" name="marginLinkButton">
+        <property name="text">
+         <string/>
+        </property>
+        <property name="checkable">
+         <bool>true</bool>
+        </property>
+        <property name="toolButtonStyle">
+         <enum>Qt::ToolButtonStyle::ToolButtonIconOnly</enum>
+        </property>
+        <property name="autoRaise">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="1" column="1">
+    <widget class="FormWidget" name="leftMarginLabel">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="label" stdset="0">
+      <string>Left</string>
+     </property>
+     <property name="font">
+      <font>
+       <pointsize>8</pointsize>
+      </font>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_5">
+      <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="ScrSpinBox" name="leftMarginSpinBox">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="2" column="1">
+    <widget class="FormWidget" name="topMarginLabel">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="label" stdset="0">
+      <string>Top</string>
+     </property>
+     <property name="font">
+      <font>
+       <pointsize>8</pointsize>
+      </font>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_3">
+      <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="ScrSpinBox" name="topMarginSpinBox">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="4" column="1" colspan="3">
+    <layout class="QHBoxLayout" name="horizontalLayout_4">
+     <item>
       <widget class="QPushButton" name="printerMarginsPushButton">
        <property name="text">
         <string>Printer Margins...</string>
@@ -135,43 +210,118 @@
        </property>
       </widget>
      </item>
-     <item row="1" column="2" rowspan="4">
-      <widget class="LinkButton" name="marginLinkButton">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Orientation::Horizontal</enum>
        </property>
-       <property name="minimumSize">
+       <property name="sizeHint" stdset="0">
         <size>
-         <width>15</width>
+         <width>0</width>
          <height>0</height>
         </size>
        </property>
-       <property name="text">
-        <string/>
-       </property>
-       <property name="checkable">
-        <bool>true</bool>
-       </property>
-       <property name="toolButtonStyle">
-        <enum>Qt::ToolButtonIconOnly</enum>
-       </property>
-       <property name="autoRaise">
-        <bool>true</bool>
-       </property>
-      </widget>
+      </spacer>
      </item>
     </layout>
    </item>
+   <item row="2" column="3">
+    <widget class="FormWidget" name="bottomMarginLabel">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="label" stdset="0">
+      <string>Bottom</string>
+     </property>
+     <property name="font">
+      <font>
+       <pointsize>8</pointsize>
+      </font>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_8">
+      <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="ScrSpinBox" name="bottomMarginSpinBox">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="1" column="3">
+    <widget class="FormWidget" name="rightMarginLabel">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="label" stdset="0">
+      <string>Right</string>
+     </property>
+     <property name="font">
+      <font>
+       <pointsize>8</pointsize>
+      </font>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_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="ScrSpinBox" name="rightMarginSpinBox">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
   </layout>
  </widget>
  <customwidgets>
   <customwidget>
+   <class>FormWidget</class>
+   <extends>QWidget</extends>
+   <header>ui/widgets/form_widget.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
    <class>ScrSpinBox</class>
    <extends>QDoubleSpinBox</extends>
-   <header>ui/scrspinbox.h</header>
+   <header location="global">ui/scrspinbox.h</header>
   </customwidget>
   <customwidget>
    <class>LinkButton</class>
@@ -189,8 +339,8 @@
   <tabstop>leftMarginSpinBox</tabstop>
   <tabstop>rightMarginSpinBox</tabstop>
   <tabstop>topMarginSpinBox</tabstop>
+  <tabstop>marginLinkButton</tabstop>
   <tabstop>bottomMarginSpinBox</tabstop>
-  <tabstop>marginLinkButton</tabstop>
   <tabstop>printerMarginsPushButton</tabstop>
  </tabstops>
  <resources/>
Index: scribus/ui/pagelayout.cpp
===================================================================
--- scribus/ui/pagelayout.cpp	(Revision 26264)
+++ scribus/ui/pagelayout.cpp	(nicht existent)
@@ -1,209 +0,0 @@
-/*
-For general Scribus (>=1.3.2) copyright and licensing information please refer
-to the COPYING file provided with the program. Following this notice may exist
-a copyright and/or license notice that predates the release of Scribus 1.3.2
-for which a new license (GPL+exception) is in place.
-*/
-#include "pagelayout.h"
-
-#include <QComboBox>
-#include <QToolButton>
-#include <QVBoxLayout>
-#include <QListWidgetItem>
-#include <QLabel>
-#include <QPixmap>
-#include <QList>
-
-#include "commonstrings.h"
-#include "iconmanager.h"
-#include "scribusapp.h"
-#include "ui/widgets/form_widget.h"
-
-PageLayouts::PageLayouts(QWidget* parent)  : QWidget( parent )
-{
-	struct PageSet pageS;
-	pageS.Name = CommonStrings::trPageSet2;
-	pageS.FirstPage = 0;
-	pageS.Rows = 1;
-	pageS.Columns = 1;
-	pageS.pageNames.clear();
-	pageS.pageNames.append(CommonStrings::trPageLocMiddleRight);
-	pageSets.append(pageS);
-
-	layoutGroupLayout = new QHBoxLayout(this);
-	layoutGroupLayout->setSpacing(4);
-	layoutGroupLayout->setContentsMargins(0, 0, 0, 0);
-
-	QFont layFont(this->font());
-	layFont.setPointSize(8);
-
-	menuScheme = new QMenu();
-
-	buttonScheme = new QToolButton(this);
-	buttonScheme->setPopupMode(QToolButton::InstantPopup);
-	buttonScheme->setMenu(menuScheme);
-
-	labelScheme = new FormWidget();
-	labelScheme->setFont(layFont);
-	labelScheme->addWidget(buttonScheme);
-	labelScheme->setLabelVisibility(!m_hideLabels);
-	layoutGroupLayout->addWidget( labelScheme );
-
-	menuFirstPage = new QMenu();
-
-	buttonFirstPage = new QToolButton(this);
-	buttonFirstPage->setPopupMode(QToolButton::InstantPopup);
-	buttonFirstPage->setMenu(menuFirstPage);
-
-	labelPages = new FormWidget();
-	labelPages->setFont(layFont);
-	labelPages->addWidget( buttonFirstPage );
-	labelPages->setLabelVisibility(!m_hideLabels);
-	layoutGroupLayout->addWidget( labelPages );
-
-	languageChange();
-
-	connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool)));
-	connect(menuScheme, &QMenu::triggered, this, &PageLayouts::schemeChanged);
-	connect(menuFirstPage, &QMenu::triggered, this, &PageLayouts::firstPageChanged);
-}
-
-void PageLayouts::updateSchemeSelector(const ScribusDoc* doc)
-{
-	pageSets = doc->pageSets();
-	docPagePositioning = doc->pagePositioning();
-	labelPages->setVisible( docPagePositioning > 0 );
-
-	reloadScheme();
-}
-
-void PageLayouts::selectFirstPage(int nr)
-{
-	if (menuFirstPage->actions().count() == 0)
-		return;
-
-	m_firstPage = qBound(0, nr, menuFirstPage->actions().count());
-	buttonFirstPage->setIcon(menuFirstPage->actions().at(m_firstPage)->icon());
-}
-
-void PageLayouts::selectScheme(int nr)
-{
-	if (menuScheme->actions().count() == 0)
-		return;
-
-	m_scheme = qBound(0, nr, menuScheme->actions().count());
-	buttonScheme->setIcon(menuScheme->actions().at(m_scheme)->icon());
-
-	reloadFirstPage(m_scheme);
-
-}
-
-void PageLayouts::setHideLabelsPermanently(bool hide)
-{
-	m_hideLabels = hide;
-	toggleLabelVisibility(!hide);
-}
-
-void PageLayouts::reloadScheme()
-{
-	disconnect(menuScheme, &QMenu::triggered, this, &PageLayouts::schemeChanged);
-
-	menuScheme->clear();
-
-	for (int pg = 0; pg < pageSets.count(); ++pg)
-	{
-		//Leave the code in for 3-/4- fold but exclude from UI in case we bring it back.
-		if (pg > 1 && docPagePositioning < 2)
-			continue;
-
-		QString psname = CommonStrings::translatePageSetString(pageSets[pg].Name);
-		if (pg == 0)
-			menuScheme->addAction(IconManager::instance().loadIcon("16/page-simple.png"), psname)->setData(QVariant(pg));
-		else if (pg == 1)
-			menuScheme->addAction(IconManager::instance().loadIcon("16/page-doublesided.png"), psname)->setData(QVariant(pg));
-		else if (pg == 2)
-			menuScheme->addAction(IconManager::instance().loadIcon("16/page-3fold.png"), psname)->setData(QVariant(pg));
-		else if (pg == 3)
-			menuScheme->addAction(IconManager::instance().loadIcon("16/page-4fold.png"), psname)->setData(QVariant(pg));
-		else
-			menuScheme->addAction(IconManager::instance().loadIcon("16/page-simple.png"), psname)->setData(QVariant(pg));
-	}
-
-	connect(menuScheme, &QMenu::triggered, this, &PageLayouts::schemeChanged);
-
-
-}
-
-void PageLayouts::reloadFirstPage(int scheme)
-{
-	disconnect(menuFirstPage, &QMenu::triggered, this, &PageLayouts::firstPageChanged);
-
-	menuFirstPage->clear();
-
-	// We have to add the other cases if want to support them again
-	// CommonStrings::trPageLocLeft
-	// CommonStrings::trPageLocMiddle
-	// CommonStrings::trPageLocMiddleLeft
-	// CommonStrings::trPageLocMiddleRight
-	// CommonStrings::trPageLocRight
-
-	for (int pg = 0; pg < pageSets[scheme].pageNames.count(); ++pg)
-	{
-		QString psname = CommonStrings::translatePageSetString(pageSets[scheme].pageNames[pg]);
-
-		if (psname == CommonStrings::trPageLocLeft)
-			menuFirstPage->addAction(IconManager::instance().loadIcon("page-first-left"), psname)->setData(QVariant(pg));
-		else if (psname == CommonStrings::trPageLocRight)
-			menuFirstPage->addAction(IconManager::instance().loadIcon("page-first-right"), psname)->setData(QVariant(pg));
-		else
-			menuFirstPage->addAction(IconManager::instance().loadIcon("page-first-left"), psname)->setData(QVariant(pg));
-	}
-
-	connect(menuFirstPage, &QMenu::triggered, this, &PageLayouts::firstPageChanged);
-
-
-}
-
-void PageLayouts::schemeSelected(int ic)
-{
-	reloadFirstPage(ic);
-	labelPages->setVisible( ic > 0 );
-	emit selectedScheme(ic);
-}
-
-void PageLayouts::toggleLabelVisibility(bool visibility)
-{
-	// hide labels always if flag is false
-	if (m_hideLabels)
-		visibility = false;
-
-	labelScheme->setLabelVisibility(visibility);
-	labelPages->setLabelVisibility(visibility);
-}
-
-void PageLayouts::languageChange()
-{
-
-	reloadScheme();
-	reloadFirstPage(m_scheme);
-
-	labelScheme->setText( tr( "Scheme" ) );
-	labelPages->setText( tr( "First Page" ) );
-
-	buttonScheme->setToolTip( tr( "Number of pages to show side-by-side on the canvas. Often used for allowing items to be placed across page spreads." ) );
-	buttonFirstPage->setToolTip( tr( "Location on the canvas where the first page of the document is placed" ) );
-}
-
-void PageLayouts::schemeChanged(QAction *action)
-{
-	buttonScheme->setIcon(action->icon());
-	m_scheme = action->data().toInt();
-	schemeSelected(m_scheme);
-}
-
-void PageLayouts::firstPageChanged(QAction *action)
-{
-	buttonFirstPage->setIcon(action->icon());
-	m_firstPage = action->data().toInt();
-	emit selectedFirstPage(m_firstPage);
-}

Property changes on: scribus/ui/pagelayout.cpp
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Author Date Id Revision
\ No newline at end of property
Index: scribus/ui/pagelayout.h
===================================================================
--- scribus/ui/pagelayout.h	(Revision 26264)
+++ scribus/ui/pagelayout.h	(nicht existent)
@@ -1,76 +0,0 @@
-/*
-For general Scribus (>=1.3.2) copyright and licensing information please refer
-to the COPYING file provided with the program. Following this notice may exist
-a copyright and/or license notice that predates the release of Scribus 1.3.2
-for which a new license (GPL+exception) is in place.
-*/
-#ifndef PAGELAYOUT_H
-#define PAGELAYOUT_H
-
-#include <QGroupBox>
-#include <QListWidget>
-#include <QList>
-
-class QToolButton;
-class QLabel;
-class QHBoxLayout;
-class FormWidget;
-class QMenu;
-
-#include "scribusapi.h"
-#include "scribusstructs.h"
-#include "scribusdoc.h"
-
-/*! \brief A widget for changing pages layout.
-User can change layouts on-the-fly changing widget's
-comboboxes. */
-class SCRIBUS_API PageLayouts : public QWidget
-{
-	Q_OBJECT
-
-public:
-	PageLayouts(QWidget* parent);
-	~PageLayouts() {};
-
-	void updateSchemeSelector(const ScribusDoc* doc);
-	void selectFirstPage(int nr);
-	void selectScheme(int nr);
-
-	void setHideLabelsPermanently(bool hide);
-	bool hideLabelsPermanently() { return m_hideLabels; };
-
-public slots:
-	void schemeSelected(int ic);
-	void toggleLabelVisibility(bool visibility);
-
-signals:
-	void selectedScheme(int);
-	void selectedFirstPage(int);
-
-private:
-
-	int m_scheme {0};
-	int m_firstPage {0};
-	bool m_hideLabels {false};
-	int docPagePositioning {0};
-
-	FormWidget* labelScheme;
-	FormWidget* labelPages;
-	QList<PageSet> pageSets;
-	QToolButton* buttonScheme;
-	QToolButton* buttonFirstPage;
-	QMenu* menuScheme;
-	QMenu* menuFirstPage;
-	QHBoxLayout* layoutGroupLayout;
-
-	void reloadScheme();
-	void reloadFirstPage(int scheme);
-
-protected slots:
-	void languageChange();
-	void schemeChanged(QAction* action);
-	void firstPageChanged(QAction* action);
-
-};
-
-#endif // PAGELAYOUT_H

Property changes on: scribus/ui/pagelayout.h
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Author Date Id Revision
\ No newline at end of property
Index: scribus/ui/pagepalette_pages.cpp
===================================================================
--- scribus/ui/pagepalette_pages.cpp	(Revision 26264)
+++ scribus/ui/pagepalette_pages.cpp	(Arbeitskopie)
@@ -22,7 +22,7 @@
 
 #include "commonstrings.h"
 #include "iconmanager.h"
-#include "pagelayout.h"
+#include "ui/widgets/pagelayout.h"
 #include "pagepalette_pages.h"
 #include "pagepalette_widgets.h"
 #include "qobjectdefs.h"
@@ -45,11 +45,11 @@
 	masterPageList->m_thumb = true;
 	masterPageList->setIconSize(QSize(60, 60));
 
-	pageLayout->setHideLabelsPermanently(true);
+	pageLayout->setHideLabelsPermanently(true);
 
-	trash->setMinimumSize(QSize(24, 24));
-	trash->setMaximumSize(QSize(24, 24));
-
+	trash->setMinimumSize(QSize(24, 24));
+	trash->setMaximumSize(QSize(24, 24));
+
 	PageGrid *pageGrid = pageViewWidget->pageGrid();
 
 	rebuild();
@@ -62,8 +62,8 @@
 	connect(masterPageList, SIGNAL(thumbnailChanged()), this, SLOT(rebuildMasters()));
 	connect(masterPageList, SIGNAL(delMasterRequest(QString)), this, SLOT(deleteMasterPage(QString)));
 
-	connect(pageLayout, SIGNAL(selectedScheme(int)), this, SLOT(handlePageLayout(int)));
-	connect(pageLayout, SIGNAL(selectedFirstPage(int)), this, SLOT(handleFirstPage(int)));
+	connect(pageLayout, SIGNAL(schemeChanged(int)), this, SLOT(handlePageLayout(int)));
+	connect(pageLayout, SIGNAL(firstPageChanged(int)), this, SLOT(handleFirstPage(int)));
 
 	connect(pageGrid, SIGNAL(click(int, int)), this, SLOT(pageView_gotoPage(int, int)));
 	connect(pageGrid, SIGNAL(movePage(int, int)), this, SLOT(pageView_movePage(int, int)));
@@ -137,8 +137,8 @@
 	double pageRatio = page.width() / page.height();
 
 	PageCell *pc = pageViewWidget->pageGrid()->getPageItem(pageIndex);
-	pc->pageName = masterpageName;
-	pc->pageRatio = pageRatio;
+	pc->pageName = masterpageName;
+	pc->pageRatio = pageRatio;
 
 }
 
@@ -205,8 +205,8 @@
 			QPixmap pix = ( previews.contains(i) ) ? QPixmap::fromImage( previews.value(i) ) : QPixmap();
 
 			PageCell *pc = pageViewWidget->pageGrid()->pageList.at(i);
-			pc->pagePreview = pix;
-			pc->pageRatio = pageRatio;
+			pc->pagePreview = pix;
+			pc->pageRatio = pageRatio;
 		}
 	}
 
@@ -283,7 +283,7 @@
 
 void PagePalette_Pages::handlePageLayout(int layout)
 {
-	pageLayout->selectFirstPage(currView->m_doc->pageSets()[layout].FirstPage);
+	pageLayout->setFirstPage(currView->m_doc->pageSets()[layout].FirstPage);
 	currView->m_doc->setPagePositioning(layout);
 	currView->reformPages();
 	currView->DrawNew();
@@ -333,21 +333,21 @@
 	if (m_scMW->scriptIsRunning())
 		return;
 
-	disconnect(pageLayout, SIGNAL(selectedScheme(int)), this, SLOT(handlePageLayout(int)));
-	disconnect(pageLayout, SIGNAL(selectedFirstPage(int)), this, SLOT(handleFirstPage(int)));
+	disconnect(pageLayout, SIGNAL(schemeChanged(int)), this, SLOT(handlePageLayout(int)));
+	disconnect(pageLayout, SIGNAL(firstPageChanged(int)), this, SLOT(handleFirstPage(int)));
 
 	pageViewWidget->pageGrid()->clear();
 	if (currView == nullptr)
 	{
-		connect(pageLayout, SIGNAL(selectedScheme(int)), this, SLOT(handlePageLayout(int)));
-		connect(pageLayout, SIGNAL(selectedFirstPage(int)), this, SLOT(handleFirstPage(int)));
+		connect(pageLayout, SIGNAL(schemeChanged(int)), this, SLOT(handlePageLayout(int)));
+		connect(pageLayout, SIGNAL(firstPageChanged(int)), this, SLOT(handleFirstPage(int)));
 		return;
 	}
 
 	const PageSet &currentPageSet = currView->m_doc->pageSets()[currView->m_doc->pagePositioning()];
-	pageLayout->updateSchemeSelector(currView->m_doc);
-	pageLayout->selectScheme(currView->m_doc->pagePositioning());
-	pageLayout->selectFirstPage(currentPageSet.FirstPage);
+	pageLayout->updateSchemeSelector(currView->m_doc->pageSets(), currView->m_doc->pagePositioning());
+	pageLayout->setScheme(currView->m_doc->pagePositioning());
+	pageLayout->setFirstPage(currentPageSet.FirstPage);
 
 	int counter = currentPageSet.FirstPage;
 	int cols = currentPageSet.Columns;
@@ -391,8 +391,8 @@
 	{
 		markPage(currView->m_doc->currentPageNumber());
 	}
-	connect(pageLayout, SIGNAL(selectedScheme(int)), this, SLOT(handlePageLayout(int)));
-	connect(pageLayout, SIGNAL(selectedFirstPage(int)), this, SLOT(handleFirstPage(int)));
+	connect(pageLayout, SIGNAL(schemeChanged(int)), this, SLOT(handlePageLayout(int)));
+	connect(pageLayout, SIGNAL(firstPageChanged(int)), this, SLOT(handleFirstPage(int)));
 }
 
 void PagePalette_Pages::rebuild()
Index: scribus/ui/pagepalette_pagesbase.ui
===================================================================
--- scribus/ui/pagepalette_pagesbase.ui	(Revision 26264)
+++ scribus/ui/pagepalette_pagesbase.ui	(Arbeitskopie)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>235</width>
-    <height>498</height>
+    <width>235</width>
+    <height>498</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -14,45 +14,45 @@
    <string>Arrange Pages</string>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout">
-   <property name="spacing">
-    <number>4</number>
-   </property>
+   <property name="spacing">
+    <number>4</number>
+   </property>
    <property name="leftMargin">
-    <number>8</number>
+    <number>8</number>
    </property>
    <property name="topMargin">
-    <number>8</number>
+    <number>8</number>
    </property>
    <property name="rightMargin">
-    <number>8</number>
+    <number>8</number>
    </property>
    <property name="bottomMargin">
-    <number>8</number>
+    <number>8</number>
    </property>
    <item>
     <widget class="QSplitter" name="splitter">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="orientation">
-      <enum>Qt::Orientation::Vertical</enum>
+      <enum>Qt::Orientation::Vertical</enum>
      </property>
      <property name="childrenCollapsible">
       <bool>false</bool>
      </property>
      <widget class="QWidget" name="widget" native="true">
-      <property name="sizePolicy">
-       <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
-        <horstretch>0</horstretch>
-        <verstretch>0</verstretch>
-       </sizepolicy>
-      </property>
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
       <layout class="QVBoxLayout" name="verticalLayout_3">
        <property name="spacing">
-        <number>4</number>
+        <number>4</number>
        </property>
        <property name="leftMargin">
         <number>0</number>
@@ -89,15 +89,15 @@
       </layout>
      </widget>
      <widget class="QWidget" name="widget_2" native="true">
-      <property name="sizePolicy">
-       <sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
-        <horstretch>0</horstretch>
-        <verstretch>1</verstretch>
-       </sizepolicy>
-      </property>
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
+        <horstretch>0</horstretch>
+        <verstretch>1</verstretch>
+       </sizepolicy>
+      </property>
       <layout class="QVBoxLayout" name="verticalLayout_4">
        <property name="spacing">
-        <number>4</number>
+        <number>4</number>
        </property>
        <property name="leftMargin">
         <number>0</number>
@@ -119,104 +119,104 @@
         </widget>
        </item>
        <item>
-        <layout class="QHBoxLayout" name="horizontalLayout_2">
-         <property name="spacing">
-          <number>4</number>
+        <layout class="QHBoxLayout" name="horizontalLayout_2">
+         <property name="spacing">
+          <number>4</number>
          </property>
-         <item>
-          <widget class="QToolButton" name="buttonPageInsert">
-           <property name="text">
-            <string/>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QToolButton" name="buttonPageImport">
-           <property name="text">
-            <string/>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QToolButton" name="buttonPageDuplicate">
-           <property name="text">
-            <string/>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QToolButton" name="buttonPageMove">
-           <property name="text">
-            <string/>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer name="horizontalSpacer">
-           <property name="orientation">
-            <enum>Qt::Orientation::Horizontal</enum>
-           </property>
-           <property name="sizeType">
-            <enum>QSizePolicy::Policy::Fixed</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>16</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="PageLayouts" name="pageLayout" native="true"/>
-         </item>
-         <item>
-          <spacer name="horizontalSpacer_2">
-           <property name="orientation">
-            <enum>Qt::Orientation::Horizontal</enum>
-           </property>
-           <property name="sizeType">
-            <enum>QSizePolicy::Policy::MinimumExpanding</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>16</width>
-             <height>0</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="TrashBin" name="trash">
-           <property name="minimumSize">
-            <size>
-             <width>32</width>
-             <height>32</height>
-            </size>
-           </property>
-           <property name="maximumSize">
-            <size>
-             <width>32</width>
-             <height>32</height>
-            </size>
-           </property>
-           <property name="toolTip">
-            <string>&lt;qt&gt;Drag pages or master pages onto the trash to delete them&lt;/qt&gt;</string>
-           </property>
-           <property name="text">
-            <string/>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="PageViewer" name="pageViewWidget" native="true">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
+         <item>
+          <widget class="QToolButton" name="buttonPageInsert">
+           <property name="text">
+            <string/>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QToolButton" name="buttonPageImport">
+           <property name="text">
+            <string/>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QToolButton" name="buttonPageDuplicate">
+           <property name="text">
+            <string/>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QToolButton" name="buttonPageMove">
+           <property name="text">
+            <string/>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer">
+           <property name="orientation">
+            <enum>Qt::Orientation::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Policy::Fixed</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>16</width>
+             <height>0</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="PageLayouts" name="pageLayout" native="true"/>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_2">
+           <property name="orientation">
+            <enum>Qt::Orientation::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Policy::MinimumExpanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>16</width>
+             <height>0</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="TrashBin" name="trash">
+           <property name="minimumSize">
+            <size>
+             <width>32</width>
+             <height>32</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>32</width>
+             <height>32</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>&lt;qt&gt;Drag pages or master pages onto the trash to delete them&lt;/qt&gt;</string>
+           </property>
+           <property name="text">
+            <string/>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="PageViewer" name="pageViewWidget" native="true">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
          </property>
         </widget>
        </item>
@@ -233,20 +233,20 @@
    <header>ui/pagepalette_widgets.h</header>
   </customwidget>
   <customwidget>
-   <class>TrashBin</class>
-   <extends>QLabel</extends>
-   <header>ui/pagepalette_widgets.h</header>
-  </customwidget>
-  <customwidget>
-   <class>PageViewer</class>
-   <extends>QWidget</extends>
-   <header>ui/pagepalette_widgets.h</header>
-   <container>1</container>
-  </customwidget>
-  <customwidget>
+   <class>TrashBin</class>
+   <extends>QLabel</extends>
+   <header>ui/pagepalette_widgets.h</header>
+  </customwidget>
+  <customwidget>
+   <class>PageViewer</class>
+   <extends>QWidget</extends>
+   <header>ui/pagepalette_widgets.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
    <class>PageLayouts</class>
-   <extends>QWidget</extends>
-   <header>ui/pagelayout.h</header>
+   <extends>QWidget</extends>
+   <header location="global">ui/widgets/pagelayout.h</header>
    <container>1</container>
   </customwidget>
  </customwidgets>
Index: scribus/ui/pagepropertiesdialog.cpp
===================================================================
--- scribus/ui/pagepropertiesdialog.cpp	(Revision 26264)
+++ scribus/ui/pagepropertiesdialog.cpp	(Arbeitskopie)
@@ -17,7 +17,7 @@
 
 #include "commonstrings.h"
 #include "iconmanager.h"
-#include "marginwidget.h"
+#include "newmarginwidget.h"
 #include "pagepropertiesdialog.h"
 #include "pagesize.h"
 #include "pagestructs.h"
@@ -25,6 +25,7 @@
 #include "scribusdoc.h"
 #include "scrspinbox.h"
 #include "units.h"
+#include "widgets/pagesizeselector.h"
 
 PagePropertiesDialog::PagePropertiesDialog( QWidget* parent, ScribusDoc* doc )
                     : QDialog( parent),
@@ -35,36 +36,25 @@
 	setWindowIcon(IconManager::instance().loadIcon("AppIcon.png"));
 	dialogLayout = new QVBoxLayout(this);
 	dialogLayout->setContentsMargins(9, 9, 9, 9);
-	dialogLayout->setSpacing(6);
+	dialogLayout->setSpacing(4);
 	
+	PageSize ps(doc->currentPage()->size());
+	prefsPageSizeName = ps.name();
+
 	dsGroupBox7 = new QGroupBox(this);
 	dsGroupBox7->setTitle( tr( "Page Size" ) );
 	dsGroupBox7Layout = new QGridLayout(dsGroupBox7);
 	dsGroupBox7Layout->setAlignment( Qt::AlignTop );
-	dsGroupBox7Layout->setSpacing(6);
+	dsGroupBox7Layout->setSpacing(4);
 	dsGroupBox7Layout->setContentsMargins(9, 9, 9, 9);
 	TextLabel1 = new QLabel( tr( "&Size:" ), dsGroupBox7 );
-	dsGroupBox7Layout->addWidget( TextLabel1, 0, 0, 1, 2 );
-
-	PageSize ps(doc->currentPage()->size());
-	prefsPageSizeName = ps.name();
-	sizeQComboBox = new QComboBox(dsGroupBox7);
-	QStringList insertList(ps.activeSizeTRList());
-	if (insertList.indexOf(prefsPageSizeName) == -1 && prefsPageSizeName != CommonStrings::customPageSize)
-		insertList << prefsPageSizeName;
-	insertList.sort();
-	insertList << CommonStrings::trCustomPageSize;
-	sizeQComboBox->addItems(insertList);
-	int sizeIndex = insertList.indexOf(ps.nameTR());
-	if (sizeIndex != -1)
-		sizeQComboBox->setCurrentIndex(sizeIndex);
-	else
-		sizeQComboBox->setCurrentIndex(sizeQComboBox->count()-1);
-
-	TextLabel1->setBuddy(sizeQComboBox);
-	dsGroupBox7Layout->addWidget(sizeQComboBox, 0, 2, 1, 2);
+	dsGroupBox7Layout->addWidget( TextLabel1, 0, 0, Qt::AlignTop | Qt::AlignRight);
+	pageSizeSelector = new PageSizeSelector(dsGroupBox7);
+	pageSizeSelector->setPageSize(doc->currentPage()->size());
+	TextLabel1->setBuddy(pageSizeSelector);
+	dsGroupBox7Layout->addWidget(pageSizeSelector, 0, 1);
 	TextLabel2 = new QLabel( tr( "Orie&ntation:" ), dsGroupBox7 );
-	dsGroupBox7Layout->addWidget( TextLabel2, 1, 0, 1, 2 );
+	dsGroupBox7Layout->addWidget( TextLabel2, 1, 0, Qt::AlignRight);
 	orientationQComboBox = new QComboBox( dsGroupBox7 );
 	orientationQComboBox->addItem( tr( "Portrait" ) );
 	orientationQComboBox->addItem( tr( "Landscape" ) );
@@ -72,28 +62,28 @@
 	orientationQComboBox->setCurrentIndex(doc->currentPage()->orientation() );
 	oldOri = doc->currentPage()->orientation();
 	TextLabel2->setBuddy(orientationQComboBox);
-	dsGroupBox7Layout->addWidget( orientationQComboBox, 1, 2, 1, 2 );
+	dsGroupBox7Layout->addWidget( orientationQComboBox, 1, 1 );
 	widthSpinBox = new ScrSpinBox(pts2value(1.0, doc->unitIndex()), 16777215, dsGroupBox7, doc->unitIndex());
 	widthQLabel = new QLabel( tr( "&Width:" ), dsGroupBox7 );
 	widthSpinBox->setValue(doc->currentPage()->width() * doc->unitRatio());
 	widthQLabel->setBuddy(widthSpinBox);
-	dsGroupBox7Layout->addWidget( widthQLabel, 2, 0 );
+	dsGroupBox7Layout->addWidget( widthQLabel, 2, 0, Qt::AlignRight);
 	dsGroupBox7Layout->addWidget( widthSpinBox, 2, 1 );
 	heightSpinBox = new ScrSpinBox(pts2value(1.0, doc->unitIndex()), 16777215, dsGroupBox7, doc->unitIndex());
 	heightSpinBox->setValue(doc->currentPage()->height() * doc->unitRatio());
 	heightQLabel = new QLabel( tr( "&Height:" ), dsGroupBox7 );
 	heightQLabel->setBuddy(heightSpinBox);
-	dsGroupBox7Layout->addWidget( heightQLabel, 2, 2 );
-	dsGroupBox7Layout->addWidget( heightSpinBox, 2, 3 );
+	dsGroupBox7Layout->addWidget( heightQLabel, 3, 0, Qt::AlignRight );
+	dsGroupBox7Layout->addWidget( heightSpinBox, 3, 1 );
 	moveObjects = new QCheckBox( dsGroupBox7 );
 	moveObjects->setText( tr( "Move Objects with their Page" ) );
 	moveObjects->setChecked( true );
-	dsGroupBox7Layout->addWidget( moveObjects, 3, 0, 1, 4 );
+	dsGroupBox7Layout->addWidget( moveObjects, 4, 0, 1, 2 );
 	Links = nullptr;
 	if ((doc->pagePositioning() != singlePage) && (doc->masterPageMode()))
 	{
 		TextLabel3 = new QLabel( tr( "Type:" ), dsGroupBox7 );
-		dsGroupBox7Layout->addWidget( TextLabel3, 4, 0, 1, 2 );
+		dsGroupBox7Layout->addWidget( TextLabel3, 5, 0, Qt::AlignRight);
 		Links = new QComboBox( dsGroupBox7 );
 		QList<PageSet> pageSet(doc->pageSets());
 		const QStringList& pageNames = pageSet.at(doc->pagePositioning()).pageNames;
@@ -102,7 +92,7 @@
 			Links->addItem(CommonStrings::translatePageSetLocString((*pNames)));
 		}
 		Links->setEditable(false);
-		dsGroupBox7Layout->addWidget( Links, 4, 2, 1, 2 );
+		dsGroupBox7Layout->addWidget( Links, 5, 1);
 		if (doc->currentPage()->LeftPg == 0)
 			Links->setCurrentIndex(Links->count()-1);
 		else if (doc->currentPage()->LeftPg == 1)
@@ -112,17 +102,20 @@
 	}
 	dialogLayout->addWidget( dsGroupBox7 );
 	
-	marginWidget = new MarginWidget(this,  tr( "Margin Guides" ), &doc->currentPage()->initialMargins, doc->unitIndex(), false, false);
-	marginWidget->setPageWidthHeight(doc->currentPage()->width(), doc->currentPage()->height());
+//	marginWidget = new MarginWidget(this,  tr( "Margin Guides" ), &doc->currentPage()->initialMargins, doc->unitIndex(), false, false);
+	marginWidget = new NewMarginWidget();
+	marginWidget->setup(doc->currentPage()->initialMargins, doc->currentPage()->marginPreset, doc->unitIndex(), NewMarginWidget::MarginWidgetFlags );
+	marginWidget->setPageHeight(doc->currentPage()->height());
+	marginWidget->setPageWidth(doc->currentPage()->width());
 	marginWidget->setFacingPages(!(doc->pagePositioning() == singlePage), doc->locationOfPage(doc->currentPage()->pageNr()));
-	marginWidget->setMarginPreset(doc->currentPage()->marginPreset);
+//	marginWidget->setMarginPreset(doc->currentPage()->marginPreset);
 	dialogLayout->addWidget( marginWidget );
 
 	groupMaster = new QGroupBox( this );
 	groupMaster->setTitle( tr( "Other Settings" ) );
 	masterLayout = new QHBoxLayout( groupMaster );
-	masterLayout->setSpacing(6);
-	masterLayout->setContentsMargins(9, 9, 9, 9);
+	masterLayout->setSpacing(4);
+	masterLayout->setContentsMargins(8, 8, 8, 8);
 	masterPageLabel = new QLabel( groupMaster );
 	masterLayout->addWidget( masterPageLabel );
 	if (!doc->masterPageMode())
@@ -163,7 +156,7 @@
 	m_pageWidth = widthSpinBox->value() / m_unitRatio;
 	m_pageHeight = heightSpinBox->value() / m_unitRatio;
 
-	bool isCustom = (sizeQComboBox->currentText() == CommonStrings::trCustomPageSize);
+	bool isCustom = (pageSizeSelector->pageSizeTR() == CommonStrings::trCustomPageSize);
 	heightSpinBox->setEnabled(isCustom);
 	widthSpinBox->setEnabled(isCustom);
 	// signals and slots connections
@@ -170,12 +163,12 @@
 	connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
 	connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
 	connect(orientationQComboBox, SIGNAL(activated(int)), this, SLOT(setOrientation(int)));
-	connect(sizeQComboBox, SIGNAL(textActivated(QString)), this, SLOT(setPageSize()));
+	connect(pageSizeSelector, SIGNAL(pageSizeChanged(QString)), this, SLOT(setPageSize()));
 	connect(widthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setPageWidth(double)));
 	connect(heightSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setPageHeight(double)));
 	
 	//tooltips
-	sizeQComboBox->setToolTip( tr( "Size of the inserted pages, either a standard or custom size" ) );
+	pageSizeSelector->setToolTip( tr( "Size of the inserted pages, either a standard or custom size" ) );
 	orientationQComboBox->setToolTip( tr( "Orientation of the page(s) to be inserted" ) );
 	widthSpinBox->setToolTip( tr( "Width of the page(s) to be inserted" ) );
 	heightSpinBox->setToolTip( tr( "Height of the page(s) to be inserted" ) );
@@ -217,7 +210,7 @@
 
 void PagePropertiesDialog::setPageSize()
 {
-	if (sizeQComboBox->currentText() != CommonStrings::trCustomPageSize)
+	if (pageSizeSelector->pageSizeTR() != CommonStrings::trCustomPageSize)
 		oldOri++;
 	setOrientation(orientationQComboBox->currentIndex());
 }
@@ -254,10 +247,10 @@
 
 void PagePropertiesDialog::setOrientation(int ori)
 {
-	setSize(sizeQComboBox->currentText());
+	setSize(pageSizeSelector->pageSizeTR());
 	disconnect(widthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setPageWidth(double)));
 	disconnect(heightSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setPageHeight(double)));
-	if ((sizeQComboBox->currentText() == CommonStrings::trCustomPageSize) && (ori != oldOri))
+	if ((pageSizeSelector->pageSizeTR() == CommonStrings::trCustomPageSize) && (ori != oldOri))
 	{
 		double w = widthSpinBox->value(), h = heightSpinBox->value();
 		widthSpinBox->setValue((ori == portraitPage) ? qMin(w, h) : qMax(w, h));
@@ -320,22 +313,22 @@
 
 double PagePropertiesDialog::top() const
 {
-	return marginWidget->top();
+	return marginWidget->margins().top();
 }
 
 double PagePropertiesDialog::bottom() const
 {
-	return marginWidget->bottom();
+	return marginWidget->margins().bottom();
 }
 
 double PagePropertiesDialog::left() const
 {
-	return marginWidget->left();
+	return marginWidget->margins().left();
 }
 
 double PagePropertiesDialog::right() const
 {
-	return marginWidget->right();
+	return marginWidget->margins().right();
 }
 
 QString PagePropertiesDialog::masterPage() const
@@ -347,5 +340,5 @@
 
 int PagePropertiesDialog::getMarginPreset() const
 {
-	return marginWidget->getMarginPreset();
+	return marginWidget->marginPreset();
 }
Index: scribus/ui/pagepropertiesdialog.h
===================================================================
--- scribus/ui/pagepropertiesdialog.h	(Revision 26264)
+++ scribus/ui/pagepropertiesdialog.h	(Arbeitskopie)
@@ -10,6 +10,8 @@
 #include "scribusapi.h"
 #include <QDialog>
 
+#include "widgets/pagesizeselector.h"
+
 class QGroupBox;
 class QLabel;
 class QPushbutton;
@@ -20,7 +22,7 @@
 class QHBoxLayout;
 class QVBoxLayout;
 class ScrSpinBox;
-class MarginWidget;
+class NewMarginWidget;
 class ScribusDoc;
 
 /*! \brief A dialog to setup the existing document margins.
@@ -90,7 +92,7 @@
 	void setPageHeight(double v);
 
 private:
-	MarginWidget* marginWidget { nullptr };
+	NewMarginWidget* marginWidget { nullptr };
 	QGroupBox* dsGroupBox7 { nullptr };
 	QGroupBox* groupMaster { nullptr };
 	QLabel* masterPageLabel { nullptr };
@@ -101,7 +103,7 @@
 	QLabel* heightQLabel { nullptr };
 	QLabel* TextLabel1 { nullptr };
 	QLabel* TextLabel2 { nullptr };
-	QComboBox* sizeQComboBox { nullptr };
+	PageSizeSelector* pageSizeSelector { nullptr };
 	QComboBox* orientationQComboBox { nullptr };
 	QComboBox* Links { nullptr };
 	QLabel* TextLabel3 { nullptr };
Index: scribus/ui/prefs_documentsetup.cpp
===================================================================
--- scribus/ui/prefs_documentsetup.cpp	(Revision 26264)
+++ scribus/ui/prefs_documentsetup.cpp	(Arbeitskopie)
@@ -68,7 +68,7 @@
 	pageHeightSpinBox->setMaximum(16777215);
 	languageChange();
 
-	connect(pageSizeComboBox, SIGNAL(activated(int)), this, SLOT(setPageSize()));
+	connect(pageSizeSelector, SIGNAL(pageSizeChanged(QString)), this, SLOT(setPageSize()));
 	connect(pageOrientationComboBox, SIGNAL(activated(int)), this, SLOT(setPageOrientation(int)));
 	connect(pageWidthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setPageWidth(double)));
 	connect(pageHeightSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setPageHeight(double)));
@@ -121,7 +121,7 @@
 
 	pageWidthSpinBox->setToolTip( "<qt>" + tr( "Width of document pages, editable if you have chosen a custom page size" ) + "</qt>" );
 	pageHeightSpinBox->setToolTip( "<qt>" + tr( "Height of document pages, editable if you have chosen a custom page size" ) + "</qt>" );
-	pageSizeComboBox->setToolTip( "<qt>" + tr( "Default page size, either a standard size or a custom size. More page sizes can be made visible by activating them in Preferences." ) + "</qt>" );
+	pageSizeSelector->setToolTip( "<qt>" + tr( "Default page size, either a standard size or a custom size. More page sizes can be made visible by activating them in Preferences." ) + "</qt>" );
 	pageSizeLinkToolButton->setToolTip( "<qt>" + tr( "Enable or disable more page sizes by jumping to Page Size preferences" ) + "</qt>" );
 	pageOrientationComboBox->setToolTip( "<qt>" + tr( "Default orientation of document pages" ) + "</qt>" );
 	pageUnitsComboBox->setToolTip( "<qt>" + tr( "Default unit of measurement for document editing" ) + "</qt>" );
@@ -138,7 +138,7 @@
 	pageWidthSpinBox->blockSignals(true);
 	pageHeightSpinBox->blockSignals(true);
 	pageOrientationComboBox->blockSignals(true);
-	pageSizeComboBox->blockSignals(true);
+	pageSizeSelector->blockSignals(true);
 
 	setCurrentComboItem(languageComboBox, LanguageManager::instance()->getLangFromAbbrev(prefsData->docSetupPrefs.language, true));
 
@@ -179,7 +179,7 @@
 	pageWidthSpinBox->blockSignals(false);
 	pageHeightSpinBox->blockSignals(false);
 	pageOrientationComboBox->blockSignals(false);
-	pageSizeComboBox->blockSignals(false);
+	pageSizeSelector->blockSignals(false);
 
 	marginsWidget->setup(prefsData->docSetupPrefs.margins, prefsData->docSetupPrefs.pagePositioning, prefsData->docSetupPrefs.docUnitIndex, NewMarginWidget::MarginWidgetFlags);
 	marginsWidget->setPageWidth(prefsData->docSetupPrefs.pageWidth);
@@ -271,42 +271,9 @@
 
 void Prefs_DocumentSetup::setupPageSizes(struct ApplicationPrefs *prefsData)
 {
-	PageSize ps(prefsData->docSetupPrefs.pageSize);
-	QStringList insertList(ps.activeSizeList());
-	QStringList insertTrList(ps.activeSizeTRList());
-
 	prefsPageSizeName = prefsData->docSetupPrefs.pageSize;
-	if (prefsPageSizeName == CommonStrings::trCustomPageSize)
-		prefsPageSizeName = CommonStrings::customPageSize;
-	if ((prefsPageSizeName != CommonStrings::customPageSize) &&
-		(prefsPageSizeName != CommonStrings::trCustomPageSize) &&
-		(insertList.indexOf(prefsPageSizeName) == -1))
-	{
-		insertList << prefsPageSizeName;
-		insertTrList << prefsPageSizeName;
-	}
 
-	QMap<QString, QString> insertMap;
-	for (int i = 0; i < insertTrList.count(); ++i)
-	{
-		const QString& key = insertTrList.at(i);
-		insertMap[key] = insertList.at(i);
-	}
-	insertTrList.sort();
-
-	pageSizeComboBox->clear();
-	for (int i = 0; i < insertList.count(); ++i)
-	{
-		const QString& key = insertTrList.at(i);
-		pageSizeComboBox->addItem(key, insertMap[key]);
-	}
-	pageSizeComboBox->addItem(CommonStrings::trCustomPageSize, CommonStrings::customPageSize);
-
-	QString pageSizeName = CommonStrings::trCustomPageSize;
-	int index = pageSizeComboBox->findData(prefsPageSizeName);
-	if (index >= 0)
-		pageSizeName = pageSizeComboBox->itemText(index);
-	setCurrentComboItem(pageSizeComboBox, pageSizeName);
+	pageSizeSelector->setPageSize(prefsPageSizeName);
 	marginsWidget->setPageSize(prefsPageSizeName);
 	bleedsWidget->setPageSize(prefsPageSizeName);
 }
@@ -322,9 +289,9 @@
 {
 	pageW = pageWidthSpinBox->value() / unitRatio;
 	marginsWidget->setPageWidth(pageW);
-	QString psText = pageSizeComboBox->currentText();
+	QString psText = pageSizeSelector->pageSizeTR();
 	if (psText != CommonStrings::trCustomPageSize && psText != CommonStrings::customPageSize)
-		pageSizeComboBox->setCurrentIndex(pageSizeComboBox->count() - 1);
+		pageSizeSelector->setPageSize(CommonStrings::customPageSize);
 	int newOrientation = (pageWidthSpinBox->value() > pageHeightSpinBox->value()) ? landscapePage : portraitPage;
 	if (newOrientation != pageOrientationComboBox->currentIndex())
 	{
@@ -338,9 +305,9 @@
 {
 	pageH = pageHeightSpinBox->value() / unitRatio;
 	marginsWidget->setPageHeight(pageH);
-	QString psText = pageSizeComboBox->currentText();
+	QString psText = pageSizeSelector->pageSizeTR();
 	if (psText != CommonStrings::trCustomPageSize && psText != CommonStrings::customPageSize)
-		pageSizeComboBox->setCurrentIndex(pageSizeComboBox->count() - 1);
+		pageSizeSelector->setPageSize(CommonStrings::customPageSize);
 	int newOrientation = (pageWidthSpinBox->value() > pageHeightSpinBox->value()) ? landscapePage : portraitPage;
 	if (newOrientation != pageOrientationComboBox->currentIndex())
 	{
@@ -352,10 +319,10 @@
 
 void Prefs_DocumentSetup::setPageOrientation(int orientation)
 {
-	setSize(pageSizeComboBox->currentText());
+	setSize(pageSizeSelector->pageSize());
 	pageWidthSpinBox->blockSignals(true);
 	pageHeightSpinBox->blockSignals(true);
-	if ((orientation==0 && pageSizeComboBox->currentText() == CommonStrings::trCustomPageSize) || orientation!=0)
+	if ((orientation==0 && pageSizeSelector->pageSizeTR() == CommonStrings::trCustomPageSize) || orientation!=0)
 	{
 		double w = pageWidthSpinBox->value(), h = pageHeightSpinBox->value();
 		pageWidthSpinBox->setValue((orientation == portraitPage) ? qMin(w, h) : qMax(w, h));
@@ -379,7 +346,7 @@
 
 	PageSize ps2(newSize);
 	prefsPageSizeName = ps2.name();
-	if (newSize != CommonStrings::trCustomPageSize)
+	if (newSize != CommonStrings::customPageSize && newSize != CommonStrings::trCustomPageSize)
 	{
 		pageW = ps2.width();
 		pageH = ps2.height();
Index: scribus/ui/prefs_documentsetupbase.ui
===================================================================
--- scribus/ui/prefs_documentsetupbase.ui	(Revision 26264)
+++ scribus/ui/prefs_documentsetupbase.ui	(Arbeitskopie)
@@ -28,7 +28,6 @@
      <property name="font">
       <font>
        <pointsize>14</pointsize>
-       <weight>75</weight>
        <bold>true</bold>
       </font>
      </property>
@@ -40,7 +39,7 @@
    <item>
     <widget class="Line" name="line">
      <property name="orientation">
-      <enum>Qt::Horizontal</enum>
+      <enum>Qt::Orientation::Horizontal</enum>
      </property>
     </widget>
    </item>
@@ -69,7 +68,7 @@
          <item>
           <spacer name="horizontalSpacer_3">
            <property name="orientation">
-            <enum>Qt::Horizontal</enum>
+            <enum>Qt::Orientation::Horizontal</enum>
            </property>
            <property name="sizeHint" stdset="0">
             <size>
@@ -84,10 +83,10 @@
        <item>
         <spacer name="verticalSpacer">
          <property name="orientation">
-          <enum>Qt::Vertical</enum>
+          <enum>Qt::Orientation::Vertical</enum>
          </property>
          <property name="sizeType">
-          <enum>QSizePolicy::Fixed</enum>
+          <enum>QSizePolicy::Policy::Fixed</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
@@ -101,7 +100,6 @@
         <widget class="QLabel" name="pageSizeTitleLabel">
          <property name="font">
           <font>
-           <weight>75</weight>
            <bold>true</bold>
           </font>
          </property>
@@ -113,7 +111,7 @@
        <item>
         <widget class="Line" name="line_2">
          <property name="orientation">
-          <enum>Qt::Horizontal</enum>
+          <enum>Qt::Orientation::Horizontal</enum>
          </property>
         </widget>
        </item>
@@ -124,20 +122,17 @@
            <property name="text">
             <string>Size:</string>
            </property>
-           <property name="buddy">
-            <cstring>pageSizeComboBox</cstring>
-           </property>
           </widget>
          </item>
          <item row="0" column="1">
           <layout class="QHBoxLayout" name="pageSizeLayout">
            <item>
-            <widget class="QComboBox" name="pageSizeComboBox"/>
+            <widget class="PageSizeSelector" name="pageSizeSelector" native="true"/>
            </item>
            <item>
             <widget class="QToolButton" name="pageSizeLinkToolButton">
              <property name="arrowType">
-              <enum>Qt::NoArrow</enum>
+              <enum>Qt::ArrowType::NoArrow</enum>
              </property>
             </widget>
            </item>
@@ -214,7 +209,7 @@
        <item>
         <spacer name="verticalSpacer_5">
          <property name="orientation">
-          <enum>Qt::Vertical</enum>
+          <enum>Qt::Orientation::Vertical</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
@@ -235,7 +230,6 @@
         <widget class="QLabel" name="pageLayoutTitleLabel">
          <property name="font">
           <font>
-           <weight>75</weight>
            <bold>true</bold>
           </font>
          </property>
@@ -247,7 +241,7 @@
        <item>
         <widget class="Line" name="line_3">
          <property name="orientation">
-          <enum>Qt::Horizontal</enum>
+          <enum>Qt::Orientation::Horizontal</enum>
          </property>
         </widget>
        </item>
@@ -266,7 +260,7 @@
          <item row="4" column="1">
           <widget class="QComboBox" name="layoutFirstPageIsComboBox">
            <property name="sizeAdjustPolicy">
-            <enum>QComboBox::AdjustToContents</enum>
+            <enum>QComboBox::SizeAdjustPolicy::AdjustToContents</enum>
            </property>
           </widget>
          </item>
@@ -318,7 +312,7 @@
        <item>
         <spacer name="verticalSpacer_8">
          <property name="orientation">
-          <enum>Qt::Vertical</enum>
+          <enum>Qt::Orientation::Vertical</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
@@ -350,10 +344,10 @@
        <item>
         <widget class="QScrollArea" name="scrollArea">
          <property name="frameShape">
-          <enum>QFrame::NoFrame</enum>
+          <enum>QFrame::Shape::NoFrame</enum>
          </property>
          <property name="frameShadow">
-          <enum>QFrame::Plain</enum>
+          <enum>QFrame::Shadow::Plain</enum>
          </property>
          <property name="lineWidth">
           <number>0</number>
@@ -366,8 +360,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>458</width>
-            <height>540</height>
+            <width>494</width>
+            <height>575</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_5">
@@ -375,7 +369,6 @@
             <widget class="QLabel" name="marginsTitleLabel">
              <property name="font">
               <font>
-               <weight>75</weight>
                <bold>true</bold>
               </font>
              </property>
@@ -387,7 +380,7 @@
            <item>
             <widget class="Line" name="line_5">
              <property name="orientation">
-              <enum>Qt::Horizontal</enum>
+              <enum>Qt::Orientation::Horizontal</enum>
              </property>
             </widget>
            </item>
@@ -411,7 +404,7 @@
              <item>
               <spacer name="horizontalSpacer_6">
                <property name="orientation">
-                <enum>Qt::Horizontal</enum>
+                <enum>Qt::Orientation::Horizontal</enum>
                </property>
                <property name="sizeHint" stdset="0">
                 <size>
@@ -440,10 +433,10 @@
            <item>
             <spacer name="verticalSpacer_3">
              <property name="orientation">
-              <enum>Qt::Vertical</enum>
+              <enum>Qt::Orientation::Vertical</enum>
              </property>
              <property name="sizeType">
-              <enum>QSizePolicy::Fixed</enum>
+              <enum>QSizePolicy::Policy::Fixed</enum>
              </property>
              <property name="sizeHint" stdset="0">
               <size>
@@ -457,7 +450,6 @@
             <widget class="QLabel" name="bleedsTitleLabel">
              <property name="font">
               <font>
-               <weight>75</weight>
                <bold>true</bold>
               </font>
              </property>
@@ -469,7 +461,7 @@
            <item>
             <widget class="Line" name="line_4">
              <property name="orientation">
-              <enum>Qt::Horizontal</enum>
+              <enum>Qt::Orientation::Horizontal</enum>
              </property>
             </widget>
            </item>
@@ -493,7 +485,7 @@
              <item>
               <spacer name="horizontalSpacer_7">
                <property name="orientation">
-                <enum>Qt::Horizontal</enum>
+                <enum>Qt::Orientation::Horizontal</enum>
                </property>
                <property name="sizeHint" stdset="0">
                 <size>
@@ -508,7 +500,7 @@
            <item>
             <spacer name="verticalSpacer_4">
              <property name="orientation">
-              <enum>Qt::Vertical</enum>
+              <enum>Qt::Orientation::Vertical</enum>
              </property>
              <property name="sizeHint" stdset="0">
               <size>
@@ -546,10 +538,10 @@
        <item>
         <spacer name="verticalSpacer_6">
          <property name="orientation">
-          <enum>Qt::Vertical</enum>
+          <enum>Qt::Orientation::Vertical</enum>
          </property>
          <property name="sizeType">
-          <enum>QSizePolicy::Fixed</enum>
+          <enum>QSizePolicy::Policy::Fixed</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
@@ -563,7 +555,6 @@
         <widget class="QLabel" name="autosaveTitleLable">
          <property name="font">
           <font>
-           <weight>75</weight>
            <bold>true</bold>
           </font>
          </property>
@@ -575,7 +566,7 @@
        <item>
         <widget class="Line" name="line_6">
          <property name="orientation">
-          <enum>Qt::Horizontal</enum>
+          <enum>Qt::Orientation::Horizontal</enum>
          </property>
         </widget>
        </item>
@@ -626,7 +617,7 @@
          <item>
           <spacer name="horizontalSpacer_2">
            <property name="orientation">
-            <enum>Qt::Horizontal</enum>
+            <enum>Qt::Orientation::Horizontal</enum>
            </property>
            <property name="sizeHint" stdset="0">
             <size>
@@ -689,10 +680,10 @@
        <item>
         <spacer name="verticalSpacer_7">
          <property name="orientation">
-          <enum>Qt::Vertical</enum>
+          <enum>Qt::Orientation::Vertical</enum>
          </property>
          <property name="sizeType">
-          <enum>QSizePolicy::Maximum</enum>
+          <enum>QSizePolicy::Policy::Maximum</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
@@ -706,7 +697,6 @@
         <widget class="QLabel" name="undoRedoTitleLabel">
          <property name="font">
           <font>
-           <weight>75</weight>
            <bold>true</bold>
           </font>
          </property>
@@ -718,7 +708,7 @@
        <item>
         <widget class="Line" name="line_7">
          <property name="orientation">
-          <enum>Qt::Horizontal</enum>
+          <enum>Qt::Orientation::Horizontal</enum>
          </property>
         </widget>
        </item>
@@ -744,7 +734,7 @@
          <item>
           <spacer name="horizontalSpacer">
            <property name="orientation">
-            <enum>Qt::Horizontal</enum>
+            <enum>Qt::Orientation::Horizontal</enum>
            </property>
            <property name="sizeHint" stdset="0">
             <size>
@@ -759,7 +749,7 @@
        <item>
         <spacer name="verticalSpacer_2">
          <property name="orientation">
-          <enum>Qt::Vertical</enum>
+          <enum>Qt::Orientation::Vertical</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
@@ -787,11 +777,16 @@
    <header location="global">ui/newmarginwidget.h</header>
    <container>1</container>
   </customwidget>
+  <customwidget>
+   <class>PageSizeSelector</class>
+   <extends>QWidget</extends>
+   <header>ui/widgets/pagesizeselector.h</header>
+   <container>1</container>
+  </customwidget>
  </customwidgets>
  <tabstops>
   <tabstop>tabWidget</tabstop>
   <tabstop>languageComboBox</tabstop>
-  <tabstop>pageSizeComboBox</tabstop>
   <tabstop>pageSizeLinkToolButton</tabstop>
   <tabstop>pageOrientationComboBox</tabstop>
   <tabstop>pageUnitsComboBox</tabstop>
Index: scribus/ui/prefs_pagesizes.cpp
===================================================================
--- scribus/ui/prefs_pagesizes.cpp	(Revision 26264)
+++ scribus/ui/prefs_pagesizes.cpp	(Arbeitskopie)
@@ -19,11 +19,15 @@
 	: Prefs_Pane(parent)
 {
 	setupUi(this);
-	languageChange();
 
 	m_caption = tr("Page Sizes");
 	m_icon = "16/page-simple.png";
 
+	treeAvailableSizes->setColumnCount(2);
+	treeActiveSizes->setColumnCount(2);
+
+	languageChange();
+
 	toActiveButton->setIcon(IconManager::instance().loadIcon("22/go-next.png"));
 	fromActiveButton->setIcon(IconManager::instance().loadIcon("22/go-previous.png"));
 	connect(toActiveButton, SIGNAL(clicked()), this, SLOT(moveToActive()));
@@ -34,68 +38,162 @@
 
 void Prefs_PageSizes::languageChange()
 {
-	// No need to do anything here, the UI language cannot change while prefs dialog is opened
+	QString textSize = tr("Page Format");
+	QString textDimension = tr("Dimension");
+
+	if(QTreeWidgetItem* header = treeAvailableSizes->headerItem()) {
+		header->setText(0, textSize);
+
+		qDebug() << treeAvailableSizes->columnCount();
+		if (header->columnCount() > 1)
+			header->setText(1, textDimension);
+	}
+	else
+		treeAvailableSizes->setHeaderLabel( textSize );
+
+
+	if(QTreeWidgetItem* header = treeActiveSizes->headerItem()) {
+		header->setText(0, textSize);
+		if (header->columnCount() > 1)
+			header->setText(1, textDimension);
+	}
+	else
+		treeActiveSizes->setHeaderLabel( textSize );
+
 }
 
 void Prefs_PageSizes::restoreDefaults(struct ApplicationPrefs *prefsData)
 {
 	PageSize ps(prefsData->docSetupPrefs.pageSize);
-	QStringList sizeList(ps.sizeList());
-	QStringList activeSizeList(ps.activeSizeList());
-	activeSizesListWidget->clear();
-	availableSizesListWidget->clear();
 
-	for (int i = 0; i < activeSizeList.count(); ++i)
+	treeAvailableSizes->clear();
+	treeActiveSizes->clear();
+
+	auto cats = ps.categories();
+
+	// Available Page Sizes
+	for (auto it = cats.begin(); it != cats.end(); ++it)
 	{
-		QListWidgetItem* lwi = new QListWidgetItem();
-		PageSize ps2(activeSizeList.at(i));
-		lwi->setText(ps2.nameTR());
-		lwi->setToolTip(QString("%1 x %2 %3").arg(ps2.originalWidth()).arg(ps2.originalHeight()).arg(ps2.originalUnit()));
-		activeSizesListWidget->addItem(lwi);
+		QTreeWidgetItem* tlItem = new QTreeWidgetItem();
+		tlItem->setText(0, it.value());
+		tlItem->setData(0, Qt::UserRole, it.key());
+
+		treeAvailableSizes->addTopLevelItem(tlItem);
+
+		PageSizeInfoMap sizes = ps.sizesByCategory(it.key());
+
+		for (auto s = sizes.begin(); s != sizes.end(); ++s)
+		{
+			if (!ps.activePageSizes().contains(s.key()))
+			{
+				QTreeWidgetItem* sItem = new QTreeWidgetItem();
+				sItem->setText(0, s.value().trSizeName);
+				sItem->setText(1, s.value().sizeLabel);
+				sItem->setData(0, Qt::UserRole, s.key());
+
+				tlItem->addChild(sItem);
+			}
+		}
 	}
 
-	for (int i = 0; i < sizeList.count(); ++i)
+	// Active page Sizes
+	for (auto it = cats.begin(); it != cats.end(); ++it)
 	{
-		if (!activeSizeList.contains(sizeList.at(i)))
+		PageSizeInfo::Category cat = it.key();
+
+		QTreeWidgetItem* tlItem = new QTreeWidgetItem();
+		tlItem->setText(0, it.value());
+		tlItem->setData(0, Qt::UserRole, cat);
+
+		treeActiveSizes->addTopLevelItem(tlItem);
+
+		PageSizeInfoMap sizes = ps.activePageSizes();
+
+		for (auto s = sizes.begin(); s != sizes.end(); ++s)
 		{
-			QListWidgetItem* lwi = new QListWidgetItem();
-			PageSize ps2(sizeList.at(i));
-			lwi->setText(ps2.nameTR());
-			lwi->setToolTip(QString("%1 x %2 %3").arg(ps2.originalWidth()).arg(ps2.originalHeight()).arg(ps2.originalUnit()));
-			availableSizesListWidget->addItem(lwi);
+			if (s.value().category == cat)
+			{
+				QTreeWidgetItem* sItem = new QTreeWidgetItem();
+				sItem->setText(0, s.value().trSizeName);
+				sItem->setText(1, s.value().sizeLabel);
+				sItem->setData(0, Qt::UserRole, s.key());
+
+				tlItem->addChild(sItem);
+			}
+
 		}
 	}
+
 }
 
 void Prefs_PageSizes::saveGuiToPrefs(struct ApplicationPrefs *prefsData) const
 {
 	QStringList newActivePageSizes;
-	for (int i = 0; i < activeSizesListWidget->count(); ++i)
-		newActivePageSizes << activeSizesListWidget->item(i)->text();
-	PageSize ps(prefsData->docSetupPrefs.pageSize);
-	prefsData->activePageSizes = ps.untransPageSizeList(newActivePageSizes);
+
+	for (int i = 0; i < treeActiveSizes->topLevelItemCount(); ++i)
+	{
+		QTreeWidgetItem* item = treeActiveSizes->takeTopLevelItem(i);
+
+		for (int j = 0; j < item->childCount(); ++j)
+			newActivePageSizes << item->child(j)->data(0, Qt::UserRole).toString();
+	}
+
+	prefsData->activePageSizes = newActivePageSizes;
+
 }
 
 void Prefs_PageSizes::moveToActive()
 {
-	QList<QListWidgetItem *> si(availableSizesListWidget->selectedItems());
-	for (int i = 0; i < si.count(); ++i)
-	{
-		QListWidgetItem* it = availableSizesListWidget->takeItem(availableSizesListWidget->row(si.at(i)));
-		activeSizesListWidget->addItem(it);
-	}
+	moveItems(treeAvailableSizes, treeActiveSizes);
 }
 
 void Prefs_PageSizes::moveFromActive()
 {
-	QList<QListWidgetItem *> si(activeSizesListWidget->selectedItems());
+	int childrenCount = 0;
+
+	for (int i = 0; i < treeActiveSizes->topLevelItemCount(); ++i)
+		childrenCount += treeActiveSizes->topLevelItem(i)->childCount();
+
+	if (childrenCount > 1)
+		moveItems(treeActiveSizes, treeAvailableSizes);
+}
+
+void Prefs_PageSizes::moveItems(QTreeWidget *fromList, QTreeWidget *toList)
+{
+	QList<QTreeWidgetItem *> si(fromList->selectedItems());
+
+	if (si.count() != 1)
+		return;
+
 	for (int i = 0; i < si.count(); ++i)
 	{
-		if (activeSizesListWidget->count()>1)
+		QTreeWidgetItem* currentItem = si.at(i);
+		QTreeWidgetItem* currentParent = currentItem->parent();
+
+		if (currentParent)
 		{
-			QListWidgetItem* it = activeSizesListWidget->takeItem(activeSizesListWidget->row(si.at(i)));
-			availableSizesListWidget->addItem(it);
+			int index = fromList->indexOfTopLevelItem(currentParent);
+
+			QTreeWidgetItem* exItem = currentParent->takeChild(currentParent->indexOfChild(currentItem));
+			if (exItem)
+			{
+				QTreeWidgetItem* newParentItem = toList->topLevelItem(index);
+				newParentItem->addChild(exItem);
+				newParentItem->sortChildren(0, Qt::AscendingOrder);
+			}
 		}
+		else
+		{
+			int index = fromList->indexOfTopLevelItem(currentItem);
+
+			QList<QTreeWidgetItem*> exItems = currentItem->takeChildren();
+			if (exItems.count() > 0)
+			{
+				QTreeWidgetItem* newParentItem = toList->topLevelItem(index);
+				newParentItem->addChildren(exItems);
+				newParentItem->sortChildren(0, Qt::AscendingOrder);
+			}
+		}
 	}
 }
 
Index: scribus/ui/prefs_pagesizes.h
===================================================================
--- scribus/ui/prefs_pagesizes.h	(Revision 26264)
+++ scribus/ui/prefs_pagesizes.h	(Arbeitskopie)
@@ -31,6 +31,9 @@
 	protected slots:
 		void moveToActive();
 		void moveFromActive();
+
+private:
+		void moveItems(QTreeWidget* fromList, QTreeWidget* toList);
 };
 
 #endif // PREFS_PAGESIZES_H
Index: scribus/ui/prefs_pagesizesbase.ui
===================================================================
--- scribus/ui/prefs_pagesizesbase.ui	(Revision 26264)
+++ scribus/ui/prefs_pagesizesbase.ui	(Arbeitskopie)
@@ -7,28 +7,27 @@
     <x>0</x>
     <y>0</y>
     <width>657</width>
-    <height>358</height>
-   </rect>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout_4">
-   <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="label">
-     <property name="font">
-      <font>
-       <pointsize>14</pointsize>
-       <weight>75</weight>
+    <height>358</height>
+   </rect>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_4">
+   <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="label">
+     <property name="font">
+      <font>
+       <pointsize>14</pointsize>
        <bold>true</bold>
       </font>
      </property>
@@ -40,7 +39,7 @@
    <item>
     <widget class="Line" name="line">
      <property name="orientation">
-      <enum>Qt::Horizontal</enum>
+      <enum>Qt::Orientation::Horizontal</enum>
      </property>
     </widget>
    </item>
@@ -56,16 +55,15 @@
         </widget>
        </item>
        <item>
-        <widget class="QListWidget" name="availableSizesListWidget">
-         <property name="alternatingRowColors">
-          <bool>false</bool>
-         </property>
+        <widget class="QTreeWidget" name="treeAvailableSizes">
          <property name="selectionMode">
-          <enum>QAbstractItemView::ExtendedSelection</enum>
+          <enum>QAbstractItemView::SelectionMode::SingleSelection</enum>
          </property>
-         <property name="sortingEnabled">
-          <bool>true</bool>
-         </property>
+         <column>
+          <property name="text">
+           <string notr="true">1</string>
+          </property>
+         </column>
         </widget>
        </item>
       </layout>
@@ -75,7 +73,7 @@
        <item>
         <spacer name="verticalSpacer">
          <property name="orientation">
-          <enum>Qt::Vertical</enum>
+          <enum>Qt::Orientation::Vertical</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
@@ -102,7 +100,7 @@
        <item>
         <spacer name="verticalSpacer_2">
          <property name="orientation">
-          <enum>Qt::Vertical</enum>
+          <enum>Qt::Orientation::Vertical</enum>
          </property>
          <property name="sizeHint" stdset="0">
           <size>
@@ -124,13 +122,15 @@
         </widget>
        </item>
        <item>
-        <widget class="QListWidget" name="activeSizesListWidget">
+        <widget class="QTreeWidget" name="treeActiveSizes">
          <property name="selectionMode">
-          <enum>QAbstractItemView::ExtendedSelection</enum>
+          <enum>QAbstractItemView::SelectionMode::SingleSelection</enum>
          </property>
-         <property name="sortingEnabled">
-          <bool>true</bool>
-         </property>
+         <column>
+          <property name="text">
+           <string notr="true">1</string>
+          </property>
+         </column>
         </widget>
        </item>
       </layout>
Index: scribus/ui/widgets/pagelayout.cpp
===================================================================
--- scribus/ui/widgets/pagelayout.cpp	(nicht existent)
+++ scribus/ui/widgets/pagelayout.cpp	(Arbeitskopie)
@@ -0,0 +1,205 @@
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+#include "pagelayout.h"
+
+#include <QComboBox>
+#include <QToolButton>
+#include <QVBoxLayout>
+#include <QListWidgetItem>
+#include <QLabel>
+#include <QPixmap>
+#include <QList>
+
+#include "commonstrings.h"
+#include "iconmanager.h"
+#include "scribusapp.h"
+#include "ui/widgets/form_widget.h"
+
+PageLayouts::PageLayouts(QWidget* parent)  : QWidget( parent )
+{
+	struct PageSet pageS;
+	pageS.Name = CommonStrings::trPageSet2;
+	pageS.FirstPage = 0;
+	pageS.Rows = 1;
+	pageS.Columns = 1;
+	pageS.pageNames.clear();
+	pageS.pageNames.append(CommonStrings::trPageLocMiddleRight);
+	m_pageSets.append(pageS);
+
+	layoutGroupLayout = new QHBoxLayout(this);
+	layoutGroupLayout->setSpacing(4);
+	layoutGroupLayout->setContentsMargins(0, 0, 0, 0);
+
+	QFont layFont(this->font());
+	layFont.setPointSize(8);
+
+	menuScheme = new QMenu();
+
+	buttonScheme = new QToolButton(this);
+	buttonScheme->setPopupMode(QToolButton::InstantPopup);
+	buttonScheme->setMenu(menuScheme);
+
+	labelScheme = new FormWidget();
+	labelScheme->setFont(layFont);
+	labelScheme->addWidget(buttonScheme);
+	labelScheme->setLabelVisibility(!m_hideLabels);
+	layoutGroupLayout->addWidget( labelScheme );
+
+	menuFirstPage = new QMenu();
+
+	buttonFirstPage = new QToolButton(this);
+	buttonFirstPage->setPopupMode(QToolButton::InstantPopup);
+	buttonFirstPage->setMenu(menuFirstPage);
+
+	labelPages = new FormWidget();
+	labelPages->setFont(layFont);
+	labelPages->addWidget( buttonFirstPage );
+	labelPages->setLabelVisibility(!m_hideLabels);
+	layoutGroupLayout->addWidget( labelPages );
+
+	languageChange();
+
+	connect(ScQApp, SIGNAL(labelVisibilityChanged(bool)), this, SLOT(toggleLabelVisibility(bool)));
+	connect(menuScheme, &QMenu::triggered, this, &PageLayouts::changeScheme);
+	connect(menuFirstPage, &QMenu::triggered, this, &PageLayouts::changeFirstPage);
+}
+
+void PageLayouts::updateSchemeSelector(QList<PageSet> pageSets, int pagePositioning)
+{
+	m_pageSets = pageSets;
+	docPagePositioning = pagePositioning;
+	labelPages->setVisible( docPagePositioning > 0 );
+
+	reloadScheme();
+}
+
+void PageLayouts::setFirstPage(int nr)
+{
+	if (menuFirstPage->actions().count() == 0)
+		return;
+
+	m_firstPage = qBound(0, nr, menuFirstPage->actions().count());
+	buttonFirstPage->setIcon(menuFirstPage->actions().at(m_firstPage)->icon());
+}
+
+void PageLayouts::setScheme(int nr)
+{
+	if (menuScheme->actions().count() == 0)
+		return;
+
+	m_scheme = qBound(0, nr, menuScheme->actions().count());
+	buttonScheme->setIcon(menuScheme->actions().at(m_scheme)->icon());
+
+	reloadFirstPage(m_scheme);
+
+}
+
+void PageLayouts::setHideLabelsPermanently(bool hide)
+{
+	m_hideLabels = hide;
+	toggleLabelVisibility(!hide);
+}
+
+void PageLayouts::reloadScheme()
+{
+	disconnect(menuScheme, &QMenu::triggered, this, &PageLayouts::changeScheme);
+
+	menuScheme->clear();
+
+	for (int pg = 0; pg < m_pageSets.count(); ++pg)
+	{
+		//Leave the code in for 3-/4- fold but exclude from UI in case we bring it back.
+		if (pg > 1 && docPagePositioning < 2)
+			continue;
+
+		QString psname = CommonStrings::translatePageSetString(m_pageSets[pg].Name);
+		if (pg == 0)
+			menuScheme->addAction(IconManager::instance().loadIcon("16/page-simple.png"), psname)->setData(QVariant(pg));
+		else if (pg == 1)
+			menuScheme->addAction(IconManager::instance().loadIcon("16/page-doublesided.png"), psname)->setData(QVariant(pg));
+		else if (pg == 2)
+			menuScheme->addAction(IconManager::instance().loadIcon("16/page-3fold.png"), psname)->setData(QVariant(pg));
+		else if (pg == 3)
+			menuScheme->addAction(IconManager::instance().loadIcon("16/page-4fold.png"), psname)->setData(QVariant(pg));
+		else
+			menuScheme->addAction(IconManager::instance().loadIcon("16/page-simple.png"), psname)->setData(QVariant(pg));
+	}
+
+	connect(menuScheme, &QMenu::triggered, this, &PageLayouts::changeScheme);
+
+
+}
+
+void PageLayouts::reloadFirstPage(int scheme)
+{
+	disconnect(menuFirstPage, &QMenu::triggered, this, &PageLayouts::changeFirstPage);
+
+	menuFirstPage->clear();
+
+	// We have to add the other cases if want to support them again
+	// CommonStrings::trPageLocLeft
+	// CommonStrings::trPageLocMiddle
+	// CommonStrings::trPageLocMiddleLeft
+	// CommonStrings::trPageLocMiddleRight
+	// CommonStrings::trPageLocRight
+
+	for (int pg = 0; pg < m_pageSets[scheme].pageNames.count(); ++pg)
+	{
+		QString psname = CommonStrings::translatePageSetString(m_pageSets[scheme].pageNames[pg]);
+
+		if (psname == CommonStrings::trPageLocLeft)
+			menuFirstPage->addAction(IconManager::instance().loadIcon("page-first-left"), psname)->setData(QVariant(pg));
+		else if (psname == CommonStrings::trPageLocRight)
+			menuFirstPage->addAction(IconManager::instance().loadIcon("page-first-right"), psname)->setData(QVariant(pg));
+		else
+			menuFirstPage->addAction(IconManager::instance().loadIcon("page-first-left"), psname)->setData(QVariant(pg));
+	}
+
+	connect(menuFirstPage, &QMenu::triggered, this, &PageLayouts::changeFirstPage);
+
+
+}
+
+void PageLayouts::toggleLabelVisibility(bool visibility)
+{
+	// hide labels always if flag is false
+	if (m_hideLabels)
+		visibility = false;
+
+	labelScheme->setLabelVisibility(visibility);
+	labelPages->setLabelVisibility(visibility);
+}
+
+void PageLayouts::languageChange()
+{
+
+	reloadScheme();
+	reloadFirstPage(m_scheme);
+
+	labelScheme->setText( tr( "Scheme" ) );
+	labelPages->setText( tr( "First Page" ) );
+
+	buttonScheme->setToolTip( tr( "Number of pages to show side-by-side on the canvas. Often used for allowing items to be placed across page spreads." ) );
+	buttonFirstPage->setToolTip( tr( "Location on the canvas where the first page of the document is placed" ) );
+}
+
+void PageLayouts::changeScheme(QAction *action)
+{
+	buttonScheme->setIcon(action->icon());
+	int ic = action->data().toInt();
+//	setScheme(ic);
+	reloadFirstPage(ic);
+	labelPages->setVisible( ic > 0 );
+	emit schemeChanged(ic);
+}
+
+void PageLayouts::changeFirstPage(QAction *action)
+{
+	buttonFirstPage->setIcon(action->icon());
+	m_firstPage = action->data().toInt();
+	emit firstPageChanged(m_firstPage);
+}
Index: scribus/ui/widgets/pagelayout.h
===================================================================
--- scribus/ui/widgets/pagelayout.h	(nicht existent)
+++ scribus/ui/widgets/pagelayout.h	(Arbeitskopie)
@@ -0,0 +1,77 @@
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+#ifndef PAGELAYOUT_H
+#define PAGELAYOUT_H
+
+#include <QGroupBox>
+#include <QListWidget>
+#include <QList>
+
+class QToolButton;
+class QLabel;
+class QHBoxLayout;
+class FormWidget;
+class QMenu;
+
+#include "scribusapi.h"
+#include "scribusstructs.h"
+#include "scribusdoc.h"
+
+/*! \brief A widget for changing pages layout.
+User can change layouts on-the-fly changing widget's
+comboboxes. */
+class SCRIBUS_API PageLayouts : public QWidget
+{
+	Q_OBJECT
+
+public:
+	PageLayouts(QWidget* parent);
+	~PageLayouts() {};
+
+	void updateSchemeSelector(QList<PageSet> pageSets, int pagePositioning);
+	void setFirstPage(int nr);
+	int firstPage() { return m_firstPage; };
+	void setScheme(int nr);
+	int scheme() { return m_scheme; };
+
+	void setHideLabelsPermanently(bool hide);
+	bool hideLabelsPermanently() { return m_hideLabels; };
+
+public slots:
+	void toggleLabelVisibility(bool visibility);
+
+signals:
+	void schemeChanged(int);
+	void firstPageChanged(int);
+
+private:
+
+	int m_scheme {0};
+	int m_firstPage {0};
+	bool m_hideLabels {false};
+	int docPagePositioning {0};
+
+	FormWidget* labelScheme;
+	FormWidget* labelPages;
+	QList<PageSet> m_pageSets;
+	QToolButton* buttonScheme;
+	QToolButton* buttonFirstPage;
+	QMenu* menuScheme;
+	QMenu* menuFirstPage;
+	QHBoxLayout* layoutGroupLayout;
+
+	void reloadScheme();
+	void reloadFirstPage(int scheme);
+
+protected slots:
+	void languageChange();
+	void changeScheme(QAction* action);
+	void changeFirstPage(QAction* action);
+
+};
+
+#endif // PAGELAYOUT_H
Index: scribus/ui/widgets/pagesizelist.cpp
===================================================================
--- scribus/ui/widgets/pagesizelist.cpp	(nicht existent)
+++ scribus/ui/widgets/pagesizelist.cpp	(Arbeitskopie)
@@ -0,0 +1,133 @@
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+
+#include "pagesizelist.h"
+#include "ui/delegates/sclistitemdelegate.h"
+#include "pagesize.h"
+#include "prefsmanager.h"
+#include <QPainter>
+
+PageSizeList::PageSizeList(QWidget* parent) :
+	QListWidget(parent)
+{
+	setDragEnabled(false);
+	setViewMode(QListView::IconMode);
+	setFlow(QListView::LeftToRight);
+	setSortingEnabled(false);
+// 	setWrapping(false);
+	setWordWrap(true);
+	setAcceptDrops(false);
+	setDropIndicatorShown(false);
+	setDragDropMode(QAbstractItemView::NoDragDrop);
+	setResizeMode(QListView::Adjust);
+	setSelectionMode(QAbstractItemView::SingleSelection);
+	setFocusPolicy(Qt::NoFocus);
+	setIconSize(QSize(48, 48));
+	setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+	setGridSize(QSize(128, 128));
+	setItemDelegate(new ScListItemDelegate(QListWidget::IconMode, QSize(48,48)));
+	setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
+}
+
+void PageSizeList::setFormat(QString format)
+{
+	loadPageSizes(format, m_orientation, m_category);
+	m_name = format;
+}
+
+void PageSizeList::setOrientation(int orientation)
+{
+	loadPageSizes(m_name, orientation, m_category);
+	m_orientation = orientation;
+}
+
+void PageSizeList::setCategory(PageSizeInfo::Category category)
+{
+	loadPageSizes(m_name, m_orientation, category);
+	m_category = category;
+}
+
+void PageSizeList::loadPageSizes(QString name, int orientation, PageSizeInfo::Category category)
+{
+	PageSize ps(name);
+	PageSize pref(PrefsManager::instance().appPrefs.docSetupPrefs.pageSize);
+
+	int selection = -1;
+
+	if (m_category == category && this->selectedItems().size() > 0)
+		selection = this->row(this->selectedItems().first());
+
+	QSignalBlocker sig(this);
+	this->clear();
+
+	foreach (auto item, ps.pageSizes()) {
+
+		QSize size;
+		size.setWidth( orientation == 0 ? item.width : item.height);
+		size.setHeight( orientation == 0 ? item.height : item.width);
+
+		// Add items of selected category or all favorites and defaults
+		if (item.category == category ||
+				(category == PageSizeInfo::Favorite && ps.activePageSizes().contains(item.sizeName)) ||
+				(category == PageSizeInfo::Favorite && item.sizeName == pref.name()))
+		{
+			QListWidgetItem *lstItem = new QListWidgetItem(item.trSizeName);
+			lstItem->setIcon(sizePreview(this->iconSize(), size));
+			lstItem->setData(Qt::UserRole, QVariant(item.sizeLabel));
+			lstItem->setData(Qt::UserRole + 1, QVariant(item.pageUnitIndex));
+			lstItem->setData(Qt::UserRole + 2, QVariant(item.category));
+			lstItem->setData(Qt::UserRole + 3, QVariant(item.sizeName));
+			this->addItem(lstItem);
+
+			if (selection == -1 && item.sizeName == ps.name())
+				lstItem->setSelected(true);
+		}
+	}
+
+	if (selection > -1)
+		this->item(selection)->setSelected(true);
+
+}
+
+void PageSizeList::updateGeometries()
+{
+	QListWidget::updateGeometries();
+	verticalScrollBar()->setSingleStep(10);
+}
+
+QIcon PageSizeList::sizePreview(QSize iconSize, QSize pageSize)
+{
+	QPixmap pix(iconSize);
+	pix.fill(Qt::transparent);
+
+	bool isVertical = pageSize.width() < pageSize.height();
+	double ratio = (double)pageSize.width() / (double)pageSize.height();
+	int height = iconSize.height();
+	int width = height * ratio;
+	int x = iconSize.width() / 2 - width / 2;
+	int y = 0;
+
+	if (!isVertical)
+	{
+		ratio = (double)pageSize.height() / (double)pageSize.width();
+		width = iconSize.width();
+		height = width * ratio;
+		x = 0;
+		y = iconSize.height() / 2 - height / 2;
+
+	}
+
+	QRect page(x, y, width, height);
+	QPainter painter(&pix);
+	painter.setPen(QPen(palette().text().color()));
+	painter.setBrush(Qt::white);
+	painter.drawRect(page.adjusted(0, 0, -1, -1));
+	painter.end();
+
+	return QIcon(pix);
+
+}
Index: scribus/ui/widgets/pagesizelist.h
===================================================================
--- scribus/ui/widgets/pagesizelist.h	(nicht existent)
+++ scribus/ui/widgets/pagesizelist.h	(Arbeitskopie)
@@ -0,0 +1,45 @@
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+#ifndef PAGESIZELIST_H
+#define PAGESIZELIST_H
+
+#include <QListWidget>
+#include <QScrollBar>
+#include "scribusapi.h"
+#include "pagesize.h"
+
+class SCRIBUS_API PageSizeList : public QListWidget
+{
+	Q_OBJECT
+
+public:
+	PageSizeList(QWidget* parent);
+	~PageSizeList() = default;
+
+	void setFormat(QString format);
+	QString format() { return m_name; };
+
+	void setOrientation(int orientation);
+	int orientation() { return m_orientation; };
+
+	void setCategory(PageSizeInfo::Category category);
+	PageSizeInfo::Category category() { return m_category; };
+
+	void updateGeometries() override;
+
+private:
+
+	QString m_name {QString::number(PageSizeInfo::IsoA) + "_A4"};
+	int m_orientation {0};
+	PageSizeInfo::Category m_category {PageSizeInfo::Favorite};
+
+	QIcon sizePreview(QSize iconSize, QSize pageSize);
+	void loadPageSizes(QString name, int orientation, PageSizeInfo::Category category);
+};
+
+
+#endif // PAGESIZELIST_H
Index: scribus/ui/widgets/pagesizepreview.cpp
===================================================================
--- scribus/ui/widgets/pagesizepreview.cpp	(nicht existent)
+++ scribus/ui/widgets/pagesizepreview.cpp	(Arbeitskopie)
@@ -0,0 +1,79 @@
+#include "pagesizepreview.h"
+#include "prefsmanager.h"
+
+#include <QFontMetrics>
+
+PageSizePreview::PageSizePreview(QWidget *parent) : QWidget{parent}
+{
+	setMinimumSize(120, 120);
+}
+
+void PageSizePreview::paintEvent(QPaintEvent *event)
+{
+	QColor colPage = PrefsManager::instance().appPrefs.displayPrefs.paperColor;
+	QColor colBackground = PrefsManager::instance().appPrefs.displayPrefs.scratchColor;
+	QColor colMargin(Qt::blue);
+	QColor colFrame(Qt::black);
+	QColor colLabel(Qt::white);
+	QColor colLabelBackground(QColor(0, 0, 0, 128));
+
+
+	int count = m_layout + 1;
+	int space = 8;
+	QRect saveArea(rect().adjusted(space, space, -space, -space));
+	double ratio = qMin( saveArea.height() / m_height, saveArea.width() / (m_width * count) );
+	double pageWidth = m_width * ratio;
+	double pageHeight = m_height * ratio;
+	QSize pageSize(pageWidth, pageHeight);
+	QRect rectPaper(0, 0, pageSize.width() * count, pageSize.height());
+	rectPaper.setLeft( space + (saveArea.width() - rectPaper.width()) / 2 );
+	rectPaper.setTop( space + (saveArea.height() - rectPaper.height()) / 2 );
+
+	QPainter painter(this);
+	painter.fillRect( rect(), QBrush(colBackground) );
+
+	for (int i = 0; i < count; i++)
+	{
+		QRect rPage(rectPaper.x() + pageSize.width() * i , rectPaper.y(), pageSize.width(), pageSize.height());
+		QRect rMargin;
+
+		// Left Page
+		if (i == 0 && count > 1)
+		{
+			rMargin.setLeft(rPage.left() + m_margins.right() * ratio);
+			rMargin.setRight(rPage.right() - m_margins.left() * ratio);	
+		}
+		// Right and Single Page
+		else
+		{
+			rMargin.setLeft(rPage.left() + m_margins.left() * ratio);
+			rMargin.setRight(rPage.right() - m_margins.right() * ratio);
+		}
+
+		rMargin.setTop(rPage.top() + m_margins.top() * ratio);
+		rMargin.setBottom(rPage.bottom() - m_margins.bottom() * ratio);
+
+
+		// Draw Pages
+		painter.setBrush( colPage );
+		painter.setPen( QPen(colFrame) );
+		painter.drawRect( rPage );
+
+		// Draw Margins
+		painter.setBrush( Qt::NoBrush );
+		painter.setPen( QPen(colMargin) );
+		painter.drawRect( rMargin );
+
+		painter.setPen( QPen(colFrame) );
+		if (m_firstPage == i && count > 1)
+			painter.drawText(rPage, Qt::AlignCenter | Qt::AlignVCenter, QString::number(1));
+
+	}
+
+	// Draw label
+	painter.setBackgroundMode(Qt::OpaqueMode);
+	painter.setBackground(colLabelBackground);
+	painter.setPen(QPen(colLabel));
+	painter.drawText(saveArea, Qt::AlignRight | Qt::AlignBottom |Qt::TextWordWrap, " " + m_name + " ");
+
+}
Index: scribus/ui/widgets/pagesizepreview.h
===================================================================
--- scribus/ui/widgets/pagesizepreview.h	(nicht existent)
+++ scribus/ui/widgets/pagesizepreview.h	(Arbeitskopie)
@@ -0,0 +1,54 @@
+#ifndef PAGESIZEPREVIEW_H
+#define PAGESIZEPREVIEW_H
+
+#include "margins.h"
+#include "pagesize.h"
+#include <QWidget>
+
+class PageSizePreview : public QWidget
+{
+	Q_OBJECT
+public:
+	explicit PageSizePreview(QWidget *parent = nullptr);
+
+	void setPageHeight(double height) { m_height = height; update(); };
+	void setPageWidth(double width) { m_width = width; update(); };
+	void setMargins(MarginStruct margins) { m_margins = margins; update(); };
+	void setBleeds(MarginStruct bleeds) { m_bleeds = bleeds; update(); };
+	void setPageName(QString name) {
+		PageSize ps(name);
+		m_name = ps.nameTR();
+		update();
+	};
+	void setLayout(int layout) { m_layout = layout; update(); };
+	void setFirstPage(int firstPage) { m_firstPage = firstPage; update(); };
+	void setPage(double height, double width, MarginStruct margins, MarginStruct bleeds, QString name, int layout, int firstPage)
+	{
+		PageSize ps(name);
+
+		m_height = height;
+		m_width = width;
+		m_margins = margins;
+		m_bleeds = bleeds;
+		m_name = ps.nameTR();
+		m_layout = layout;
+		m_firstPage = firstPage;
+		update();
+	}
+
+private:
+	MarginStruct m_margins;
+	MarginStruct m_bleeds;
+	double m_height;
+	double m_width;
+	QString m_name;
+	int m_layout;
+	int m_firstPage;
+
+	void paintEvent(QPaintEvent *event) override;
+
+signals:
+
+};
+
+#endif // PAGESIZEPREVIEW_H
Index: scribus/ui/widgets/pagesizeselector.cpp
===================================================================
--- scribus/ui/widgets/pagesizeselector.cpp	(nicht existent)
+++ scribus/ui/widgets/pagesizeselector.cpp	(Arbeitskopie)
@@ -0,0 +1,161 @@
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include <QVBoxLayout>
+
+#include "pagesizeselector.h"
+#include "pagesize.h"
+#include "commonstrings.h"
+
+PageSizeSelector::PageSizeSelector(QWidget *parent)
+	: QWidget{parent}
+{
+	comboCategory = new QComboBox();
+	comboFormat = new QComboBox();
+
+	QVBoxLayout* lytMain = new QVBoxLayout();
+	lytMain->setContentsMargins(0, 0, 0, 0);
+	lytMain->setSpacing(4);
+	lytMain->addWidget(comboCategory);
+	lytMain->addWidget(comboFormat);
+	this->setLayout(lytMain);
+
+	connect(comboCategory, &QComboBox::currentIndexChanged, this, &PageSizeSelector::categorySelected);
+	connect(comboFormat, &QComboBox::currentIndexChanged, this, &PageSizeSelector::formatSelected);
+}
+
+
+void PageSizeSelector::setHasFormatSelector(bool isVisble)
+{
+	m_hasFormatSelector = isVisble;
+	comboFormat->setVisible(isVisble);
+}
+
+void PageSizeSelector::setHasCustom(bool hasCustom)
+{
+	m_hasCustom = hasCustom;
+
+	if (!m_sizeName.isEmpty())
+		setPageSize(m_sizeName);
+}
+
+void PageSizeSelector::setCurrentCategory(PageSizeInfo::Category category)
+{
+	int index = comboCategory->findData(category);
+	if (index != -1)
+		comboCategory->setCurrentIndex(index);
+}
+
+void PageSizeSelector::setPageSize(QString name)
+{
+	PageSize ps(name);
+
+	m_sizeName = ps.name();
+	m_sizeCategory = ps.category();
+	m_trSizeName = ps.nameTR();
+
+	// Load category list
+	int index = -1;
+	QSignalBlocker sigCat(comboCategory);
+	comboCategory->clear();
+
+	// Add Custom
+	if (hasCustom())
+	{
+		comboCategory->addItem(CommonStrings::trCustomPageSize, PageSizeInfo::Custom);
+		if (m_sizeName == CommonStrings::customPageSize || m_sizeName == CommonStrings::trCustomPageSize)
+			index = comboCategory->count() - 1;
+	}
+
+	// Add Favorite
+	comboCategory->addItem(ps.categoryToString(PageSizeInfo::Favorite), PageSizeInfo::Favorite);
+
+	// Add all available categories
+	PageSizeCategoriesMap categories = ps.categories();
+	for (auto it = categories.begin(); it != categories.end(); ++it)
+	{
+		comboCategory->addItem(it.value(), it.key());
+		if (it.key() == m_sizeCategory)
+			index = comboCategory->count() - 1;			
+	}
+
+	comboCategory->setCurrentIndex(index);
+	comboCategory->insertSeparator(comboCategory->findData(PageSizeInfo::Favorite) + 1);
+	comboCategory->insertSeparator(comboCategory->findData(PageSizeInfo::USEnvelop) + 1);
+	comboCategory->insertSeparator(comboCategory->findData(PageSizeInfo::Other) + 1);
+
+	// Load size format list
+	setFormat(m_sizeCategory, m_sizeName);
+}
+
+void PageSizeSelector::setFormat(PageSizeInfo::Category category, QString name)
+{
+	if (!hasFormatSelector())
+		return;
+
+	PageSize ps(name);
+
+	int index = -1;
+	QSignalBlocker sigFormat(comboFormat);
+	comboFormat->clear();
+
+	if (category == PageSizeInfo::Custom)
+	{
+		comboFormat->setEnabled(false);
+		m_sizeName = CommonStrings::customPageSize;
+		m_trSizeName = CommonStrings::trCustomPageSize;
+		return;
+	}
+	else
+	{
+		comboFormat->setEnabled(true);
+	}
+
+	foreach (auto item, ps.pageSizes()) {
+		if (item.category == category || (category == PageSizeInfo::Favorite && ps.activePageSizes().contains(item.sizeName)))
+		{
+			comboFormat->addItem(item.trSizeName, item.sizeName);
+			if (item.sizeName == name)
+				index = comboFormat->count() - 1;
+		}
+	}
+
+	if (index == -1)
+		index = 0;
+
+	comboFormat->setCurrentIndex(index);
+
+	m_sizeName = static_cast<QString>(comboFormat->currentData().toString());
+	m_trSizeName = comboFormat->currentText();
+
+}
+
+void PageSizeSelector::categorySelected(int index)
+{
+	m_sizeCategory = static_cast<PageSizeInfo::Category>(comboCategory->itemData(index).toInt());
+
+	setFormat(m_sizeCategory, m_sizeName);
+	emit pageCategoryChanged(m_sizeCategory);
+	emit pageSizeChanged(m_trSizeName);
+}
+
+void PageSizeSelector::formatSelected(int index)
+{
+	m_sizeName = static_cast<QString>(comboFormat->itemData(index).toString());
+	m_trSizeName = comboFormat->itemText(index);
+
+	emit pageSizeChanged(m_trSizeName);
+}
Index: scribus/ui/widgets/pagesizeselector.h
===================================================================
--- scribus/ui/widgets/pagesizeselector.h	(nicht existent)
+++ scribus/ui/widgets/pagesizeselector.h	(Arbeitskopie)
@@ -0,0 +1,64 @@
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef PAGESIZESELECTOR_H
+#define PAGESIZESELECTOR_H
+
+#include <QWidget>
+#include <QComboBox>
+
+#include "pagesize.h"
+
+class PageSizeSelector : public QWidget
+{
+	Q_OBJECT
+public:
+	explicit PageSizeSelector(QWidget *parent = nullptr);
+
+	void setPageSize(QString name);
+	void setHasFormatSelector(bool isVisble );
+	void setHasCustom(bool hasCustom);
+	bool hasCustom() { return m_hasCustom; };
+	bool hasFormatSelector() { return m_hasFormatSelector; };
+	void setCurrentCategory(PageSizeInfo::Category category);
+
+	PageSizeInfo::Category category() { return m_sizeCategory; };
+	QString pageSize() { return m_sizeName; };
+	QString pageSizeTR() { return m_trSizeName; };
+
+private:
+	QComboBox* comboCategory;
+	QComboBox* comboFormat;
+
+	QString m_sizeName;
+	QString m_trSizeName;
+	PageSizeInfo::Category m_sizeCategory;
+	bool m_hasFormatSelector {true};
+	bool m_hasCustom {true};
+
+	void setFormat(PageSizeInfo::Category category, QString name);
+
+signals:
+	void pageSizeChanged(QString);
+	void pageCategoryChanged(PageSizeInfo::Category);
+
+private slots:
+	void categorySelected(int index);
+	void formatSelected(int index);
+
+};
+
+#endif // PAGESIZESELECTOR_H
Index: scribus/ui/widgets/section_container.cpp
===================================================================
--- scribus/ui/widgets/section_container.cpp	(Revision 26264)
+++ scribus/ui/widgets/section_container.cpp	(Arbeitskopie)
@@ -22,7 +22,7 @@
  */
 
 SectionContainer::SectionContainer(QWidget *parent)
-	: SectionContainer("Title", "", true, parent) {}
+	: SectionContainer("Title", "", true, true, parent) {}
 
 SectionContainer::SectionContainer(QString title, QString objectName, bool isCollapsible, bool isExpanded,
 								   QWidget *parent)
@@ -36,11 +36,12 @@
 	m_isCollapsed = !isExpanded;
 
 	// Main Layout
-	mainLayout = new QVBoxLayout(this);
+	mainLayout = new QVBoxLayout();
 	mainLayout->setSpacing(0);
 	mainLayout->setContentsMargins(0, 0, 0, 0);
 	mainLayout->addWidget(header);
 	mainLayout->addWidget(body);
+	QWidget::setLayout(mainLayout);
 
 	// Size Policy
 	QSizePolicy sizePol(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum);
@@ -241,7 +242,7 @@
 
 QSize SectionContainer::calculateSize()
 {
-	QSize s = minimumSizeHint();
+	QSize s = SectionContainer::minimumSizeHint();
 	s.setWidth(this->width());
 
 	return s;
@@ -435,7 +436,7 @@
 SectionContainerHeader::SectionContainerHeader(QWidget *parent)
 	: SectionContainerHeader("Title", parent) {}
 
-SectionContainerHeader::SectionContainerHeader(QString title, QWidget *parent)
+SectionContainerHeader::SectionContainerHeader(QString title, QWidget *parent) : QWidget(parent)
 {
 	int padding = 6;
 	m_hasStyle = true;
@@ -490,6 +491,8 @@
 
 void SectionContainerHeader::paintEvent(QPaintEvent *event)
 {
+	Q_UNUSED(event)
+
 	if (!m_hasStyle)
 		return;
 
