View Issue Details

IDProjectCategoryView StatusLast Update
0016979ScribusUser Interfacepublic2023-09-11 20:34
Reporternitramr Assigned Tonitramr  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
PlatformDesktop PCOSUbuntuOS Version23.04 64-bit
Product Version1.7.0.svn 
Target Version1.7.0Fixed in Version1.7.0.svn 
Summary0016979: Implement AdvancedDockingSystem as replacement for QDockWidget
DescriptionBrief
====
The QDockWidget is nice to arrange panels, but it is limited to basic features. The AdvanceDockingSystem supports more complex panel layouts and provide more flexibility to create real workspaces for GUI.

Must have
=========
- user is able to rearrange single palettes like in a previous Scribus version with QDockWidget
- GUI (panel composition) is saved when application closes
- GUI (panel composition) restore layout on application startup
- new dock widgets can be used for plugins too (like Shape Plugin)

Nice to have
==========
- saving and loading functionality for different workspaces (prebuild and custom) like in Blender.
- "next action" dialog as central widget if no document is opened

ADS
===
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System

Current Status
============
- all QDockWidgets are replaced for all palettes
- a new DockManager has been added to manage palettes and GUI layouts
- a new central widget has been added to show mdi windows
- GUI automatically saves the status on close
- GUI automatically restore the status on startup
- Support for plugins works

Known Issues
===========
None so far
TagsNo tags attached.
PatchNo

Relationships

related to 0016898 closednitramr Scribus' application layout starts empty 
related to 0016806 closednitramr Better pane titles 

Activities

nitramr

2023-07-09 14:46

developer  

nitramr

2023-07-09 16:09

developer   ~0050271

Patch based on revision 25545
ads_23-07-09_01.patch (191,020 bytes)   
Index: resources/iconsets/1_7_0/1_7_0.xml
===================================================================
--- resources/iconsets/1_7_0/1_7_0.xml	(Revision 25545)
+++ resources/iconsets/1_7_0/1_7_0.xml	(Arbeitskopie)
@@ -551,7 +555,12 @@
 		<icon id="wizard16.png" file="16/tool-copy-style.svg" />
 		<!-- Red onLight="#E54545" onDark="#FF6666" -->
 		<icon id="16/insert-barcode.png" file="16/tool-insert-barcode.svg" />
-		<icon id="22/insert-barcode.png" file="16/tool-insert-barcode.svg" /> 
+		<icon id="22/insert-barcode.png" file="16/tool-insert-barcode.svg" />
 		
+		<!-- Windows -->		
+		<icon id="close" file="16/action-close.svg" />
+		<icon id="menu-down" file="16/action-chevron-down.svg" />
+		<icon id="dock-float" file="16/action-window-float.svg" />
+		
 	</icons>
 </iconset>
Index: scribus/CMakeLists_Sources.txt
===================================================================
--- scribus/CMakeLists_Sources.txt	(Revision 25545)
+++ scribus/CMakeLists_Sources.txt	(Arbeitskopie)
@@ -257,6 +257,7 @@
 	imagedataloaders/scimgdataloader_qt.cpp
 	imagedataloaders/scimgdataloader_tiff.cpp
 	imagedataloaders/scimgdataloader_wpg.cpp
+	manager/dock_manager.cpp
 	palettes/cxfcolor.cpp
 	palettes/cxfcolorspecification.cpp
 	palettes/cxfdocument.cpp
@@ -535,6 +536,8 @@
 	ui/vruler.cpp
 	ui/useprintermarginsdialog.cpp
 	ui/weldedit.cpp
+	ui/docks/dock_centralwidget.cpp
+	ui/docks/dock_panelbase.cpp
 	${SCRIBUS_OSG_SRC}
 	${SCRIBUS_GMAGICK_SRC}
 	${SCRIBUS_JPEGXL_SRC}
Index: scribus/manager/dock_manager.cpp
===================================================================
--- scribus/manager/dock_manager.cpp	(nicht existent)
+++ scribus/manager/dock_manager.cpp	(Arbeitskopie)
@@ -0,0 +1,155 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+#include "dock_manager.h"
+
+#include "ui/docks/dock_centralwidget.h"
+#include "third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.h"
+#include <QMenu>
+
+#include "ui/pagepalette.h"
+#include "ui/outlinepalette.h"
+#include "ui/propertiespalette.h"
+#include "ui/contentpalette.h"
+#include "ui/layers.h"
+#include "ui/aligndistribute.h"
+#include "ui/inlinepalette.h"
+#include "ui/bookmarkpalette.h"
+#include "ui/scrapbookpalette.h"
+#include "ui/symbolpalette.h"
+#include "undogui.h"
+#include "prefsmanager.h"
+#include "prefsfile.h"
+
+//#include "icon_manager.h"
+
+/* ********************************************************************************* *
+ *
+ * Constructor + Setup
+ *
+ * ********************************************************************************* */
+
+DockManager::DockManager(QWidget *parent, QString theme) : ads::CDockManager(parent)
+{
+
+	//setStyleSheet(theme); // uncomment to override default style with theme.
+
+	dockCenter = new DockCentralWidget();
+	auto * areaCenter = setCentralWidget(dockCenter);
+	areaCenter->setAllowedAreas(ads::DockWidgetArea::OuterDockAreas);
+
+	m_palettePrefs = PrefsManager::instance().prefsFile->getContext(m_context);
+
+}
+
+void DockManager::setupDocks()
+{
+	pagePalette = new PagePalette((QWidget*)this->parent());
+	contentPalette = new ContentPalette(this);
+	propertiesPalette = new PropertiesPalette(this);
+	outlinePalette = new OutlinePalette(this);
+	layerPalette = new LayerPalette(this);
+	inlinePalette = new InlinePalette(this);
+	alignDistributePalette = new AlignDistributePalette();
+	scrapbookPalette = new Biblio(this);
+	bookPalette = new BookPalette(this);
+	undoPalette = new UndoPalette(this);
+	symbolPalette = new SymbolPalette(this);
+
+    // Panel ToolProperties
+//    PanelToolProperties * panelTest = new PanelToolProperties();
+//    dockToolProperties->setWidget(panelTest);
+//    dockToolProperties->setFeature(ads::CDockWidget::NoTab, true);
+}
+
+
+void DockManager::setCenter(QWidget *widget)
+{
+	dockCenter->setWidget(widget);
+}
+
+/* ********************************************************************************* *
+ *
+ * Public Methods
+ *
+ * ********************************************************************************* */
+
+//ads::CDockAreaWidget* DockManager::addDocument(DockDocumentBase *document)
+//{
+//    auto * dockArea =  addDockWidget(ads::CenterDockWidgetArea, document, areaCenter);
+//    windowMenu->addAction(document->toggleViewAction());
+
+//    connect(document, &DockDocumentBase::changedContentMode, panelContent, &PanelContent::setContentMode);
+
+//    return dockArea;
+
+//}
+
+void DockManager::loadDefaultWorkspace()
+{
+
+	// Left
+	auto * areaLeft = addDockWidget(ads::LeftDockWidgetArea, contentPalette);
+	addDockWidget(ads::CenterDockWidgetArea, outlinePalette, areaLeft);
+	addDockWidget(ads::CenterDockWidgetArea, inlinePalette, areaLeft);
+	addDockWidget(ads::CenterDockWidgetArea, scrapbookPalette, areaLeft);
+	addDockWidget(ads::CenterDockWidgetArea, bookPalette, areaLeft);
+	addDockWidget(ads::CenterDockWidgetArea, symbolPalette, areaLeft);
+
+	// Right Panel
+	auto * areaRight = addDockWidget(ads::RightDockWidgetArea, propertiesPalette);
+	addDockWidget(ads::CenterDockWidgetArea, pagePalette, areaRight);
+
+	// Right Bottom
+	auto * areaRightBottom = addDockWidget(ads::BottomDockWidgetArea, layerPalette, areaRight);
+	addDockWidget(ads::CenterDockWidgetArea, alignDistributePalette, areaRightBottom);
+	addDockWidget(ads::CenterDockWidgetArea, undoPalette, areaRightBottom);
+
+
+    // Top Panel
+//    auto * areaTop = addDockWidget(ads::TopDockWidgetArea, dockToolProperties);
+//    areaTop->setAllowedAreas(ads::NoDockWidgetArea);
+//    areaTop->setDockAreaFlag(ads::CDockAreaWidget::HideSingleWidgetTitleBar, true);
+
+	loadWorkspace();
+
+}
+
+//ScribusMainWindow *DockManager::ScMW()
+//{
+//	return (ScribusMainWindow*) parent();
+//}
+
+void DockManager::loadWorkspace()
+{
+	if(m_palettePrefs){
+		QByteArray ba = QByteArray::fromHex(m_palettePrefs->get("dockstate").toLatin1());
+		this->restoreState(ba);
+	}
+}
+
+void DockManager::saveWorkspace()
+{
+	if(m_palettePrefs){
+
+		QByteArray data = this->saveState();
+		QString s = data.toHex();
+		m_palettePrefs->set("dockstate", s);
+	}
+}
+
Index: scribus/manager/dock_manager.h
===================================================================
--- scribus/manager/dock_manager.h	(nicht existent)
+++ scribus/manager/dock_manager.h	(Arbeitskopie)
@@ -0,0 +1,77 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+#ifndef DOCK_MANAGER_H
+#define DOCK_MANAGER_H
+
+#include "prefscontext.h"
+#include "third_party/Qt-Advanced-Docking-System/src/DockManager.h"
+
+class ScribusMainWindow;
+class PagePalette;
+class OutlinePalette;
+class PropertiesPalette;
+class ContentPalette;
+class LayerPalette;
+class AlignDistributePalette;
+class InlinePalette;
+class Biblio;
+class BookPalette;
+class UndoPalette;
+class SymbolPalette;
+class DockCentralWidget;
+
+
+
+class DockManager : public ads::CDockManager
+{
+    Q_OBJECT
+
+public:
+	DockManager(QWidget *parent, QString theme = "" );
+
+ //   ads::CDockAreaWidget*  addDocument(DockDocumentBase * document);
+
+	void setCenter(QWidget * widget);
+	void setupDocks();
+    void loadDefaultWorkspace();
+
+	PagePalette *pagePalette {nullptr};
+	OutlinePalette * outlinePalette {nullptr};
+	PropertiesPalette * propertiesPalette {nullptr};
+	ContentPalette * contentPalette {nullptr};
+	LayerPalette * layerPalette {nullptr};
+	AlignDistributePalette * alignDistributePalette {nullptr};
+	InlinePalette * inlinePalette {nullptr};
+	Biblio * scrapbookPalette {nullptr};
+	BookPalette * bookPalette {nullptr};
+	UndoPalette * undoPalette {nullptr};
+	SymbolPalette * symbolPalette {nullptr};
+
+public slots:
+	void loadWorkspace();
+	void saveWorkspace();
+
+private:
+	DockCentralWidget * dockCenter;
+	PrefsContext* m_palettePrefs {nullptr};
+	QString m_context {"adsDockState"};
+
+};
+
+#endif // DOCK_MANAGER_H
Index: scribus/plugins/shapes/shapepalette.cpp
===================================================================
--- scribus/plugins/shapes/shapepalette.cpp	(Revision 25545)
+++ scribus/plugins/shapes/shapepalette.cpp	(Arbeitskopie)
@@ -278,7 +278,7 @@
 	}
 }
 
-ShapePalette::ShapePalette( QWidget* parent) : ScDockPalette(parent, "Shap", Qt::WindowFlags())
+ShapePalette::ShapePalette(QWidget *parent) : DockPanelBase("Shap", parent)
 {
 	setMinimumSize( QSize( 220, 240 ) );
 	setObjectName(QString::fromLocal8Bit("Shap"));
@@ -593,7 +593,7 @@
 		languageChange();
 	}
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void ShapePalette::iconSetChange()
Index: scribus/plugins/shapes/shapepalette.h
===================================================================
--- scribus/plugins/shapes/shapepalette.h	(Revision 25545)
+++ scribus/plugins/shapes/shapepalette.h	(Arbeitskopie)
@@ -40,7 +40,8 @@
 
 
 #include "pluginapi.h"
-#include "ui/scdockpalette.h"
+//#include "ui/scdockpalette.h"
+#include "ui/docks/dock_panelbase.h"
 #include "ui/sclistwidgetdelegate.h"
 #include "fpointarray.h"
 
@@ -85,12 +86,12 @@
 	ScListWidgetDelegate* delegate;
 };
 
-class PLUGIN_API ShapePalette : public ScDockPalette
+class PLUGIN_API ShapePalette : public DockPanelBase
 {
 	Q_OBJECT
 
 public:
-	ShapePalette(QWidget* parent);
+	ShapePalette(QWidget *parent);
 	~ShapePalette() {};
 
 	void writeToPrefs();
Index: scribus/plugins/shapes/shapeplugin.cpp
===================================================================
--- scribus/plugins/shapes/shapeplugin.cpp	(Revision 25545)
+++ scribus/plugins/shapes/shapeplugin.cpp	(Arbeitskopie)
@@ -74,8 +74,8 @@
 	m_actions.insert("shapeShowPalette", new ScrAction(QObject::tr("Custom Shapes"), QKeySequence(), this));
 	m_actions["shapeShowPalette"]->setToggleAction(true);
 	m_actions["shapeShowPalette"]->setChecked(false);
-	connect(m_actions["shapeShowPalette"], SIGNAL(toggled(bool)), sc_palette, SLOT(setPaletteShown(bool)));
-	connect(sc_palette, SIGNAL(paletteShown(bool)), m_actions["shapeShowPalette"], SLOT(setChecked(bool)));
+	connect(m_actions["shapeShowPalette"], SIGNAL(toggled(bool)), sc_palette, SLOT(toggleView(bool)));
+	connect(sc_palette, SIGNAL(viewToggled(bool)), m_actions["shapeShowPalette"], SLOT(setChecked(bool)));
 	mw->scrMenuMgr->addMenuItemStringAfter("shapeShowPalette", "toolsInline", "Windows");
 	mw->scrMenuMgr->addMenuItemStringsToMenuBar("Windows", m_actions);
 }
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(Revision 25545)
+++ scribus/scribus.cpp	(Arbeitskopie)
@@ -240,6 +240,7 @@
 #include "util.h"
 #include "util_file.h"
 #include "util_formats.h"
+#include "third_party/Qt-Advanced-Docking-System/src/IconProvider.h"
 
 #ifdef HAVE_SVNVERSION
 	#include "svnversion.h"
@@ -278,6 +279,7 @@
 	//ScQApp->setAttribute(Qt::AA_DontShowIconsInMenus);
 	//noIcon = IconManager::instance().loadPixmap("noicon.png");
 #endif
+
 }
 
 /*
@@ -285,6 +287,32 @@
  */
 int ScribusMainWindow::initScMW(bool primaryMainWindow)
 {
+	// Documentation: https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/blob/master/doc/user-guide.md
+	ads::CDockManager::setConfigFlag(ads::CDockManager::AlwaysShowTabs, false);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::FloatingContainerHasWidgetIcon, true);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::FloatingContainerHasWidgetTitle, true);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::HideSingleCentralWidgetTitleBar, false);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::OpaqueSplitterResize, true);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::TabCloseButtonIsToolButton, true);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::AllTabsHaveCloseButton, false);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaDynamicTabsMenuButtonVisibility, true);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHasCloseButton, false);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHasUndockButton, false);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHideDisabledButtons, true);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::FocusHighlighting, true);
+
+	// Documentation: https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/blob/master/doc/user-guide.md#auto-hide-configuration-flags
+//	ads::CDockManager::setAutoHideConfigFlags(ads::CDockManager::DefaultAutoHideConfig);
+//	ads::CDockManager::setAutoHideConfigFlag(ads::CDockManager::AutoHideShowOnMouseOver, true);
+//	ads::CDockManager::setAutoHideConfigFlag(ads::CDockManager::AutoHideCloseButtonCollapsesDock, true);
+//	ads::CDockManager::setAutoHideConfigFlag(ads::CDockManager::AutoHideButtonTogglesArea, true);
+
+	IconManager &iconmanager = IconManager::instance();
+	ads::CDockManager::iconProvider().registerCustomIcon(ads::TabCloseIcon, iconmanager.loadPixmap("close"));
+	ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaCloseIcon, iconmanager.loadPixmap("close"));
+	ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaMenuIcon, iconmanager.loadPixmap("menu-down"));
+	ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaUndockIcon, iconmanager.loadPixmap("dock-float"));
+
 	int retVal=0;
 	//qsrand(1234);
 	QByteArray stylesheet;
@@ -323,6 +351,7 @@
 	appModeHelper = new AppModeHelper();
 	appModeHelper->setup(actionManager, &scrActions, &scrRecentFileActions, &scrWindowsActions, &scrScrapActions, &scrLayersActions, &scrRecentPasteActions);
 	scrMenuMgr = new ScMWMenuManager(menuBar(), actionManager);
+	dockManager = new DockManager(this/*, QString(stylesheet)*/); // style sheet should be enabled when theme manager is implemented to handle color palettes in css file.
 	m_formatsManager = FormatsManager::instance();
 	m_objectSpecificUndo = false;
 
@@ -646,51 +675,74 @@
 {
 	//CB TODO hide the publicly available members of some palettes
 	// these must be filtered too as they take control of the palettes events
-	outlinePalette = new OutlinePalette(this);
+
+	dockManager->setupDocks();
+
+	// Outliner
+	outlinePalette = dockManager->outlinePalette;
 	outlinePalette->setMainWindow(this);
-	connect( scrActions["toolsOutline"], SIGNAL(toggled(bool)) , outlinePalette, SLOT(setPaletteShown(bool)));
-	connect( outlinePalette, SIGNAL(paletteShown(bool)), scrActions["toolsOutline"], SLOT(setChecked(bool)));
+	connect( scrActions["toolsOutline"], SIGNAL(toggled(bool)) , outlinePalette, SLOT(toggleView(bool)));
+	connect( outlinePalette, SIGNAL(viewToggled(bool)), scrActions["toolsOutline"], SLOT(setChecked(bool)));
 
-	propertiesPalette = new PropertiesPalette(this);
+	// Frame Properties
+	propertiesPalette = dockManager->propertiesPalette;
 	propertiesPalette->setMainWindow(this);
-	connect( scrActions["toolsProperties"], SIGNAL(toggled(bool)) , propertiesPalette, SLOT(setPaletteShown(bool)));
-	connect( propertiesPalette, SIGNAL(paletteShown(bool)), scrActions["toolsProperties"], SLOT(setChecked(bool)));
+	connect( scrActions["toolsProperties"], SIGNAL(toggled(bool)) , propertiesPalette, SLOT(toggleView(bool)));
+	connect( propertiesPalette, SIGNAL(viewToggled(bool)), scrActions["toolsProperties"], SLOT(setChecked(bool)));
 	emit UpdateRequest(reqDefFontListUpdate);
 	propertiesPalette->installEventFilter(this);
 
-	contentPalette = new ContentPalette(this);
+	// Content Properties
+	contentPalette = dockManager->contentPalette;
 	contentPalette->setMainWindow(this);
-	connect( scrActions["toolsContent"], &QAction::toggled, contentPalette, &ContentPalette::setPaletteShown);
-	connect( contentPalette, &ContentPalette::paletteShown, scrActions["toolsContent"], &QAction::setChecked);
+	connect( scrActions["toolsContent"], SIGNAL(toggled(bool)), contentPalette, SLOT(toggleView(bool)));
+	connect( contentPalette, SIGNAL(viewToggled(bool)), scrActions["toolsContent"], SLOT(setChecked(bool)));
 	contentPalette->installEventFilter(this);
 
+	// Nodes
 	nodePalette = new NodePalette(this);
 	nodePalette->installEventFilter(this);
-	layerPalette = new LayerPalette(this);
+
+	// Guides
 	guidePalette = new GuideManager(this);
+
+	// Character Selection
 	charPalette = new CharSelect(this);
-	connect( scrActions["toolsLayers"], SIGNAL(toggled(bool)) , layerPalette, SLOT(setPaletteShown(bool)));
-	connect( layerPalette, SIGNAL(paletteShown(bool)), scrActions["toolsLayers"], SLOT(setChecked(bool)));
+
+	// Layer
+	layerPalette = dockManager->layerPalette;
+	connect( scrActions["toolsLayers"], SIGNAL(toggled(bool)) , layerPalette, SLOT(toggleView(bool)));
+	connect( layerPalette, SIGNAL(viewToggled(bool)), scrActions["toolsLayers"], SLOT(setChecked(bool)));
 	layerPalette->installEventFilter(this);
-	scrapbookPalette = new Biblio(this);
-	connect( scrActions["toolsScrapbook"], SIGNAL(toggled(bool)) , scrapbookPalette, SLOT(setPaletteShown(bool)));
-	connect( scrapbookPalette, SIGNAL(paletteShown(bool)), scrActions["toolsScrapbook"], SLOT(setChecked(bool)));
+
+	// Scrapbook
+	scrapbookPalette = dockManager->scrapbookPalette;
+	connect( scrActions["toolsScrapbook"], SIGNAL(toggled(bool)) , scrapbookPalette, SLOT(toggleView(bool)));
+	connect( scrapbookPalette, SIGNAL(viewToggled(bool)), scrActions["toolsScrapbook"], SLOT(setChecked(bool)));
 	connect( scrapbookPalette, SIGNAL(pasteToActualPage(QString)), this, SLOT(pasteFromScrapbook(QString)));
 	connect( scrapbookPalette, SIGNAL(scrapbookListChanged()), this, SLOT(rebuildScrapbookMenu()));
 	scrapbookPalette->installEventFilter(this);
-	pagePalette = new PagePalette(this);
-	connect( scrActions["toolsPages"], SIGNAL(toggled(bool)) , pagePalette, SLOT(setPaletteShown(bool)) );
-	connect( pagePalette, SIGNAL(paletteShown(bool)), scrActions["toolsPages"], SLOT(setChecked(bool)));
+
+	// Pages
+	pagePalette = dockManager->pagePalette;
+	connect( scrActions["toolsPages"], SIGNAL(toggled(bool)) , pagePalette, SLOT(toggleView(bool)) );
+	connect( pagePalette, SIGNAL(viewToggled(bool)), scrActions["toolsPages"], SLOT(setChecked(bool)));
 	pagePalette->installEventFilter(this);
-	bookmarkPalette = new BookPalette(this);
-	connect( scrActions["toolsBookmarks"], SIGNAL(toggled(bool)) , bookmarkPalette, SLOT(setPaletteShown(bool)) );
-	connect( bookmarkPalette, SIGNAL(paletteShown(bool)), scrActions["toolsBookmarks"], SLOT(setChecked(bool)));
+
+	// Bookmark
+	bookmarkPalette = dockManager->bookPalette;
+	connect( scrActions["toolsBookmarks"], SIGNAL(toggled(bool)) , bookmarkPalette, SLOT(toggleView(bool)) );
+	connect( bookmarkPalette, SIGNAL(viewToggled(bool)), scrActions["toolsBookmarks"], SLOT(setChecked(bool)));
 	bookmarkPalette->installEventFilter(this);
+
+	// Downloads
 	downloadsPalette = new DownloadsPalette(this);
 	connect( scrActions["toolsDownloads"], SIGNAL(toggled(bool)) , downloadsPalette, SLOT(setPaletteShown(bool)) );
 	connect( downloadsPalette, SIGNAL(paletteShown(bool)), scrActions["toolsDownloads"], SLOT(setChecked(bool)));
 	downloadsPalette->installEventFilter(this);
 	connect( scrActions["toolsMeasurements"], SIGNAL(toggledData(bool,int)) , this, SLOT(setAppModeByToggle(bool,int)) );
+
+	// Preflight
 	docCheckerPalette = new CheckDocument(this, false);
 	connect( scrActions["toolsPreflightVerifier"], SIGNAL(toggled(bool)) , docCheckerPalette, SLOT(setPaletteShown(bool)) );
 	connect( scrActions["toolsPreflightVerifier"], SIGNAL(toggled(bool)) , this, SLOT(docCheckToggle(bool)) );
@@ -699,26 +751,29 @@
 	docCheckerPalette->installEventFilter(this);
 	docCheckerPalette->hide();
 
-	alignDistributePalette = new AlignDistributePalette(this, "AlignDistributePalette");
-	connect( scrActions["toolsAlignDistribute"], SIGNAL(toggled(bool)) , alignDistributePalette, SLOT(setPaletteShown(bool)) );
-	connect( alignDistributePalette, SIGNAL(paletteShown(bool)), scrActions["toolsAlignDistribute"], SLOT(setChecked(bool)));
+	// Align & Distribute
+	alignDistributePalette = dockManager->alignDistributePalette;
+	connect( scrActions["toolsAlignDistribute"], SIGNAL(toggled(bool)) , alignDistributePalette, SLOT(toggleView(bool)) );
+	connect( alignDistributePalette, SIGNAL(viewToggled(bool)), scrActions["toolsAlignDistribute"], SLOT(setChecked(bool)));
 	connect( alignDistributePalette, SIGNAL(documentChanged()), this, SLOT(slotDocCh()));
 	alignDistributePalette->installEventFilter(this);
 
-	symbolPalette = new SymbolPalette(this);
+	// Symbols
+	symbolPalette = dockManager->symbolPalette;
 	symbolPalette->setMainWindow(this);
-	connect(scrActions["toolsSymbols"], SIGNAL(toggled(bool)), symbolPalette, SLOT(setPaletteShown(bool)));
-	connect(symbolPalette, SIGNAL(paletteShown(bool)), scrActions["toolsSymbols"], SLOT(setChecked(bool)));
+	connect(scrActions["toolsSymbols"], SIGNAL(toggled(bool)), symbolPalette, SLOT(toggleView(bool)) );
+	connect(symbolPalette, SIGNAL(viewToggled(bool)), scrActions["toolsSymbols"], SLOT(setChecked(bool)));
 	connect(symbolPalette, SIGNAL(startEdit(QString)), this, SLOT(editSymbolStart(QString)));
 	connect(symbolPalette, SIGNAL(endEdit()), this, SLOT(editSymbolEnd()));
 	connect(symbolPalette, SIGNAL(objectDropped()), this, SLOT(PutToPatterns()));
 	symbolPalette->installEventFilter(this);
-	symbolPalette->hide();
+//	symbolPalette->hide();
 
-	inlinePalette = new InlinePalette(this);
+	// Inline Elements
+	inlinePalette = dockManager->inlinePalette;
 	inlinePalette->setMainWindow(this);
-	connect(scrActions["toolsInline"], SIGNAL(toggled(bool)), inlinePalette, SLOT(setPaletteShown(bool)));
-	connect(inlinePalette, SIGNAL(paletteShown(bool)), scrActions["toolsInline"], SLOT(setChecked(bool)));
+	connect(scrActions["toolsInline"], SIGNAL(toggled(bool)), inlinePalette, SLOT(toggleView(bool)) );
+	connect(inlinePalette, SIGNAL(viewToggled(bool)), scrActions["toolsInline"], SLOT(setChecked(bool)));
 	connect(inlinePalette, SIGNAL(startEdit(int)), this, SLOT(editInlineStart(int)));
 	connect(inlinePalette, SIGNAL(endEdit()), this, SLOT(editInlineEnd()));
 	connect(inlinePalette, SIGNAL(objectDropped(QString)), this, SLOT(PutToInline(QString)));
@@ -725,10 +780,11 @@
 	inlinePalette->installEventFilter(this);
 	inlinePalette->hide();
 
-	undoPalette = new UndoPalette(this, "undoPalette");
+	// Undo
+	undoPalette = dockManager->undoPalette;
 	undoPalette->installEventFilter(this);
 	m_undoManager->registerGui(undoPalette);
-	connect(undoPalette, SIGNAL(paletteShown(bool)), this, SLOT(setUndoPalette(bool)));
+	connect(undoPalette, SIGNAL(viewToggled(bool)), this, SLOT(setUndoPalette(bool)));
 	connect(undoPalette, SIGNAL(objectMode(bool)), this, SLOT(setUndoMode(bool)));
 
 	// initializing style manager here too even it's not strictly a palette
@@ -749,6 +805,8 @@
 	connect( marksManager, SIGNAL(paletteShown(bool)), scrActions["editMarks"], SLOT(setChecked(bool)));
 	marksManager->installEventFilter(this);
 	// initializing notes styles manager
+
+	// Note Styles
 	nsEditor = new NotesStylesEditor(this, "notesStylesEditor");
 	connect( scrActions["editNotesStyles"], SIGNAL(toggled(bool)), nsEditor, SLOT(setPaletteShown(bool)) );
 	connect( nsEditor, SIGNAL(paletteShown(bool)), scrActions["editNotesStyles"], SLOT(setChecked(bool)));
@@ -775,6 +833,9 @@
 	// char palette
 	connect(scrActions["insertGlyph"], SIGNAL(toggled(bool)), charPalette, SLOT(setPaletteShown(bool)));
 	connect(charPalette, SIGNAL(paletteShown(bool)), scrActions["insertGlyph"], SLOT(setChecked(bool)));
+
+	dockManager->loadDefaultWorkspace();
+
 }
 
 
@@ -831,7 +892,8 @@
 	}
 	else
 		mdiArea->setViewMode(QMdiArea::SubWindowView);
-	setCentralWidget(mdiArea);
+	//setCentralWidget(mdiArea);
+	dockManager->setCenter(mdiArea);
 }
 
 void ScribusMainWindow::initMenuBar()
@@ -1782,6 +1844,9 @@
 		return;
 	}
 
+	// Save GUI state
+	dockManager->saveWorkspace();
+
 	disconnect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(newActWin(QMdiSubWindow*)));
 
 	QList<QMdiSubWindow *> windows = mdiArea->subWindowList();
@@ -5445,7 +5518,7 @@
 
 void ScribusMainWindow::setUndoPalette(bool visible)
 {
-	undoPalette->setPaletteShown(visible);
+	undoPalette->toggleView(visible);
 	scrActions["toolsActionHistory"]->setChecked(visible);
 }
 
Index: scribus/scribus.h
===================================================================
--- scribus/scribus.h	(Revision 25545)
+++ scribus/scribus.h	(Arbeitskopie)
@@ -56,6 +56,7 @@
 // application specific includes
 #include "scribusapi.h"
 #include "scribusdoc.h"
+#include "manager/dock_manager.h"
 #include "styleoptions.h"
 #include "ui/customfdialog.h"
 #include "ui/scmessagebox.h"
@@ -69,6 +70,7 @@
 class CharSelect;
 class CheckDocument;
 class ColorCombo;
+class DockManager;
 class DownloadsPalette;
 class EditToolBar;
 class FileToolBar;
@@ -218,6 +220,7 @@
 	/** \brief private doc for managing default patterns. */
 	ScribusDoc* m_doc {nullptr};
 
+	DockManager * dockManager {nullptr};
 
 	QProgressBar* mainWindowProgressBar {nullptr};
 	ScrSpinBox* zoomSpinBox {nullptr}; //zoom spinbox at bottom of view
Index: scribus/scribusindigomainwindow.cpp
===================================================================
--- scribus/scribusindigomainwindow.cpp	(Revision 25545)
+++ scribus/scribusindigomainwindow.cpp	(Arbeitskopie)
@@ -11,6 +11,9 @@
 #include "third_party/Qt-Advanced-Docking-System/src/DockManager.h"
 #include "third_party/Qt-Advanced-Docking-System/src/IconProvider.h"
 
+#include "iconmanager.h"
+#include "manager/dock_manager.h"
+
 ScribusIndigoMainWindow::ScribusIndigoMainWindow(QWidget *parent)
 	: QMainWindow{parent}
 	{
@@ -17,26 +20,26 @@
 
 	// Documentation:
 	// https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/blob/master/doc/user-guide.md
-//	ads::CDockManager::setConfigFlag(ads::CDockManager::AlwaysShowTabs, false);
-//	ads::CDockManager::setConfigFlag(ads::CDockManager::FloatingContainerHasWidgetIcon, true);
-//	ads::CDockManager::setConfigFlag(ads::CDockManager::FloatingContainerHasWidgetTitle, true);
-//	ads::CDockManager::setConfigFlag(ads::CDockManager::HideSingleCentralWidgetTitleBar, false);
-//	ads::CDockManager::setConfigFlag(ads::CDockManager::OpaqueSplitterResize, true);
-//	ads::CDockManager::setConfigFlag(ads::CDockManager::TabCloseButtonIsToolButton, true);
-//	ads::CDockManager::setConfigFlag(ads::CDockManager::AllTabsHaveCloseButton, false);
-//	ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaDynamicTabsMenuButtonVisibility, true);
-//	ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHasCloseButton, false);
-//	ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHasUndockButton, false);
-//	ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHideDisabledButtons, true);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::AlwaysShowTabs, false);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::FloatingContainerHasWidgetIcon, true);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::FloatingContainerHasWidgetTitle, true);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::HideSingleCentralWidgetTitleBar, false);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::OpaqueSplitterResize, true);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::TabCloseButtonIsToolButton, true);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::AllTabsHaveCloseButton, false);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaDynamicTabsMenuButtonVisibility, true);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHasCloseButton, false);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHasUndockButton, false);
+	ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHideDisabledButtons, true);
 
-	//		ads::CDockManager::iconProvider().registerCustomIcon(ads::TabCloseIcon,
-	//IconManager::instance().icon("close"));
-	//		ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaCloseIcon,
-	//IconManager::instance().icon("close"));
-	//		ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaMenuIcon,
-	//IconManager::instance().icon("menu-down"));
-	//		ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaUndockIcon,
-	//IconManager::instance().icon("dock-float"));
+//	ads::CDockManager::iconProvider().registerCustomIcon(ads::TabCloseIcon, IconManager::instance().loadIcon("close"));
+//	ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaCloseIcon, IconManager::instance().loadIcon("close"));
+//	ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaMenuIcon, IconManager::instance().loadIcon("menu-down"));
+//	ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaUndockIcon, IconManager::instance().loadIcon("dock-float"));
+
+	dockManager = new DockManager(this);
+
+
 	}
 
 
Index: scribus/scribusindigomainwindow.h
===================================================================
--- scribus/scribusindigomainwindow.h	(Revision 25545)
+++ scribus/scribusindigomainwindow.h	(Arbeitskopie)
@@ -5,6 +5,8 @@
 
 #include "scribusapi.h"
 
+class DockManager;
+
 class SCRIBUS_API ScribusIndigoMainWindow : public QMainWindow
 	{
 		Q_OBJECT
@@ -16,9 +18,9 @@
 	signals:
 	private:
 
+	DockManager *dockManager;
 
 
-
 	};
 
 #endif // SCRIBUSINDIGOMAINWINDOW_H
Index: scribus/third_party/Qt-Advanced-Docking-System/CMakeLists.txt
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/CMakeLists.txt	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/CMakeLists.txt	(Arbeitskopie)
@@ -1,5 +1,5 @@
 ###<< Scribus
-set(ADS_VERSION "4.0.3")
+set(ADS_VERSION "4.0.4")
 ###>> Scribus
 cmake_minimum_required(VERSION 3.5)
 
Index: scribus/third_party/Qt-Advanced-Docking-System/README.md
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/README.md	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/README.md	(Arbeitskopie)
@@ -119,6 +119,8 @@
   - [RDE – Robox Development Environment](#rde--robox-development-environment)
   - [ResInsight](#resinsight)
   - [ADTF 3](#adtf-3)
+  - [DREAM.3D NX](#dream3d-nx)
+  - [LabPlot](#labplot)
 - [Alternative Docking System Implementations](#alternative-docking-system-implementations)
   - [KDDockWidgets](#kddockwidgets)
   - [QtitanDocking](#qtitandocking)
@@ -254,7 +256,7 @@
 
 - [mborgerson](https://github.com/mborgerson)
 
-For more information about the PySide6 bindings read [this](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/298) issue.
+Please file PySide6-QtAds-specific issues on its [pyside6_qtads](https://github.com/mborgerson/pyside6_qtads) fork for tracking. For more information about the PySide6 bindings read [this](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/298) issue.
 
 ### PyQt5
 
@@ -318,7 +320,9 @@
 ## Build
 
 The Linux build requires private header files. Make sure that they are installed.
-The library uses SVG icons, so ensure that Qt SVG support is installed.
+The library uses SVG icons, so ensure that Qt SVG support is installed. The demo
+application creates a `QQuickWidget` for testing, so ensure that the required
+libraries are installed.
 
 ### Qt5 on Ubuntu 18.04 or 20.04
 
@@ -329,13 +333,13 @@
 ### Qt5 on Ubuntu 22.04
 
 ```bash
-sudo apt install qtbase5-dev qtbase5-private-dev qtbase5-dev-tools libqt5svg5
+sudo apt install qtbase5-dev qtbase5-private-dev qtbase5-dev-tools libqt5svg5 libqt5qml5 qtdeclarative5-dev
 ```
 
 ### Qt6 on Ubuntu 22.04
 
 ```bash
-sudo apt install qt6-base-dev qt6-base-private-dev qt6-tools-dev libqt6svg6
+sudo apt install qt6-default qt6-base-dev qt6-base-private-dev qt6-tools-dev libqt6svg6 qt6-qtdeclarative
 ```
 
 Open the `ads.pro` file with QtCreator and start the build, that's it.
@@ -593,6 +597,26 @@
 
 ![ADTF](doc/showcase_adtf.png)
 
+### [DREAM.3D NX](https://github.com/BlueQuartzSoftware/DREAM3D)
+
+DREAM.3D *(Digital Representation Environment for Analysis of Materials in 3D)* is an open source, cross-platform and modular, software suite that allows users to prepare, reconstruct, quantify, instantiate, and mesh, multidimensional, multimodal microstructural data, as well as many other applications.
+
+[BlueQuartz Software](http://www.bluequartz.net/) is currently completely rewriting the DREAM.3D application. For the upcoming version **[DREAM3D NX](http://www.dream3d.io/)** they improved the UI by using the Advanced Docking System. An [early version](http://www.dream3d.io/) of **DREAM3D NX** with ADS is already available to any user who would like to take the brand new version out for a spin.
+
+![DREAM.3D NX](doc/showcase_dream3d_nx.png)
+
+[read more...](http://dream3d.bluequartz.net/)
+
+### [LabPlot](https://labplot.kde.org/)
+
+KDE LabPlot is the ultimate free, open source and cross-platform tool for scientists, engineers, and students who need to analyze and visualize data. With its intuitive interface and powerful features, you can create stunning plots and diagrams with ease. Whether you're working with CSV, FITS, or HDF5 data, KDE LabPlot makes it simple to import and analyze your data.
+
+The LabPlot project recently switched to the Qt Advanced Docking System for their user interface. This switch represents a significant improvement to the LabPlot software, allowing users to create and manage complex data visualization layouts with ease.
+
+![LabPlot](doc/showcase_labplot.png)
+
+[read more...](https://labplot.kde.org/)
+
 ## Alternative Docking System Implementations
 
 If this Qt Advanced Docking System does not fit to your needs you may consider some of the alternative docking system solutions for Qt.
@@ -599,7 +623,7 @@
 
 ### KDDockWidgets
 
-This is an advanced docking framework for Qt from [KDAB](https://www.kdab.com/). The interesting thing is, that they separated GUI code from logic, so they can easily provide a QtQuick backend in the future. 
+This is an advanced docking framework for Qt from [KDAB](https://www.kdab.com/). The interesting thing is, that they separated GUI code from logic, so they can easily provide a QtQuick backend in the future.
 
 - [Blog post about KDDockWidgets](https://www.kdab.com/kddockwidgets/)
 - [GitHub project](https://github.com/KDAB/KDDockWidgets)
Index: scribus/third_party/Qt-Advanced-Docking-System/doc/user-guide.md
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/doc/user-guide.md	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/doc/user-guide.md	(Arbeitskopie)
@@ -39,6 +39,7 @@
   - [`AutoHideButtonCheckable`](#autohidebuttoncheckable)
   - [`AutoHideSideBarsIconOnly`](#autohidesidebarsicononly)
   - [`AutoHideShowOnMouseOver`](#autohideshowonmouseover)
+  - [`AutoHideCloseButtonCollapsesDock`](#autohideclosebuttoncollapsesdock)
 - [DockWidget Feature Flags](#dockwidget-feature-flags)
   - [`DockWidgetClosable`](#dockwidgetclosable)
   - [`DockWidgetMovable`](#dockwidgetmovable)
@@ -589,6 +590,21 @@
 mouse outside of the Auto-Hide widget. Showing and hiding my mouse click still
 works if this feature is enabled.
 
+### `AutoHideCloseButtonCollapsesDock`
+
+Some users don't understand the distinction between closing an auto hide dock and
+collapsing an auto hide dock. This may lead to situations where they press the
+close button (losing the side tab widget) instead of simply clicking outside
+the auto hide dock (collapsing the dock). 
+
+![AutoHideCloseButtonCollapsesDock false](cfg_flag_AutoHideCloseButtonCollapsesDock_false.gif)
+
+If `AutoHideCloseButtonCollapsesDock` option is active, the
+close button in an auto hide widget collapses the auto hide widget instead of
+closing it.
+
+![AutoHideCloseButtonCollapsesDock true](cfg_flag_AutoHideCloseButtonCollapsesDock_true.gif)
+
 ## DockWidget Feature Flags
 
 ### `DockWidgetClosable`
Index: scribus/third_party/Qt-Advanced-Docking-System/pyproject.toml
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/pyproject.toml	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/pyproject.toml	(Arbeitskopie)
@@ -71,5 +71,5 @@
 	"src/PushButton.cpp",
 	"src/ResizeHandle.cpp",
 	"src/ads_globals.cpp",
-	"src/linux/FloatingWidgetTitleBar.h; platform_system == 'Linux'",
+	"src/linux/FloatingWidgetTitleBar.cpp; platform_system == 'Linux'",
 ]
Index: scribus/third_party/Qt-Advanced-Docking-System/sip/AutoHideSideBar.sip
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/sip/AutoHideSideBar.sip	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/sip/AutoHideSideBar.sip	(Arbeitskopie)
@@ -28,6 +28,8 @@
 	Qt::Orientation orientation() const;
 	ads::CAutoHideTab* tabAt(int index) const;
 	int tabCount() const;
+    int visibleTabCount() const;
+    bool hasVisibleTabs() const;
 	ads::SideBarLocation sideBarLocation() const;
 	virtual QSize minimumSizeHint() const;
 	virtual QSize sizeHint() const;
Index: scribus/third_party/Qt-Advanced-Docking-System/sip/DockFocusController.sip
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/sip/DockFocusController.sip	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/sip/DockFocusController.sip	(Arbeitskopie)
@@ -23,6 +23,7 @@
     ads::CDockWidget* focusedDockWidget() const;
     void setDockWidgetTabFocused(ads::CDockWidgetTab* Tab);
     void clearDockWidgetFocus(ads::CDockWidget* dockWidget);
+    void setDockWidgetTabPressed(bool Value);
 
 public slots:
 	void setDockWidgetFocused(ads::CDockWidget* focusedNow);
Index: scribus/third_party/Qt-Advanced-Docking-System/sip/DockManager.sip
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/sip/DockManager.sip	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/sip/DockManager.sip	(Arbeitskopie)
@@ -188,6 +188,7 @@
 		AutoHideSideBarsIconOnly,
 		AutoHideShowOnMouseOver,
 		DefaultAutoHideConfig,
+        AutoHideCloseButtonCollapsesDock,
 	};
     typedef QFlags<ads::CDockManager::eAutoHideFlag> AutoHideFlags;
 
@@ -237,6 +238,7 @@
 	QMenu* viewMenu() const;
 	void setViewMenuInsertionOrder(ads::CDockManager::eViewMenuInsertionOrder Order);
 	bool isRestoringState() const;
+    bool isLeavingMinimizedState() const;
 	static int startDragDistance();
     ads::CDockWidget* focusedDockWidget() const;
     QList<int> splitterSizes(ads::CDockAreaWidget *ContainedArea) const;
@@ -245,6 +247,7 @@
 	static QString floatingContainersTitle();
 
 public slots:
+    void endLeavingMinimizedState();
 	void openPerspective(const QString& PerspectiveName);
     void setDockWidgetFocused(ads::CDockWidget* DockWidget);
 
Index: scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidget.sip
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidget.sip	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidget.sip	(Arbeitskopie)
@@ -60,7 +60,9 @@
     enum eMinimumSizeHintMode
     {
     	MinimumSizeHintFromDockWidget,
-    	MinimumSizeHintFromContent
+    	MinimumSizeHintFromContent,
+        MinimumSizeHintFromDockWidgetMinimumSize,
+    	MinimumSizeHintFromContentMinimumSize,
     };
 
 	enum eToggleViewActionMode
@@ -94,6 +96,7 @@
 	QAction* toggleViewAction() const;
 	void setToggleViewActionMode(ads::CDockWidget::eToggleViewActionMode Mode);
 	void setMinimumSizeHintMode(ads::CDockWidget::eMinimumSizeHintMode Mode);
+    ads::CDockWidget::eMinimumSizeHintMode minimumSizeHintMode() const;
     bool isCentralWidget() const;
 	void setIcon(const QIcon& Icon);
 	QIcon icon() const;
Index: scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidgetTab.sip
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidgetTab.sip	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidgetTab.sip	(Arbeitskopie)
@@ -37,6 +37,7 @@
     void updateStyle();
     QSize iconSize() const;
     void setIconSize(const QSize& Size);
+    bool mousePressed() const;
 
 public slots:
 	virtual void setVisible(bool visible);
Index: scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.cpp	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.cpp	(Arbeitskopie)
@@ -127,27 +127,6 @@
 		}
 		break;
 
-	case QEvent::Resize:
-		if (_this->tabCount())
-		{
-			auto ev = static_cast<QResizeEvent*>(e);
-			auto Tab = _this->tabAt(0);
-			int Size = isHorizontal() ? ev->size().height() : ev->size().width();
-			int TabSize = isHorizontal() ? Tab->size().height() : Tab->size().width();
-			// If the size of the side bar is less than the size of the first tab
-			// then there are no visible tabs in this side bar. This check will
-			// fail if someone will force a very big border via CSS!!
-			if (Size < TabSize)
-			{
-				_this->hide();
-			}
-		}
-		else
-		{
-			_this->hide();
-		}
-		break;
-
 	default:
 		break;
 	}
@@ -288,20 +267,33 @@
 //============================================================================
 bool CAutoHideSideBar::eventFilter(QObject *watched, QEvent *event)
 {
-	if (event->type() != QEvent::ShowToParent)
+	auto Tab = qobject_cast<CAutoHideTab*>(watched);
+	if (!Tab)
 	{
 		return false;
 	}
 
-	// As soon as on tab is shown, we need to show the side tab bar
-	auto Tab = qobject_cast<CAutoHideTab*>(watched);
-	if (Tab)
+	switch (event->type())
 	{
-		show();
+	case QEvent::ShowToParent:
+		 show();
+	     break;
+
+	case QEvent::HideToParent:
+		 if (!hasVisibleTabs())
+		 {
+			 hide();
+		 }
+		 break;
+
+	default:
+		break;
 	}
+
 	return false;
 }
 
+
 //============================================================================
 Qt::Orientation CAutoHideSideBar::orientation() const
 {
@@ -324,6 +316,39 @@
 
 
 //============================================================================
+int CAutoHideSideBar::visibleTabCount() const
+{
+	int count = 0;
+	auto ParentWidget = parentWidget();
+	for (auto i = 0; i < tabCount(); i++)
+	{
+		if (tabAt(i)->isVisibleTo(ParentWidget))
+		{
+			count++;
+		}
+	}
+
+	return count;
+}
+
+
+//============================================================================
+bool CAutoHideSideBar::hasVisibleTabs() const
+{
+	auto ParentWidget = parentWidget();
+	for (auto i = 0; i < tabCount(); i++)
+	{
+		if (tabAt(i)->isVisibleTo(ParentWidget))
+		{
+			return true;
+		}
+	}
+
+	return false;
+}
+
+
+//============================================================================
 SideBarLocation CAutoHideSideBar::sideBarLocation() const
 {
 	return d->SideTabArea;
Index: scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.h	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.h	(Arbeitskopie)
@@ -135,6 +135,19 @@
 	int tabCount() const;
 
 	/**
+	 * Returns the number of visible tabs to its parent widget.
+	 */
+	int visibleTabCount() const;
+
+	/**
+	 * Returns true, if the sidebar contains visible tabs to its parent widget.
+	 * The function returns as soon as it finds the first visible tab.
+	 * That means, if you just want to find out if there are visible tabs
+	 * then this function is quicker than visibleTabCount()
+	 */
+	bool hasVisibleTabs() const;
+
+	/**
 	 * Getter for side tab bar area property
 	 */
 	SideBarLocation sideBarLocation() const;
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTabBar.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTabBar.cpp	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTabBar.cpp	(Arbeitskopie)
@@ -36,6 +36,7 @@
 #include <QBoxLayout>
 #include <QApplication>
 #include <QtGlobal>
+#include <QTimer>
 
 #include "FloatingDockContainer.h"
 #include "DockAreaWidget.h"
@@ -107,7 +108,12 @@
 		{
 			TabWidget->show();
 			TabWidget->setActiveTab(true);
-			_this->ensureWidgetVisible(TabWidget);
+			// Sometimes the synchronous calculation of the rectangular area fails
+			// Therefore we use QTimer::singleShot here to execute the call
+			// within the event loop - see #520
+			QTimer::singleShot(0, [&, TabWidget]{
+			    _this->ensureWidgetVisible(TabWidget);
+			});
 		}
 		else
 		{
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTitleBar.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTitleBar.cpp	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTitleBar.cpp	(Arbeitskopie)
@@ -415,8 +415,13 @@
 void CDockAreaTitleBar::onCloseButtonClicked()
 {
     ADS_PRINT("CDockAreaTitleBar::onCloseButtonClicked");
-	if (d->testConfigFlag(CDockManager::DockAreaCloseButtonClosesTab))
+	if (CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideCloseButtonCollapsesDock) &&
+		d->DockArea->autoHideDockContainer())
 	{
+		d->DockArea->autoHideDockContainer()->collapseView(true);
+	}
+	else if (d->testConfigFlag(CDockManager::DockAreaCloseButtonClosesTab))
+	{
 		d->TabBar->closeTab(d->TabBar->currentIndex());
 	}
 	else
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.cpp	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.cpp	(Arbeitskopie)
@@ -140,6 +140,7 @@
 			{
 				LayoutItem->widget()->setParent(nullptr);
 			}
+			delete LayoutItem;
 			m_CurrentWidget = nullptr;
 			m_CurrentIndex = -1;
 		}
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.cpp	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.cpp	(Arbeitskopie)
@@ -27,7 +27,7 @@
 #include "DockManager.h"
 #include "DockAreaTitleBar.h"
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include "linux/FloatingWidgetTitleBar.h"
 #endif
 
@@ -44,11 +44,12 @@
 	QPointer<CDockWidget> FocusedDockWidget = nullptr;
 	QPointer<CDockAreaWidget> FocusedArea = nullptr;
 	QPointer<CDockWidget> OldFocusedDockWidget = nullptr;
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
      QPointer<CFloatingDockContainer> FloatingWidget = nullptr;
 #endif
 	CDockManager* DockManager;
     bool ForceFocusChangedSignal = false;
+    bool TabPressed = false;
 
 	/**
 	 * Private data constructor
@@ -84,7 +85,7 @@
 
 
 //===========================================================================
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 static void updateFloatingWidgetFocusStyle(CFloatingDockContainer* FloatingWidget, bool Focused)
 {
 	if (FloatingWidget->hasNativeTitleBar())
@@ -168,7 +169,7 @@
     }
 
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	// This code is required for styling the floating widget titlebar for linux
 	// depending on the current focus state
 	if (FloatingWidget != NewFloatingWidget)
@@ -267,7 +268,9 @@
 {
     Q_UNUSED(focusedOld);
 
-	if (d->DockManager->isRestoringState())
+    // Ignore focus changes if we are restoring state, or if user clicked
+    // a tab wich in turn caused the focus change
+	if (d->DockManager->isRestoringState() || d->TabPressed)
 	{
 		return;
 	}
@@ -285,7 +288,7 @@
 		DockWidget = internal::findParent<CDockWidget*>(focusedNow);
 	}
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     if (!DockWidget)
 	{
 		return;
@@ -418,6 +421,12 @@
 	return d->FocusedDockWidget.data();
 }
 
+
+//==========================================================================
+void CDockFocusController::setDockWidgetTabPressed(bool Value)
+{
+	d->TabPressed = Value;
+}
 } // namespace ads
 
 //---------------------------------------------------------------------------
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.h	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.h	(Arbeitskopie)
@@ -80,6 +80,12 @@
 	 */
 	void clearDockWidgetFocus(CDockWidget* dockWidget);
 
+	/**
+	 * Notifies the dock focus controller, that a the mouse is pressed or
+	 * released
+	 */
+	void setDockWidgetTabPressed(bool Value);
+
 public Q_SLOTS:
 	/**
 	 * Request a focus change to the given dock widget
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.cpp	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.cpp	(Arbeitskopie)
@@ -47,6 +47,7 @@
 #include <QMenu>
 #include <QApplication>
 #include <QWindow>
+#include <QWindowStateChangeEvent>
 
 #include "FloatingDockContainer.h"
 #include "DockOverlay.h"
@@ -59,7 +60,7 @@
 #include "DockFocusController.h"
 #include "DockSplitter.h"
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include "linux/FloatingWidgetTitleBar.h"
 #endif
 
@@ -116,6 +117,7 @@
 	QVector<CFloatingDockContainer*> UninitializedFloatingWidgets;
 	CDockFocusController* FocusController = nullptr;
     CDockWidget* CentralWidget = nullptr;
+    bool IsLeavingMinimized = false;
 
 	/**
 	 * Private data constructor
@@ -192,7 +194,7 @@
 	QString FileName = ":ads/stylesheets/";
 	FileName += CDockManager::testConfigFlag(CDockManager::FocusHighlighting)
 		? "focus_highlighting" : "default";
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     FileName += "_linux";
 #endif
     FileName += ".css";
@@ -510,9 +512,10 @@
 		d->FocusController = new CDockFocusController(this);
 	}
 
-#ifdef Q_OS_LINUX
+
 	window()->installEventFilter(this);
 
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     connect(qApp, &QApplication::focusWindowChanged, [](QWindow* focusWindow)
     {
         // bring modal dialogs to foreground to ensure that they are in front of any
@@ -552,7 +555,7 @@
 }
 
 //============================================================================
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 bool CDockManager::eventFilter(QObject *obj, QEvent *e)
 {
 	// Emulate Qt:Tool behaviour.
@@ -629,9 +632,40 @@
 	}
 	return Super::eventFilter(obj, e);
 }
+#else
+//============================================================================
+bool CDockManager::eventFilter(QObject *obj, QEvent *e)
+{
+	if (e->type() == QEvent::WindowStateChange)
+	{
+		QWindowStateChangeEvent* ev = static_cast<QWindowStateChangeEvent*>(e);
+		if (ev->oldState().testFlag(Qt::WindowMinimized))
+		{
+			d->IsLeavingMinimized = true;
+			QMetaObject::invokeMethod(this, "endLeavingMinimizedState", Qt::QueuedConnection);
+		}
+	}
+	return Super::eventFilter(obj, e);
+}
 #endif
 
+
 //============================================================================
+void CDockManager::endLeavingMinimizedState()
+{
+	d->IsLeavingMinimized = false;
+	this->activateWindow();
+}
+
+
+//============================================================================
+bool CDockManager::isLeavingMinimizedState() const
+{
+	return d->IsLeavingMinimized;
+}
+
+
+//============================================================================
 void CDockManager::registerFloatingWidget(CFloatingDockContainer* FloatingWidget)
 {
 	d->FloatingWidgets.append(FloatingWidget);
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.h	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.h	(Arbeitskopie)
@@ -88,7 +88,13 @@
 	friend class CAutoHideDockContainer;
 	friend CAutoHideSideBar;
 
+public Q_SLOTS:
+	/**
+	 * Ends the isRestoringFromMinimizedState
+	 */
+	void endLeavingMinimizedState();
 
+
 protected:
 	/**
 	 * Registers the given floating widget in the internal list of
@@ -239,6 +245,7 @@
 		AutoHideButtonCheckable = 0x08, //!< If the flag is set, the auto hide button will be checked and unchecked depending on the auto hide state. Mainly for styling purposes.
 		AutoHideSideBarsIconOnly = 0x10,///< show only icons in auto hide side tab - if a tab has no icon, then the text will be shown
 		AutoHideShowOnMouseOver = 0x20, ///< show the auto hide window on mouse over tab and hide it if mouse leaves auto hide container
+		AutoHideCloseButtonCollapsesDock = 0x40, ///< Close button of an auto hide container collapses the dock instead of hiding it completely
 
 		DefaultAutoHideConfig = AutoHideFeatureEnabled
 			                  | DockAreaHasAutoHideButton ///< the default configuration for left and right side bars
@@ -540,6 +547,15 @@
 	bool isRestoringState() const;
 
 	/**
+	 * This function returns true, if the DockManager window is restoring from
+	 * minimized state.
+	 * The DockManager is in this state starting from the QWindowStateChangeEvent
+	 * that signals the state change from minimized to normal until
+	 * endLeavingMinimizedState() function is called.
+	 */
+	bool isLeavingMinimizedState() const;
+
+	/**
 	 * The distance the user needs to move the mouse with the left button
 	 * hold down before a dock widget start floating
 	 */
@@ -560,9 +576,7 @@
 		widget->setFocus(Qt::OtherFocusReason);
 	}
 
-#ifdef Q_OS_LINUX
 	bool eventFilter(QObject *obj, QEvent *e) override;
-#endif
 
 	/**
 	 * Returns the dock widget that has focus style in the ui or a nullptr if
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockOverlay.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockOverlay.cpp	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockOverlay.cpp	(Arbeitskopie)
@@ -139,7 +139,7 @@
      */
     qreal dropIndicatiorWidth(QLabel* l) const
     {
-    #ifdef Q_OS_LINUX
+    #if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
         Q_UNUSED(l)
         return 40;
     #else
@@ -333,7 +333,7 @@
 {
 	d->Mode = Mode;
 	d->Cross = new CDockOverlayCross(this);
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint);
 #else
 	setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);
@@ -595,7 +595,7 @@
 	d(new DockOverlayCrossPrivate(this))
 {
 	d->DockOverlay = overlay;
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint);
 #else
 	setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.cpp	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.cpp	(Arbeitskopie)
@@ -623,6 +623,13 @@
 
 
 //============================================================================
+CDockWidget::eMinimumSizeHintMode CDockWidget::minimumSizeHintMode() const
+{
+	return d->MinimumSizeHintMode;
+}
+
+
+//============================================================================
 bool CDockWidget::isCentralWidget() const
 {
 	return dockManager()->centralWidget() == this;
@@ -643,14 +650,20 @@
 	// If the dock widget state is different, then we really need to toggle
 	// the state. If we are in the right state, then we simply make this
 	// dock widget the current dock widget
+	auto AutoHideContainer = autoHideDockContainer();
 	if (d->Closed != !Open)
 	{
 		toggleViewInternal(Open);
 	}
-	else if (Open && d->DockArea)
+	else if (Open && d->DockArea && !AutoHideContainer)
 	{
 		raise();
 	}
+
+	if (Open && AutoHideContainer)
+	{
+		AutoHideContainer->collapseView(false);
+	}
 }
 
 
@@ -984,14 +997,20 @@
 //============================================================================
 QSize CDockWidget::minimumSizeHint() const
 {
-	if (d->MinimumSizeHintMode == CDockWidget::MinimumSizeHintFromDockWidget || !d->Widget)
+	if (!d->Widget)
 	{
 		return QSize(60, 40);
 	}
-	else
+
+	switch (d->MinimumSizeHintMode)
 	{
-		return d->Widget->minimumSizeHint();
+		case MinimumSizeHintFromDockWidget: return QSize(60, 40);
+    	case MinimumSizeHintFromContent: return d->Widget->minimumSizeHint();
+    	case MinimumSizeHintFromDockWidgetMinimumSize: return minimumSize();
+    	case MinimumSizeHintFromContentMinimumSize: return d->Widget->minimumSize();
 	}
+
+	return d->Widget->minimumSizeHint();
 }
 
 
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.h	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.h	(Arbeitskopie)
@@ -208,12 +208,17 @@
      * reimplements minimumSizeHint() function to return a very small minimum
      * size hint. If you would like to adhere the minimumSizeHint() from the
      * content widget, then set the minimumSizeHintMode() to
-     * MinimumSizeHintFromContent.
+     * MinimumSizeHintFromContent. If you would like to use the minimumSize()
+     * value of the content widget or the dock widget, then you can use the
+     * MinimumSizeHintFromDockWidgetMinimumSize or
+     * MinimumSizeHintFromContentMinimumSize modes.
      */
     enum eMinimumSizeHintMode
     {
     	MinimumSizeHintFromDockWidget,
-    	MinimumSizeHintFromContent
+    	MinimumSizeHintFromContent,
+    	MinimumSizeHintFromDockWidgetMinimumSize,
+    	MinimumSizeHintFromContentMinimumSize,
     };
 
 
@@ -412,6 +417,11 @@
     void setMinimumSizeHintMode(eMinimumSizeHintMode Mode);
 
     /**
+     * Get the minimum size hint mode configured by setMinimumSizeHintMode
+     */
+    eMinimumSizeHintMode minimumSizeHintMode() const;
+
+    /**
      * Returns true if the dock widget is set as central widget of it's dock manager
      */
     bool isCentralWidget() const;
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.cpp	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.cpp	(Arbeitskopie)
@@ -79,6 +79,7 @@
 	QSpacerItem* IconTextSpacer;
 	QPoint TabDragStartPosition;
 	QSize IconSize;
+	bool MousePressed = false;
 
 	/**
 	 * Private data constructor
@@ -372,10 +373,12 @@
 	if (ev->button() == Qt::LeftButton)
 	{
 		ev->accept();
+		d->MousePressed = true;
         d->saveDragStartMousePosition(internal::globalPositionOf(ev));
         d->DragState = DraggingMousePressed;
         if (CDockManager::testConfigFlag(CDockManager::FocusHighlighting))
         {
+        	d->focusController()->setDockWidgetTabPressed(true);
         	d->focusController()->setDockWidgetTabFocused(this);
         }
         Q_EMIT clicked();
@@ -391,6 +394,7 @@
 {
 	if (ev->button() == Qt::LeftButton)
 	{
+		d->MousePressed = false;
 		auto CurrentDragState = d->DragState;
 		d->GlobalDragStartMousePosition = QPoint();
 		d->DragStartMousePosition = QPoint();
@@ -412,7 +416,12 @@
 			 d->FloatingWidget->finishDragging();
 			 break;
 
-		default:; // do nothing
+		default:
+			if (CDockManager::testConfigFlag(CDockManager::FocusHighlighting))
+			{
+				d->focusController()->setDockWidgetTabPressed(false);
+			}
+			break; // do nothing
 		}
 	} 
 	else if (ev->button() == Qt::MiddleButton)
@@ -802,6 +811,7 @@
 	d->IconSize = Size;
 	d->updateIcon();
 }
+
 } // namespace ads
 //---------------------------------------------------------------------------
 // EOF DockWidgetTab.cpp
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.h	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.h	(Arbeitskopie)
@@ -178,6 +178,12 @@
 	 */
 	void setIconSize(const QSize& Size);
 
+	/**
+	 * Returns true, if the tab has been clicked and the mouse is currently
+	 * pressed.
+	 */
+	bool mousePressed() const;
+
 public Q_SLOTS:
 	virtual void setVisible(bool visible) override;
 
Index: scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.cpp	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.cpp	(Arbeitskopie)
@@ -52,7 +52,7 @@
 #pragma comment(lib, "User32.lib")
 #endif
 #endif
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include "linux/FloatingWidgetTitleBar.h"
 #include <xcb/xcb.h>
 #endif
@@ -374,10 +374,11 @@
 	QPoint DragStartPos;
 	bool Hiding = false;
 	bool AutoHideChildren = true;
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     QWidget* MouseEventHandler = nullptr;
     CFloatingWidgetTitleBar* TitleBar = nullptr;
 	bool IsResizing = false;
+    bool MousePressed = false;
 #endif
 
 	/**
@@ -424,7 +425,7 @@
 
 	void setWindowTitle(const QString &Text)
 	{
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 		if (TitleBar)
 		{
 			TitleBar->setTitle(Text);
@@ -540,7 +541,7 @@
 		return;
 	}
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	// Prevent display of drop overlays and docking as long as a model dialog
 	// is active
     if (qApp->activeModalWidget())
@@ -641,7 +642,7 @@
 	connect(d->DockContainer, SIGNAL(dockAreasRemoved()), this,
 	    SLOT(onDockAreasAddedOrRemoved()));
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	QDockWidget::setWidget(d->DockContainer);
 	QDockWidget::setFloating(true);
 	QDockWidget::setFeatures(QDockWidget::DockWidgetClosable
@@ -763,18 +764,43 @@
 void CFloatingDockContainer::changeEvent(QEvent *event)
 {
 	Super::changeEvent(event);
-	if ((event->type() == QEvent::ActivationChange) && isActiveWindow())
+	switch (event->type())
 	{
-		ADS_PRINT("FloatingWidget::changeEvent QEvent::ActivationChange ");
-		d->zOrderIndex = ++zOrderCounter;
+	case QEvent::ActivationChange:
+		if (isActiveWindow())
+		{
+			ADS_PRINT("FloatingWidget::changeEvent QEvent::ActivationChange ");
+			d->zOrderIndex = ++zOrderCounter;
 
-#ifdef Q_OS_LINUX
-		if (d->DraggingState == DraggingFloatingWidget)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
+			if (d->DraggingState == DraggingFloatingWidget)
+			{
+				d->titleMouseReleaseEvent();
+				d->DraggingState = DraggingInactive;
+			}
+#endif
+		}
+		break;
+
+	case QEvent::WindowStateChange:
+	    // If the DockManager window is restored from minimized on Windows
+		// then the FloatingWidgets are not properly restored to maximized but
+		// to normal state.
+		// We simply check here, if the FloatingWidget was maximized before
+		// and if the DockManager is just leaving the minimized state. In this
+		// case, we restore the maximized state of this floating widget
+		if (d->DockManager->isLeavingMinimizedState())
 		{
-			d->titleMouseReleaseEvent();
-			d->DraggingState = DraggingInactive;
+			QWindowStateChangeEvent* ev = static_cast<QWindowStateChangeEvent*>(event);
+			if (ev->oldState().testFlag(Qt::WindowMaximized))
+			{
+				this->showMaximized();
+			}
 		}
-#endif
+		break;
+
+	default:
+		break; // do nothing
 	}
 }
 
@@ -920,7 +946,7 @@
 void CFloatingDockContainer::showEvent(QShowEvent *event)
 {
 	Super::showEvent(event);
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     if (CDockManager::testConfigFlag(CDockManager::FocusHighlighting))
     {
         this->window()->activateWindow();
@@ -933,7 +959,7 @@
 void CFloatingDockContainer::startFloating(const QPoint &DragStartMousePos,
     const QSize &Size, eDragState DragState, QWidget *MouseEventHandler)
 {
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     if (!isMaximized())
     {
 		resize(Size);
@@ -985,7 +1011,7 @@
 		// the main window as the active window for some reason. This fixes
 		// that by resetting the active window to the floating widget after
 		// updating the overlays.
-		QApplication::setActiveWindow(this);
+		activateWindow();
 #endif
 		break;
 	default:
@@ -1070,7 +1096,7 @@
 		return false;
 	}
 	onDockAreasAddedOrRemoved();
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	if(d->TitleBar)
 	{
 		d->TitleBar->setMaximizedIcon(windowState() == Qt::WindowMaximized);
@@ -1108,6 +1134,11 @@
 	d->AutoHideChildren = false;
 	hide();
 	deleteLater();
+	if (d->DockManager)
+	{
+		d->DockManager->removeFloatingWidget(this);
+		d->DockManager->removeDockContainer(this->dockContainer());
+	}
 }
 
 //============================================================================
@@ -1114,7 +1145,7 @@
 void CFloatingDockContainer::finishDragging()
 {
 	ADS_PRINT("CFloatingDockContainer::finishDragging");
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	setWindowOpacity(1);
 	activateWindow();
 	if (d->MouseEventHandler)
@@ -1218,7 +1249,7 @@
 		// the main window as the active window for some reason. This fixes
 		// that by resetting the active window to the floating widget after
 		// updating the overlays.
-		QApplication::setActiveWindow(this);
+		activateWindow();
 		break;
 	default:
 		break;
@@ -1229,7 +1260,7 @@
 #endif
 
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 //============================================================================
 void CFloatingDockContainer::onMaximizeRequest()
 {
@@ -1298,12 +1329,12 @@
 	Super::resizeEvent(event);
 }
 
-static bool s_mousePressed = false;
+
 //============================================================================
 void CFloatingDockContainer::moveEvent(QMoveEvent *event)
 {
 	Super::moveEvent(event);
-	if (!d->IsResizing && event->spontaneous() && s_mousePressed)
+    if (!d->IsResizing && event->spontaneous() && d->MousePressed)
 	{
         d->setState(DraggingFloatingWidget);
 		d->updateDropOverlays(QCursor::pos());
@@ -1319,10 +1350,10 @@
 	switch (e->type())
 	{
 	case QEvent::WindowActivate:
-		s_mousePressed = false;
+        d->MousePressed = false;
 		break;
 	case QEvent::WindowDeactivate:
-		s_mousePressed = true;
+        d->MousePressed = true;
 		break;
 	default:
 		break;
Index: scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.h	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.h	(Arbeitskopie)
@@ -33,7 +33,7 @@
 
 #include <QRubberBand>
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include <QDockWidget>
 #define tFloatingWidgetBase QDockWidget
 #else
@@ -182,11 +182,9 @@
 
 #ifdef Q_OS_MACOS
 	virtual bool event(QEvent *e) override;
+    virtual void moveEvent(QMoveEvent *event) override;
+#elif defined(Q_OS_UNIX)
 	virtual void moveEvent(QMoveEvent *event) override;
-#endif
-
-#ifdef Q_OS_LINUX
-	virtual void moveEvent(QMoveEvent *event) override;
 	virtual void resizeEvent(QResizeEvent *event) override;
 	virtual bool event(QEvent *e) override;
 #endif
@@ -264,7 +262,7 @@
 	 */
 	void hideAndDeleteLater();
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     /**
 	 * This is a function that responds to FloatingWidgetTitleBar::maximizeRequest()
 	 * Maximize or normalize the container size.
@@ -300,7 +298,6 @@
 	 */
 	bool hasNativeTitleBar();
 #endif
-
 }; // class FloatingDockContainer
 }
  // namespace ads
Index: scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDragPreview.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDragPreview.cpp	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDragPreview.cpp	(Arbeitskopie)
@@ -262,7 +262,7 @@
 		setAttribute(Qt::WA_TranslucentBackground);
 	}
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     auto Flags = windowFlags();
     Flags |= Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint;
     setWindowFlags(Flags);
Index: scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.cpp	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.cpp	(Arbeitskopie)
@@ -38,7 +38,7 @@
 #include "IconProvider.h"
 #include "ads_globals.h"
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include <QSettings>
 #include <QFile>
 #include <QApplication>
@@ -52,7 +52,7 @@
 {
 const int FloatingWidgetDragStartEvent = QEvent::registerEventType();
 const int DockedWidgetDragStartEvent = QEvent::registerEventType();
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 static QString _window_manager;
 static QHash<QString, xcb_atom_t> _xcb_atom_cache;
 
@@ -371,7 +371,7 @@
 		return;
 	}
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	Button->setIcon(Button->style()->standardIcon(StandarPixmap));
 #else
 	// The standard icons does not look good on high DPI screens so we create
Index: scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.h	(Revision 25545)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.h	(Arbeitskopie)
@@ -40,7 +40,7 @@
 
 #include <iostream>
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include <xcb/xcb.h>
 #endif
 
@@ -156,7 +156,7 @@
 extern const int FloatingWidgetDragStartEvent;
 extern const int DockedWidgetDragStartEvent;
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 // Utils to directly communicate with the X server
 /**
  * Get atom from cache or request it from the XServer.
Index: scribus/ui/aligndistribute.cpp
===================================================================
--- scribus/ui/aligndistribute.cpp	(Revision 25545)
+++ scribus/ui/aligndistribute.cpp	(Arbeitskopie)
@@ -47,14 +47,24 @@
 
 //TODO Distribute with 
 
-AlignDistributePalette::AlignDistributePalette( QWidget* parent, const char* name) : ScDockPalette(parent, name, Qt::WindowFlags())
+AlignDistribute::AlignDistribute(QWidget* parent) : QWidget(parent)
 {
 	setupUi(this);
+}
+
+
+// =============================
+
+
+AlignDistributePalette::AlignDistributePalette(QWidget* parent) : DockPanelBase("AlignDistributePalette", parent)
+{
 	setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
-	setObjectName(name);
+	setObjectName("AlignDistributePalette");
 
+	ad = new AlignDistribute(this);
+	setWidget(ad);
 	//set up scrspinboxes
-	distributeDistSpinBox->setValues(-10000.0, 10000.0, 2, 0.0);
+	ad->distributeDistSpinBox->setValues(-10000.0, 10000.0, 2, 0.0);
 
 	resize( QSize(100, 100).expandedTo(minimumSizeHint()) );
 	languageChange();
@@ -72,113 +82,111 @@
 		languageChange();
 		return;
 	}
-	ScDockPalette::changeEvent(e);
+	DockPanelBase::changeEvent(e);
 }
 
 void AlignDistributePalette::languageChange()
 {
-	retranslateUi(this);
-
-	int alignComboValue=alignRelativeToCombo->currentIndex();
-	alignRelativeToCombo->clear();
-	alignRelativeToCombo->addItem( tr( "First Selected" ) );
-	alignRelativeToCombo->addItem( tr( "Last Selected" ) );
-	alignRelativeToCombo->addItem( tr( "Page" ) );
-	alignRelativeToCombo->addItem( tr( "Margins" ) );
-	alignRelativeToCombo->addItem( tr( "Guide" ) );		
-	alignRelativeToCombo->addItem( tr( "Selection" ) );
-	alignRelativeToCombo->setCurrentIndex(alignComboValue);
-	alignRelativeToCombo->setToolTip( tr( "<qt>Align relative to the:<ul><li>First selected item</li><li>Second Selected Item</li><li>The current page</li><li>The margins of the current page</li><li>A Guide</li><li>The selection</ul></qt>" ) );
+	int alignComboValue = ad->alignRelativeToCombo->currentIndex();
+	ad->alignRelativeToCombo->clear();
+	ad->alignRelativeToCombo->addItem( tr( "First Selected" ) );
+	ad->alignRelativeToCombo->addItem( tr( "Last Selected" ) );
+	ad->alignRelativeToCombo->addItem( tr( "Page" ) );
+	ad->alignRelativeToCombo->addItem( tr( "Margins" ) );
+	ad->alignRelativeToCombo->addItem( tr( "Guide" ) );
+	ad->alignRelativeToCombo->addItem( tr( "Selection" ) );
+	ad->alignRelativeToCombo->setCurrentIndex(alignComboValue);
+	ad->alignRelativeToCombo->setToolTip( tr( "<qt>Align relative to the:<ul><li>First selected item</li><li>Second Selected Item</li><li>The current page</li><li>The margins of the current page</li><li>A Guide</li><li>The selection</ul></qt>" ) );
 	alignToChanged(alignComboValue);
 
-	int alignMethodValue=alignMoveOrResizeCombo->currentIndex();
-	alignMoveOrResizeCombo->clear();
-	alignMoveOrResizeCombo->addItem( tr("Move") );
-	alignMoveOrResizeCombo->addItem( tr("Resize") );
-	alignMoveOrResizeCombo->setToolTip( tr( "<qt>When aligning one side of an item do one of the following:<ul><li>Always move the other side too (preserve existing width and height)</li><li>Keep the other side fixed (resize the item instead of moving it) whenever possible</li></ul></qt>" ));
+	int alignMethodValue = ad->alignMoveOrResizeCombo->currentIndex();
+	ad->alignMoveOrResizeCombo->clear();
+	ad->alignMoveOrResizeCombo->addItem( tr("Move") );
+	ad->alignMoveOrResizeCombo->addItem( tr("Resize") );
+	ad->alignMoveOrResizeCombo->setToolTip( tr( "<qt>When aligning one side of an item do one of the following:<ul><li>Always move the other side too (preserve existing width and height)</li><li>Keep the other side fixed (resize the item instead of moving it) whenever possible</li></ul></qt>" ));
 	alignMethodChanged(alignMethodValue);
 
-	alignGuideLineEdit->setToolTip( tr( "The location of the selected guide to align to" ) );
-	alignLeftOutToolButton->setToolTip( tr( "Align right sides of items to left side of anchor" ) );
-	alignRightOutToolButton->setToolTip( tr( "Align left sides of items to right side of anchor" ) );
-	alignBottomInToolButton->setToolTip( tr( "Align bottoms" ) );
-	alignRightInToolButton->setToolTip( tr( "Align right sides" ) );
-	alignBottomOutToolButton->setToolTip( tr( "Align tops of items to bottom of anchor" ) );
-	alignCenterHorToolButton->setToolTip( tr( "Center on vertical axis" ) );
-	alignLeftInToolButton->setToolTip( tr( "Align left sides" ) );
-	alignCenterVerToolButton->setToolTip( tr( "Center on horizontal axis" ) );
-	alignTopOutToolButton->setToolTip( tr( "Align bottoms of items to top of anchor" ) );
-	alignTopInToolButton->setToolTip( tr( "Align tops" ) );
-		
-	distributeDistHToolButton->setToolTip( tr( "Make horizontal gaps between items equal" ) );
-	distributeDistValueHToolButton->setToolTip( tr( "Make horizontal gaps between items equal to the value specified" ) );
-	
-	distributeRightToolButton->setToolTip( tr( "Distribute right sides equidistantly" ) );
-	distributeBottomToolButton->setToolTip( tr( "Distribute bottoms equidistantly" ) );
-	distributeCenterHToolButton->setToolTip( tr( "Distribute centers equidistantly horizontally" ) );
-	distributeDistVToolButton->setToolTip( tr( "Make vertical gaps between items equal" ) );
-	distributeDistValueVToolButton->setToolTip( tr( "Make vertical gaps between items equal to the value specified" ) );
-	distributeLeftToolButton->setToolTip( tr( "Distribute left sides equidistantly" ) );
-	distributeCenterVToolButton->setToolTip( tr( "Distribute centers equidistantly vertically" ) );
-	distributeTopToolButton->setToolTip( tr( "Distribute tops equidistantly" ) );
-	distributeAcrossPageToolButton->setToolTip( tr( "Make horizontal gaps between items and sides of page equal" ) );
-	distributeDownPageToolButton->setToolTip( tr( "Make vertical gaps between items and the top and bottom of page equal" ) );
-	distributeAcrossMarginsToolButton->setToolTip( tr( "Make horizontal gaps between items and sides of page margins equal" ) );
-	distributeDownMarginsToolButton->setToolTip( tr( "Make vertical gaps between items and the top and bottom of page margins equal" ) );
+	ad->alignGuideLineEdit->setToolTip( tr( "The location of the selected guide to align to" ) );
+	ad->alignLeftOutToolButton->setToolTip( tr( "Align right sides of items to left side of anchor" ) );
+	ad->alignRightOutToolButton->setToolTip( tr( "Align left sides of items to right side of anchor" ) );
+	ad->alignBottomInToolButton->setToolTip( tr( "Align bottoms" ) );
+	ad->alignRightInToolButton->setToolTip( tr( "Align right sides" ) );
+	ad->alignBottomOutToolButton->setToolTip( tr( "Align tops of items to bottom of anchor" ) );
+	ad->alignCenterHorToolButton->setToolTip( tr( "Center on vertical axis" ) );
+	ad->alignLeftInToolButton->setToolTip( tr( "Align left sides" ) );
+	ad->alignCenterVerToolButton->setToolTip( tr( "Center on horizontal axis" ) );
+	ad->alignTopOutToolButton->setToolTip( tr( "Align bottoms of items to top of anchor" ) );
+	ad->alignTopInToolButton->setToolTip( tr( "Align tops" ) );
 
-	distributeDistSpinBox->setToolTip( tr( "Distribute the items with the distance specified" ) );
-	reverseDistributionCheckBox->setToolTip( tr("When distributing by a set distance, reverse the direction of the distribution of items") );
-	
+	ad->distributeDistHToolButton->setToolTip( tr( "Make horizontal gaps between items equal" ) );
+	ad->distributeDistValueHToolButton->setToolTip( tr( "Make horizontal gaps between items equal to the value specified" ) );
+
+	ad->distributeRightToolButton->setToolTip( tr( "Distribute right sides equidistantly" ) );
+	ad->distributeBottomToolButton->setToolTip( tr( "Distribute bottoms equidistantly" ) );
+	ad->distributeCenterHToolButton->setToolTip( tr( "Distribute centers equidistantly horizontally" ) );
+	ad->distributeDistVToolButton->setToolTip( tr( "Make vertical gaps between items equal" ) );
+	ad->distributeDistValueVToolButton->setToolTip( tr( "Make vertical gaps between items equal to the value specified" ) );
+	ad->distributeLeftToolButton->setToolTip( tr( "Distribute left sides equidistantly" ) );
+	ad->distributeCenterVToolButton->setToolTip( tr( "Distribute centers equidistantly vertically" ) );
+	ad->distributeTopToolButton->setToolTip( tr( "Distribute tops equidistantly" ) );
+	ad->distributeAcrossPageToolButton->setToolTip( tr( "Make horizontal gaps between items and sides of page equal" ) );
+	ad->distributeDownPageToolButton->setToolTip( tr( "Make vertical gaps between items and the top and bottom of page equal" ) );
+	ad->distributeAcrossMarginsToolButton->setToolTip( tr( "Make horizontal gaps between items and sides of page margins equal" ) );
+	ad->distributeDownMarginsToolButton->setToolTip( tr( "Make vertical gaps between items and the top and bottom of page margins equal" ) );
+
+	ad->distributeDistSpinBox->setToolTip( tr( "Distribute the items with the distance specified" ) );
+	ad->reverseDistributionCheckBox->setToolTip( tr("When distributing by a set distance, reverse the direction of the distribution of items") );
+
 	guideInfoTextNone = tr("None Selected");
 
-	swapLeftToolButton->setToolTip( tr( "Swap items to the left" ) );
-	swapRightToolButton->setToolTip( tr( "Swap items to the right" ) );
+	ad->swapLeftToolButton->setToolTip( tr( "Swap items to the left" ) );
+	ad->swapRightToolButton->setToolTip( tr( "Swap items to the right" ) );
 }
 
 void AlignDistributePalette::init()
 {
 	undoManager = UndoManager::instance();
-	
+
 	iconSetChange();
 
-	connect(alignLeftOutToolButton, SIGNAL(clicked()), this, SLOT(alignLeftOut()));
-	connect(alignRightOutToolButton, SIGNAL(clicked()), this, SLOT(alignRightOut()));
-	connect(alignBottomInToolButton, SIGNAL(clicked()), this, SLOT(alignBottomIn()));
-	connect(alignRightInToolButton, SIGNAL(clicked()), this, SLOT(alignRightIn()));
-	connect(alignBottomOutToolButton, SIGNAL(clicked()), this, SLOT(alignBottomOut()));
-	connect(alignCenterHorToolButton, SIGNAL(clicked()), this, SLOT(alignCenterHor()));
-	connect(alignLeftInToolButton, SIGNAL(clicked()), this, SLOT(alignLeftIn()));
-	connect(alignCenterVerToolButton, SIGNAL(clicked()), this, SLOT(alignCenterVer()));
-	connect(alignTopOutToolButton, SIGNAL(clicked()), this, SLOT(alignTopOut()));
-	connect(alignTopInToolButton, SIGNAL(clicked()), this, SLOT(alignTopIn()));
-	connect(distributeDistHToolButton, SIGNAL(clicked()), this, SLOT(distributeDistH()));
-	connect(distributeDistValueHToolButton, SIGNAL(clicked()), this, SLOT(distributeDistValH()));
-	connect(distributeRightToolButton, SIGNAL(clicked()), this, SLOT(distributeRight()));
-	connect(distributeBottomToolButton, SIGNAL(clicked()), this, SLOT(distributeBottom()));
-	connect(distributeCenterHToolButton, SIGNAL(clicked()), this, SLOT(distributeCenterH()));
-	connect(distributeDistVToolButton, SIGNAL(clicked()), this, SLOT(distributeDistV()));
-	connect(distributeDistValueVToolButton, SIGNAL(clicked()), this, SLOT(distributeDistValV()));
-	connect(distributeLeftToolButton, SIGNAL(clicked()), this, SLOT(distributeLeft()));
-	connect(distributeCenterVToolButton, SIGNAL(clicked()), this, SLOT(distributeCenterV()));
-	connect(distributeTopToolButton, SIGNAL(clicked()), this, SLOT(distributeTop()));
-	connect(distributeAcrossPageToolButton, SIGNAL(clicked()), this, SLOT(distributeDistAcrossPage()));
-	connect(distributeDownPageToolButton, SIGNAL(clicked()), this, SLOT(distributeDistDownPage()));
-	connect(distributeAcrossMarginsToolButton, SIGNAL(clicked()), this, SLOT(distributeDistAcrossMargins()));
-	connect(distributeDownMarginsToolButton, SIGNAL(clicked()), this, SLOT(distributeDistDownMargins()));
-	connect(swapLeftToolButton, SIGNAL(clicked()), this, SLOT(swapLeft()));
-	connect(swapRightToolButton, SIGNAL(clicked()), this, SLOT(swapRight()));
-	
-	alignRelativeToCombo->setCurrentIndex(0);
+	connect(ad->alignLeftOutToolButton, SIGNAL(clicked()), this, SLOT(alignLeftOut()));
+	connect(ad->alignRightOutToolButton, SIGNAL(clicked()), this, SLOT(alignRightOut()));
+	connect(ad->alignBottomInToolButton, SIGNAL(clicked()), this, SLOT(alignBottomIn()));
+	connect(ad->alignRightInToolButton, SIGNAL(clicked()), this, SLOT(alignRightIn()));
+	connect(ad->alignBottomOutToolButton, SIGNAL(clicked()), this, SLOT(alignBottomOut()));
+	connect(ad->alignCenterHorToolButton, SIGNAL(clicked()), this, SLOT(alignCenterHor()));
+	connect(ad->alignLeftInToolButton, SIGNAL(clicked()), this, SLOT(alignLeftIn()));
+	connect(ad->alignCenterVerToolButton, SIGNAL(clicked()), this, SLOT(alignCenterVer()));
+	connect(ad->alignTopOutToolButton, SIGNAL(clicked()), this, SLOT(alignTopOut()));
+	connect(ad->alignTopInToolButton, SIGNAL(clicked()), this, SLOT(alignTopIn()));
+	connect(ad->distributeDistHToolButton, SIGNAL(clicked()), this, SLOT(distributeDistH()));
+	connect(ad->distributeDistValueHToolButton, SIGNAL(clicked()), this, SLOT(distributeDistValH()));
+	connect(ad->distributeRightToolButton, SIGNAL(clicked()), this, SLOT(distributeRight()));
+	connect(ad->distributeBottomToolButton, SIGNAL(clicked()), this, SLOT(distributeBottom()));
+	connect(ad->distributeCenterHToolButton, SIGNAL(clicked()), this, SLOT(distributeCenterH()));
+	connect(ad->distributeDistVToolButton, SIGNAL(clicked()), this, SLOT(distributeDistV()));
+	connect(ad->distributeDistValueVToolButton, SIGNAL(clicked()), this, SLOT(distributeDistValV()));
+	connect(ad->distributeLeftToolButton, SIGNAL(clicked()), this, SLOT(distributeLeft()));
+	connect(ad->distributeCenterVToolButton, SIGNAL(clicked()), this, SLOT(distributeCenterV()));
+	connect(ad->distributeTopToolButton, SIGNAL(clicked()), this, SLOT(distributeTop()));
+	connect(ad->distributeAcrossPageToolButton, SIGNAL(clicked()), this, SLOT(distributeDistAcrossPage()));
+	connect(ad->distributeDownPageToolButton, SIGNAL(clicked()), this, SLOT(distributeDistDownPage()));
+	connect(ad->distributeAcrossMarginsToolButton, SIGNAL(clicked()), this, SLOT(distributeDistAcrossMargins()));
+	connect(ad->distributeDownMarginsToolButton, SIGNAL(clicked()), this, SLOT(distributeDistDownMargins()));
+	connect(ad->swapLeftToolButton, SIGNAL(clicked()), this, SLOT(swapLeft()));
+	connect(ad->swapRightToolButton, SIGNAL(clicked()), this, SLOT(swapRight()));
+
+	ad->alignRelativeToCombo->setCurrentIndex(0);
 	alignToChanged(0);
 	alignMethodChanged(0);
-	connect(alignRelativeToCombo, SIGNAL(activated(int)), this, SLOT(alignToChanged(int)));
-	connect(alignMoveOrResizeCombo, SIGNAL(activated(int)), this, SLOT(alignMethodChanged(int)));
-	
+	connect(ad->alignRelativeToCombo, SIGNAL(activated(int)), this, SLOT(alignToChanged(int)));
+	connect(ad->alignMoveOrResizeCombo, SIGNAL(activated(int)), this, SLOT(alignMethodChanged(int)));
+
 	unitRatio = 1.0;
 	guideDirection = -1;
-	
+
 	guideInfoText = guideInfoTextNone;
-	alignGuideLineEdit->setText(guideInfoTextNone);
+	ad->alignGuideLineEdit->setText(guideInfoTextNone);
 }
 
 void AlignDistributePalette::iconSetChange()
@@ -185,37 +193,37 @@
 {
 	IconManager& im = IconManager::instance();
 
-	alignLeftOutToolButton->setIcon(im.loadIcon("22/align-horizontal-left-out.png"));
-	alignLeftInToolButton->setIcon(im.loadIcon("22/align-horizontal-left.png"));
-	alignCenterHorToolButton->setIcon(im.loadIcon("22/align-horizontal-center.png"));
-	alignRightInToolButton->setIcon(im.loadIcon("22/align-horizontal-right.png"));
-	alignRightOutToolButton->setIcon(im.loadIcon("22/align-horizontal-right-out.png"));
+	ad->alignLeftOutToolButton->setIcon(im.loadIcon("22/align-horizontal-left-out.png"));
+	ad->alignLeftInToolButton->setIcon(im.loadIcon("22/align-horizontal-left.png"));
+	ad->alignCenterHorToolButton->setIcon(im.loadIcon("22/align-horizontal-center.png"));
+	ad->alignRightInToolButton->setIcon(im.loadIcon("22/align-horizontal-right.png"));
+	ad->alignRightOutToolButton->setIcon(im.loadIcon("22/align-horizontal-right-out.png"));
 
-	alignTopOutToolButton->setIcon(im.loadIcon("22/align-vertical-top-out.png"));
-	alignTopInToolButton->setIcon(im.loadIcon("22/align-vertical-top.png"));
-	alignCenterVerToolButton->setIcon(im.loadIcon("22/align-vertical-center.png"));
-	alignBottomInToolButton->setIcon(im.loadIcon("22/align-vertical-bottom.png"));
-	alignBottomOutToolButton->setIcon(im.loadIcon("22/align-vertical-bottom-out.png"));
+	ad->alignTopOutToolButton->setIcon(im.loadIcon("22/align-vertical-top-out.png"));
+	ad->alignTopInToolButton->setIcon(im.loadIcon("22/align-vertical-top.png"));
+	ad->alignCenterVerToolButton->setIcon(im.loadIcon("22/align-vertical-center.png"));
+	ad->alignBottomInToolButton->setIcon(im.loadIcon("22/align-vertical-bottom.png"));
+	ad->alignBottomOutToolButton->setIcon(im.loadIcon("22/align-vertical-bottom-out.png"));
 
-	distributeLeftToolButton->setIcon(im.loadIcon("22/distribute-horizontal-left.png"));
-	distributeCenterHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-center.png"));
-	distributeRightToolButton->setIcon(im.loadIcon("22/distribute-horizontal-right.png"));
-	distributeDistHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-equal.png"));
+	ad->distributeLeftToolButton->setIcon(im.loadIcon("22/distribute-horizontal-left.png"));
+	ad->distributeCenterHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-center.png"));
+	ad->distributeRightToolButton->setIcon(im.loadIcon("22/distribute-horizontal-right.png"));
+	ad->distributeDistHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-equal.png"));
 
-	distributeBottomToolButton->setIcon(im.loadIcon("22/distribute-vertical-bottom.png"));
-	distributeCenterVToolButton->setIcon(im.loadIcon("22/distribute-vertical-center.png"));
-	distributeTopToolButton->setIcon(im.loadIcon("22/distribute-vertical-top.png"));
-	distributeDistVToolButton->setIcon(im.loadIcon("22/distribute-vertical-equal.png"));
+	ad->distributeBottomToolButton->setIcon(im.loadIcon("22/distribute-vertical-bottom.png"));
+	ad->distributeCenterVToolButton->setIcon(im.loadIcon("22/distribute-vertical-center.png"));
+	ad->distributeTopToolButton->setIcon(im.loadIcon("22/distribute-vertical-top.png"));
+	ad->distributeDistVToolButton->setIcon(im.loadIcon("22/distribute-vertical-equal.png"));
 
-	distributeAcrossPageToolButton->setIcon(im.loadIcon("22/distribute-horizontal-page.png"));
-	distributeDownPageToolButton->setIcon(im.loadIcon("22/distribute-vertical-page.png"));
-	distributeAcrossMarginsToolButton->setIcon(im.loadIcon("22/distribute-horizontal-margin.png"));
-	distributeDownMarginsToolButton->setIcon(im.loadIcon("22/distribute-vertical-margin.png"));
-	distributeDistValueHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-x.png"));
-	distributeDistValueVToolButton->setIcon(im.loadIcon("22/distribute-vertical-y.png"));
+	ad->distributeAcrossPageToolButton->setIcon(im.loadIcon("22/distribute-horizontal-page.png"));
+	ad->distributeDownPageToolButton->setIcon(im.loadIcon("22/distribute-vertical-page.png"));
+	ad->distributeAcrossMarginsToolButton->setIcon(im.loadIcon("22/distribute-horizontal-margin.png"));
+	ad->distributeDownMarginsToolButton->setIcon(im.loadIcon("22/distribute-vertical-margin.png"));
+	ad->distributeDistValueHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-x.png"));
+	ad->distributeDistValueVToolButton->setIcon(im.loadIcon("22/distribute-vertical-y.png"));
 
-	swapLeftToolButton->setIcon(im.loadIcon("22/swap-left.png"));
-	swapRightToolButton->setIcon(im.loadIcon("22/swap-right.png"));
+	ad->swapLeftToolButton->setIcon(im.loadIcon("22/swap-left.png"));
+	ad->swapRightToolButton->setIcon(im.loadIcon("22/swap-right.png"));
 }
 
 void AlignDistributePalette::unitChange()
@@ -223,7 +231,7 @@
 	if (currDoc == nullptr)
 		return;
 	unitRatio = unitGetRatioFromIndex(currDoc->unitIndex());
-	distributeDistSpinBox->setNewUnit(currDoc->unitIndex());
+	ad->distributeDistSpinBox->setNewUnit(currDoc->unitIndex());
 	enableGuideButtons();
 }
 
@@ -320,12 +328,12 @@
 void AlignDistributePalette::distributeDistH(bool usingDistance)
 {
 	if (currDoc != nullptr)
-		currDoc->itemSelection_DistributeDistH(usingDistance, distributeDistSpinBox->value(), reverseDistributionCheckBox->isChecked());
+		currDoc->itemSelection_DistributeDistH(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionCheckBox->isChecked());
 }
 
 void AlignDistributePalette::distributeDistValH()
 {
-	distributeDistSpinBox->interpretText();
+	ad->distributeDistSpinBox->interpretText();
 	if (currDoc != nullptr)
 		distributeDistH(true);
 }
@@ -375,12 +383,12 @@
 void AlignDistributePalette::distributeDistV(bool usingDistance)
 {
 	if (currDoc != nullptr)
-		currDoc->itemSelection_DistributeDistV(usingDistance, distributeDistSpinBox->value(), reverseDistributionCheckBox->isChecked());
+		currDoc->itemSelection_DistributeDistV(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionCheckBox->isChecked());
 }
 
 void AlignDistributePalette::distributeDistValV()
 {
-	distributeDistSpinBox->interpretText();
+	ad->distributeDistSpinBox->interpretText();
 	if (currDoc != nullptr)
 		distributeDistV(true);
 }
@@ -421,7 +429,7 @@
 void AlignDistributePalette::localeChange()
 {
 	const QLocale& l(LocaleManager::instance().userPreferredLocale());
-	distributeDistSpinBox->setLocale(l);
+	ad->distributeDistSpinBox->setLocale(l);
 }
 
 void AlignDistributePalette::enableGuideButtons()
@@ -458,18 +466,19 @@
 	bool setterO = true;
 	if (currAlignTo == ScribusDoc::alignGuide)
 		setterO = false;
-		
-	alignLeftInToolButton->setEnabled(setterV);
-	alignLeftOutToolButton->setEnabled(setterO);
-	alignRightInToolButton->setEnabled(setterV);
-	alignRightOutToolButton->setEnabled(setterO);
-	alignCenterHorToolButton->setEnabled(setterV);
 
-	alignTopInToolButton->setEnabled(setterH);
-	alignTopOutToolButton->setEnabled(setterO);
-	alignBottomInToolButton->setEnabled(setterH);
-	alignBottomOutToolButton->setEnabled(setterO);
-	alignCenterVerToolButton->setEnabled(setterH);
-	
-	alignGuideLineEdit->setText(guideInfoText);
+	ad->alignLeftInToolButton->setEnabled(setterV);
+	ad->alignLeftOutToolButton->setEnabled(setterO);
+	ad->alignRightInToolButton->setEnabled(setterV);
+	ad->alignRightOutToolButton->setEnabled(setterO);
+	ad->alignCenterHorToolButton->setEnabled(setterV);
+
+	ad->alignTopInToolButton->setEnabled(setterH);
+	ad->alignTopOutToolButton->setEnabled(setterO);
+	ad->alignBottomInToolButton->setEnabled(setterH);
+	ad->alignBottomOutToolButton->setEnabled(setterO);
+	ad->alignCenterVerToolButton->setEnabled(setterH);
+
+	ad->alignGuideLineEdit->setText(guideInfoText);
 }
+
Index: scribus/ui/aligndistribute.h
===================================================================
--- scribus/ui/aligndistribute.h	(Revision 25545)
+++ scribus/ui/aligndistribute.h	(Arbeitskopie)
@@ -35,6 +35,7 @@
 #include "scribusapi.h"
 #include "scribusdoc.h"
 #include "ui/scdockpalette.h"
+#include "docks/dock_panelbase.h"
 
 class QComboBox;
 class QLabel;
@@ -48,15 +49,25 @@
 
 struct AlignObjs;
 
+class SCRIBUS_API AlignDistribute : public QWidget, Ui::AlignDistribute
+{
+	friend class AlignDistributePalette;
 
+public:
+	AlignDistribute( QWidget* parent = nullptr);
+	~AlignDistribute() = default;
+};
+
+
+
 /*! \brief Align/Distribute palette.
 */
-class SCRIBUS_API AlignDistributePalette : public ScDockPalette, Ui::AlignDistribute
+class SCRIBUS_API AlignDistributePalette : public DockPanelBase
 {
 	Q_OBJECT
 
 public:
-	AlignDistributePalette( QWidget* parent = nullptr, const char* name = 0);
+	AlignDistributePalette( QWidget* parent = nullptr);
 	~AlignDistributePalette() = default;
 
 	virtual void setDoc( ScribusDoc* newDoc );
@@ -68,6 +79,7 @@
 
 protected:
 	ScribusView *currView { nullptr };
+	AlignDistribute * ad {nullptr};
 
 	void changeEvent(QEvent *e) override;
 	
Index: scribus/ui/aligndistribute.ui
===================================================================
--- scribus/ui/aligndistribute.ui	(Revision 25545)
+++ scribus/ui/aligndistribute.ui	(Arbeitskopie)
@@ -1,1061 +1,1059 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>AlignDistribute</class>
- <widget class="ScDockPalette" name="AlignDistribute">
+ <widget class="QWidget" name="AlignDistribute">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>269</width>
-    <height>308</height>
+    <width>247</width>
+    <height>277</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Align and Distribute</string>
   </property>
-  <widget class="QWidget" name="dockWidgetContents">
-   <layout class="QVBoxLayout" name="verticalLayout_3">
-    <property name="leftMargin">
-     <number>3</number>
-    </property>
-    <property name="topMargin">
-     <number>3</number>
-    </property>
-    <property name="rightMargin">
-     <number>3</number>
-    </property>
-    <property name="bottomMargin">
-     <number>3</number>
-    </property>
-    <item>
-     <widget class="QTabWidget" name="tabWidget">
-      <property name="currentIndex">
-       <number>0</number>
-      </property>
-      <widget class="QWidget" name="tabAlign">
-       <attribute name="title">
-        <string>Align</string>
-       </attribute>
-       <layout class="QVBoxLayout">
-        <property name="spacing">
-         <number>3</number>
-        </property>
-        <property name="leftMargin">
-         <number>6</number>
-        </property>
-        <property name="topMargin">
-         <number>6</number>
-        </property>
-        <property name="rightMargin">
-         <number>6</number>
-        </property>
-        <property name="bottomMargin">
-         <number>6</number>
-        </property>
-        <item>
-         <layout class="QHBoxLayout" name="_2">
-          <property name="spacing">
-           <number>3</number>
-          </property>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <layout class="QGridLayout" name="_3">
-            <item row="1" column="0">
-             <widget class="QLabel" name="alignGuideLabel">
-              <property name="text">
-               <string>&amp;Selected Guide:</string>
-              </property>
-              <property name="wordWrap">
-               <bool>false</bool>
-              </property>
-              <property name="buddy">
-               <cstring>alignGuideLineEdit</cstring>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="0">
-             <widget class="QLabel" name="alignRelativeToLabel">
-              <property name="text">
-               <string>&amp;Relative To:</string>
-              </property>
-              <property name="wordWrap">
-               <bool>false</bool>
-              </property>
-              <property name="buddy">
-               <cstring>alignRelativeToCombo</cstring>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="1">
-             <widget class="QLineEdit" name="alignGuideLineEdit"/>
-            </item>
-            <item row="0" column="1">
-             <widget class="QComboBox" name="alignRelativeToCombo"/>
-            </item>
-            <item row="2" column="0">
-             <widget class="QLabel" name="alignMoveOrResizeLabel">
-              <property name="text">
-               <string>&amp;Align Sides By:</string>
-              </property>
-              <property name="wordWrap">
-               <bool>false</bool>
-              </property>
-              <property name="buddy">
-               <cstring>alignMoveOrResizeCombo</cstring>
-              </property>
-             </widget>
-            </item>
-            <item row="2" column="1">
-             <widget class="QComboBox" name="alignMoveOrResizeCombo"/>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <layout class="QHBoxLayout" name="_4">
-          <property name="spacing">
-           <number>3</number>
-          </property>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <layout class="QGridLayout" name="_5">
-            <item row="1" column="3">
-             <widget class="QToolButton" name="alignBottomInToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="1">
-             <widget class="QToolButton" name="alignTopInToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="1">
-             <widget class="QToolButton" name="alignLeftInToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="3">
-             <widget class="QToolButton" name="alignRightInToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="4">
-             <widget class="QToolButton" name="alignBottomOutToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="0">
-             <widget class="QToolButton" name="alignTopOutToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="2">
-             <widget class="QToolButton" name="alignCenterVerToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="0">
-             <widget class="QToolButton" name="alignLeftOutToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="4">
-             <widget class="QToolButton" name="alignRightOutToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="2">
-             <widget class="QToolButton" name="alignCenterHorToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <spacer>
-          <property name="orientation">
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Expanding</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>20</width>
-            <height>0</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="tabDistribute">
-       <attribute name="title">
-        <string>Distribute</string>
-       </attribute>
-       <layout class="QVBoxLayout" name="verticalLayout_2">
-        <property name="spacing">
-         <number>3</number>
-        </property>
-        <property name="leftMargin">
-         <number>6</number>
-        </property>
-        <property name="topMargin">
-         <number>6</number>
-        </property>
-        <property name="rightMargin">
-         <number>6</number>
-        </property>
-        <property name="bottomMargin">
-         <number>6</number>
-        </property>
-        <item>
-         <layout class="QHBoxLayout" name="_6">
-          <property name="spacing">
-           <number>3</number>
-          </property>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>63</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <layout class="QGridLayout" name="_7">
-            <item row="0" column="3">
-             <widget class="QToolButton" name="distributeDistHToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="2">
-             <widget class="QToolButton" name="distributeTopToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="1">
-             <widget class="QToolButton" name="distributeCenterVToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="2">
-             <widget class="QToolButton" name="distributeRightToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="2" column="2">
-             <widget class="QToolButton" name="distributeAcrossMarginsToolButton">
-              <property name="enabled">
-               <bool>true</bool>
-              </property>
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="0">
-             <widget class="QToolButton" name="distributeLeftToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="2" column="0">
-             <widget class="QToolButton" name="distributeAcrossPageToolButton">
-              <property name="enabled">
-               <bool>true</bool>
-              </property>
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="3" column="1">
-             <widget class="QToolButton" name="distributeDistValueHToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="2" column="3">
-             <widget class="QToolButton" name="distributeDownMarginsToolButton">
-              <property name="enabled">
-               <bool>true</bool>
-              </property>
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="1">
-             <widget class="QToolButton" name="distributeCenterHToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="2" column="1">
-             <widget class="QToolButton" name="distributeDownPageToolButton">
-              <property name="enabled">
-               <bool>true</bool>
-              </property>
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="3" column="2">
-             <widget class="QToolButton" name="distributeDistValueVToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="3">
-             <widget class="QToolButton" name="distributeDistVToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="0">
-             <widget class="QToolButton" name="distributeBottomToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>62</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <layout class="QHBoxLayout" name="_8">
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <layout class="QHBoxLayout" name="_9">
-            <property name="spacing">
-             <number>3</number>
-            </property>
-            <item>
-             <widget class="QLabel" name="distributeDistLabel">
-              <property name="text">
-               <string>&amp;Distance:</string>
-              </property>
-              <property name="wordWrap">
-               <bool>false</bool>
-              </property>
-              <property name="indent">
-               <number>-1</number>
-              </property>
-              <property name="buddy">
-               <cstring>distributeDistSpinBox</cstring>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="ScrSpinBox" name="distributeDistSpinBox">
-              <property name="minimumSize">
-               <size>
-                <width>50</width>
-                <height>24</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <layout class="QHBoxLayout" name="horizontalLayout_2">
-          <property name="spacing">
-           <number>3</number>
-          </property>
-          <item>
-           <spacer name="spacer">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <widget class="QCheckBox" name="reverseDistributionCheckBox">
-            <property name="text">
-             <string>Reverse Distribution</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <spacer name="spacer_2">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <spacer>
-          <property name="orientation">
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Expanding</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>20</width>
-            <height>0</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="tabSwap">
-       <attribute name="title">
-        <string>Swap</string>
-       </attribute>
-       <layout class="QVBoxLayout" name="verticalLayout">
-        <property name="spacing">
-         <number>3</number>
-        </property>
-        <property name="leftMargin">
-         <number>6</number>
-        </property>
-        <property name="topMargin">
-         <number>6</number>
-        </property>
-        <property name="rightMargin">
-         <number>6</number>
-        </property>
-        <property name="bottomMargin">
-         <number>6</number>
-        </property>
-        <item>
-         <layout class="QHBoxLayout" name="horizontalLayout">
-          <property name="spacing">
-           <number>3</number>
-          </property>
-          <item>
-           <spacer name="horizontalSpacer">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <widget class="QToolButton" name="swapLeftToolButton">
-            <property name="minimumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="iconSize">
-             <size>
-              <width>22</width>
-              <height>22</height>
-             </size>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QToolButton" name="swapRightToolButton">
-            <property name="minimumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="iconSize">
-             <size>
-              <width>22</width>
-              <height>22</height>
-             </size>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <spacer name="horizontalSpacer_2">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <spacer name="verticalSpacer">
-          <property name="orientation">
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>20</width>
-            <height>0</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </widget>
+  <layout class="QVBoxLayout" name="verticalLayout_3">
+   <property name="leftMargin">
+    <number>3</number>
+   </property>
+   <property name="topMargin">
+    <number>3</number>
+   </property>
+   <property name="rightMargin">
+    <number>3</number>
+   </property>
+   <property name="bottomMargin">
+    <number>3</number>
+   </property>
+   <item>
+    <widget class="QTabWidget" name="tabWidget">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="tabAlign">
+      <attribute name="title">
+       <string>Align</string>
+      </attribute>
+      <layout class="QVBoxLayout">
+       <property name="spacing">
+        <number>3</number>
+       </property>
+       <property name="leftMargin">
+        <number>6</number>
+       </property>
+       <property name="topMargin">
+        <number>6</number>
+       </property>
+       <property name="rightMargin">
+        <number>6</number>
+       </property>
+       <property name="bottomMargin">
+        <number>6</number>
+       </property>
+       <item>
+        <layout class="QHBoxLayout" name="_2">
+         <property name="spacing">
+          <number>3</number>
+         </property>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <layout class="QGridLayout" name="_3">
+           <item row="1" column="0">
+            <widget class="QLabel" name="alignGuideLabel">
+             <property name="text">
+              <string>&amp;Selected Guide:</string>
+             </property>
+             <property name="wordWrap">
+              <bool>false</bool>
+             </property>
+             <property name="buddy">
+              <cstring>alignGuideLineEdit</cstring>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="0">
+            <widget class="QLabel" name="alignRelativeToLabel">
+             <property name="text">
+              <string>&amp;Relative To:</string>
+             </property>
+             <property name="wordWrap">
+              <bool>false</bool>
+             </property>
+             <property name="buddy">
+              <cstring>alignRelativeToCombo</cstring>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="1">
+            <widget class="QLineEdit" name="alignGuideLineEdit"/>
+           </item>
+           <item row="0" column="1">
+            <widget class="QComboBox" name="alignRelativeToCombo"/>
+           </item>
+           <item row="2" column="0">
+            <widget class="QLabel" name="alignMoveOrResizeLabel">
+             <property name="text">
+              <string>&amp;Align Sides By:</string>
+             </property>
+             <property name="wordWrap">
+              <bool>false</bool>
+             </property>
+             <property name="buddy">
+              <cstring>alignMoveOrResizeCombo</cstring>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="1">
+            <widget class="QComboBox" name="alignMoveOrResizeCombo"/>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="_4">
+         <property name="spacing">
+          <number>3</number>
+         </property>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <layout class="QGridLayout" name="_5">
+           <item row="1" column="3">
+            <widget class="QToolButton" name="alignBottomInToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="1">
+            <widget class="QToolButton" name="alignTopInToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="1">
+            <widget class="QToolButton" name="alignLeftInToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="3">
+            <widget class="QToolButton" name="alignRightInToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="4">
+            <widget class="QToolButton" name="alignBottomOutToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="0">
+            <widget class="QToolButton" name="alignTopOutToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="2">
+            <widget class="QToolButton" name="alignCenterVerToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="0">
+            <widget class="QToolButton" name="alignLeftOutToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="4">
+            <widget class="QToolButton" name="alignRightOutToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="2">
+            <widget class="QToolButton" name="alignCenterHorToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer>
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Expanding</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
      </widget>
-    </item>
-   </layout>
-  </widget>
+     <widget class="QWidget" name="tabDistribute">
+      <attribute name="title">
+       <string>Distribute</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <property name="spacing">
+        <number>3</number>
+       </property>
+       <property name="leftMargin">
+        <number>6</number>
+       </property>
+       <property name="topMargin">
+        <number>6</number>
+       </property>
+       <property name="rightMargin">
+        <number>6</number>
+       </property>
+       <property name="bottomMargin">
+        <number>6</number>
+       </property>
+       <item>
+        <layout class="QHBoxLayout" name="_6">
+         <property name="spacing">
+          <number>3</number>
+         </property>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>63</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <layout class="QGridLayout" name="_7">
+           <item row="0" column="3">
+            <widget class="QToolButton" name="distributeDistHToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="2">
+            <widget class="QToolButton" name="distributeTopToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="1">
+            <widget class="QToolButton" name="distributeCenterVToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="2">
+            <widget class="QToolButton" name="distributeRightToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="2">
+            <widget class="QToolButton" name="distributeAcrossMarginsToolButton">
+             <property name="enabled">
+              <bool>true</bool>
+             </property>
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="0">
+            <widget class="QToolButton" name="distributeLeftToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="0">
+            <widget class="QToolButton" name="distributeAcrossPageToolButton">
+             <property name="enabled">
+              <bool>true</bool>
+             </property>
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="3" column="1">
+            <widget class="QToolButton" name="distributeDistValueHToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="3">
+            <widget class="QToolButton" name="distributeDownMarginsToolButton">
+             <property name="enabled">
+              <bool>true</bool>
+             </property>
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="1">
+            <widget class="QToolButton" name="distributeCenterHToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="1">
+            <widget class="QToolButton" name="distributeDownPageToolButton">
+             <property name="enabled">
+              <bool>true</bool>
+             </property>
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="3" column="2">
+            <widget class="QToolButton" name="distributeDistValueVToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="3">
+            <widget class="QToolButton" name="distributeDistVToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="0">
+            <widget class="QToolButton" name="distributeBottomToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>62</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="_8">
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="_9">
+           <property name="spacing">
+            <number>3</number>
+           </property>
+           <item>
+            <widget class="QLabel" name="distributeDistLabel">
+             <property name="text">
+              <string>&amp;Distance:</string>
+             </property>
+             <property name="wordWrap">
+              <bool>false</bool>
+             </property>
+             <property name="indent">
+              <number>-1</number>
+             </property>
+             <property name="buddy">
+              <cstring>distributeDistSpinBox</cstring>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="ScrSpinBox" name="distributeDistSpinBox">
+             <property name="minimumSize">
+              <size>
+               <width>50</width>
+               <height>24</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_2">
+         <property name="spacing">
+          <number>3</number>
+         </property>
+         <item>
+          <spacer name="spacer">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QCheckBox" name="reverseDistributionCheckBox">
+           <property name="text">
+            <string>Reverse Distribution</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="spacer_2">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer>
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Expanding</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tabSwap">
+      <attribute name="title">
+       <string>Swap</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <property name="spacing">
+        <number>3</number>
+       </property>
+       <property name="leftMargin">
+        <number>6</number>
+       </property>
+       <property name="topMargin">
+        <number>6</number>
+       </property>
+       <property name="rightMargin">
+        <number>6</number>
+       </property>
+       <property name="bottomMargin">
+        <number>6</number>
+       </property>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout">
+         <property name="spacing">
+          <number>3</number>
+         </property>
+         <item>
+          <spacer name="horizontalSpacer">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QToolButton" name="swapLeftToolButton">
+           <property name="minimumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="iconSize">
+            <size>
+             <width>22</width>
+             <height>22</height>
+            </size>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QToolButton" name="swapRightToolButton">
+           <property name="minimumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="iconSize">
+            <size>
+             <width>22</width>
+             <height>22</height>
+            </size>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_2">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer name="verticalSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
  </widget>
  <customwidgets>
   <customwidget>
@@ -1063,12 +1061,6 @@
    <extends>QDoubleSpinBox</extends>
    <header>ui/scrspinbox.h</header>
   </customwidget>
-  <customwidget>
-   <class>ScDockPalette</class>
-   <extends>QDockWidget</extends>
-   <header>ui/scdockpalette.h</header>
-   <container>1</container>
-  </customwidget>
  </customwidgets>
  <tabstops>
   <tabstop>alignRelativeToCombo</tabstop>
@@ -1106,7 +1098,6 @@
  </tabstops>
  <includes>
   <include location="local">ui/scrspinbox.h</include>
-  <include location="local">ui/scdockpalette.h</include>
  </includes>
  <resources/>
  <connections/>
Index: scribus/ui/bookmarkpalette.cpp
===================================================================
--- scribus/ui/bookmarkpalette.cpp	(Revision 25545)
+++ scribus/ui/bookmarkpalette.cpp	(Arbeitskopie)
@@ -25,7 +25,7 @@
 
 #include "bookmarkpalette.h"
 
-BookPalette::BookPalette(QWidget* parent) : ScDockPalette( parent, "Books" )
+BookPalette::BookPalette(QWidget* parent) : DockPanelBase( "Books", parent )
 {
 	setObjectName(QString::fromLocal8Bit("Books"));
 	setContentsMargins(3, 3, 3, 3);
@@ -41,7 +41,7 @@
 	if (e->type() == QEvent::LanguageChange)
 		languageChange();
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void BookPalette::languageChange()
Index: scribus/ui/bookmarkpalette.h
===================================================================
--- scribus/ui/bookmarkpalette.h	(Revision 25545)
+++ scribus/ui/bookmarkpalette.h	(Arbeitskopie)
@@ -29,7 +29,8 @@
 class QEvent;
 
 #include "scribusapi.h"
-#include "scdockpalette.h"
+//#include "scdockpalette.h"
+#include "ui/docks/dock_panelbase.h"
 #include "bookmwin.h"
 /**
   *@author Franz Schmid
@@ -36,7 +37,7 @@
   */
 
 /*! \brief A Bookmark Palette */
-class SCRIBUS_API BookPalette : public ScDockPalette
+class SCRIBUS_API BookPalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/contentpalette.cpp
===================================================================
--- scribus/ui/contentpalette.cpp	(Revision 25545)
+++ scribus/ui/contentpalette.cpp	(Arbeitskopie)
@@ -25,8 +25,8 @@
 #include "styles/paragraphstyle.h"
 #include "styles/charstyle.h"
 
-ContentPalette::ContentPalette(QWidget* parent) :
-	ScDockPalette(parent, "ContentPalette", Qt::WindowFlags())
+ContentPalette::ContentPalette(QWidget *parent) :
+	DockPanelBase("ContentPalette", parent)
 {
 	setObjectName(QString::fromLocal8Bit("ContentPalette"));
 
@@ -276,7 +276,7 @@
 		updatePanelTitle();
 	}
 	updateGeometry();
-	ScDockPalette::update();
+	DockPanelBase::update();
 }
 
 void ContentPalette::unitChange()
@@ -320,7 +320,7 @@
 		languageChange();
 		return;
 	}
-	ScDockPalette::changeEvent(e);
+	DockPanelBase::changeEvent(e);
 }
 
 void ContentPalette::updatePanelTitle()
Index: scribus/ui/contentpalette.h
===================================================================
--- scribus/ui/contentpalette.h	(Revision 25545)
+++ scribus/ui/contentpalette.h	(Arbeitskopie)
@@ -9,6 +9,7 @@
 
 #include "scribusapi.h"
 #include "scdockpalette.h"
+#include "docks/dock_panelbase.h"
 #include "scguardedptr.h"
 
 class QStackedWidget;
@@ -28,7 +29,7 @@
 class ParagraphStyle;
 class CharStyle;
 
-class SCRIBUS_API ContentPalette : public ScDockPalette
+class SCRIBUS_API ContentPalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/docks/dock_centralwidget.cpp
===================================================================
--- scribus/ui/docks/dock_centralwidget.cpp	(nicht existent)
+++ scribus/ui/docks/dock_centralwidget.cpp	(Arbeitskopie)
@@ -0,0 +1,29 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+#include "dock_centralwidget.h"
+
+DockCentralWidget::DockCentralWidget(QWidget *parent) : ads::CDockWidget(QString(), parent)
+{
+
+	setObjectName(QString::fromLocal8Bit("DockCentralWidget"));
+
+    setFeature(ads::CDockWidget::NoTab, true);
+    setFeature(ads::CDockWidget::DockWidgetFloatable, false);
+}
+
Index: scribus/ui/docks/dock_centralwidget.h
===================================================================
--- scribus/ui/docks/dock_centralwidget.h	(nicht existent)
+++ scribus/ui/docks/dock_centralwidget.h	(Arbeitskopie)
@@ -0,0 +1,35 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+
+#ifndef DOCK_CENTRALWIDGET_H
+#define DOCK_CENTRALWIDGET_H
+
+#include "third_party/Qt-Advanced-Docking-System/src/DockWidget.h"
+
+class DockCentralWidget : public ads::CDockWidget
+{
+    Q_OBJECT
+
+public:
+    explicit DockCentralWidget(QWidget *parent = nullptr);
+
+
+};
+
+#endif // DOCK_CENTRALWIDGET_H
Index: scribus/ui/docks/dock_panelbase.cpp
===================================================================
--- scribus/ui/docks/dock_panelbase.cpp	(nicht existent)
+++ scribus/ui/docks/dock_panelbase.cpp	(Arbeitskopie)
@@ -0,0 +1,92 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+
+#include "dock_panelbase.h"
+
+#include <QApplication>
+
+#include "iconmanager.h"
+#include "prefscontext.h"
+#include "prefsfile.h"
+#include "prefsmanager.h"
+
+DockPanelBase::DockPanelBase(const QString &title, QIcon icon, QWidget *parent)  : DockPanelBase(title, parent)
+{
+	this->setIcon(icon);
+}
+
+
+DockPanelBase::DockPanelBase(const QString &title, QWidget *parent) : ads::CDockWidget(title, parent)
+{
+	if (PrefsManager::instance().appPrefs.uiPrefs.useSmallWidgets)
+	{
+		setStyleSheet("	QToolButton { margin: 1px; padding: 0px; font-size: 10px; } \
+						QToolButton:pressed { padding-top: 2px; padding-left: 2px } \
+						QPushButton { margin: 1px; padding: 0px; font-size: 10px; } \
+						QPushButton:pressed { padding-top: 2px; padding-left: 2px } \
+						QRadioButton, QComboBox, QLineEdit \
+							QListView, QLabel { margin:1px; padding: 0px; font-size: 10px; } \
+						QCheckBox, QSpinBox, QDoubleSpinBox \
+							{ margin:1px; padding: 0px; font-size: 10px; } \
+						QTabWidget, QTabBar, QTableView, QGroupBox, QTreeView \
+							{ font-size: 10px ; } \
+						QToolBox::tab { font-size: 10px; padding: 0px; margin: 0px; } \
+					");
+	}
+	m_originalParent = parent;
+//	setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+	setWindowIcon(IconManager::instance().loadPixmap("AppIcon.png"));
+	setPrefsContext(title);
+	setObjectName(title);
+	connect(&PrefsManager::instance(), SIGNAL(prefsChanged()), this, SLOT(setFontSize()));
+}
+
+void DockPanelBase::setWidget(QWidget *widget)
+{
+    ads::CDockWidget::setWidget(widget);
+
+}
+
+void DockPanelBase::setPrefsContext(const QString& context)
+{
+	if (m_prefsContextName.isEmpty())
+	{
+		m_prefsContextName=context;
+		if (!m_prefsContextName.isEmpty())
+		{
+			m_palettePrefs = PrefsManager::instance().prefsFile->getContext(m_prefsContextName);
+		}
+		else
+			m_palettePrefs = nullptr;
+	}
+}
+
+void DockPanelBase::startup()
+{
+	setFontSize();
+}
+
+void DockPanelBase::setFontSize()
+{
+	QFont newfont(font());
+	newfont.setPointSize(PrefsManager::instance().appPrefs.uiPrefs.paletteFontSize);
+	setFont(newfont);
+}
+
+
Index: scribus/ui/docks/dock_panelbase.h
===================================================================
--- scribus/ui/docks/dock_panelbase.h	(nicht existent)
+++ scribus/ui/docks/dock_panelbase.h	(Arbeitskopie)
@@ -0,0 +1,58 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+
+#ifndef DOCK_PANELBASE_H
+#define DOCK_PANELBASE_H
+
+#include "third_party/Qt-Advanced-Docking-System/src/DockWidget.h"
+
+#include "scribusapi.h"
+class PrefsContext;
+
+class SCRIBUS_API DockPanelBase : public ads::CDockWidget
+{
+	Q_OBJECT
+
+public:
+    DockPanelBase(const QString &title, QWidget *parent = 0);
+    DockPanelBase(const QString &title, QIcon icon, QWidget *parent = 0);
+
+    void setWidget(QWidget *widget);
+	void startup();
+
+	// reimplement virtual functions to make plugins work that uses this class.
+//	virtual bool event(QEvent *e) {return ads::CDockWidget::event(e);}
+//	virtual QSize minimumSizeHint() const {return ads::CDockWidget::minimumSizeHint();}
+//	virtual QList<QAction*> titleBarActions() const {return ads::CDockWidget::titleBarActions();}
+
+public slots:
+	virtual void setFontSize();
+
+protected:
+	/** @brief Set the Preferences context to be used for storage of startup visibility and position and size */
+	virtual void setPrefsContext(const QString& context);
+
+	PrefsContext* m_palettePrefs {nullptr};
+	QString m_prefsContextName;
+	QWidget* m_originalParent {nullptr};
+	QWidget* m_tempParent {nullptr};
+
+};
+
+#endif // DOCK_PANELBASE_H
Index: scribus/ui/inlinepalette.cpp
===================================================================
--- scribus/ui/inlinepalette.cpp	(Revision 25545)
+++ scribus/ui/inlinepalette.cpp	(Arbeitskopie)
@@ -101,7 +101,7 @@
 	clearSelection();
 }
 
-InlinePalette::InlinePalette( QWidget* parent) : ScDockPalette(parent, "Inline", Qt::WindowFlags())
+InlinePalette::InlinePalette( QWidget* parent) : DockPanelBase("Inline", parent)
 {
 	setContentsMargins(3, 3, 3, 3);
 	setMinimumSize( QSize( 220, 240 ) );
@@ -282,7 +282,7 @@
 		languageChange();
 	}
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void InlinePalette::languageChange()
Index: scribus/ui/inlinepalette.h
===================================================================
--- scribus/ui/inlinepalette.h	(Revision 25545)
+++ scribus/ui/inlinepalette.h	(Arbeitskopie)
@@ -43,7 +43,7 @@
 
 
 #include "scribusapi.h"
-#include "scdockpalette.h"
+#include "ui/docks/dock_panelbase.h"
 #include "sclistwidgetdelegate.h"
 
 class SCRIBUS_API InlineView : public QListWidget
@@ -67,7 +67,7 @@
 	ScListWidgetDelegate* delegate { nullptr };
 };
 
-class SCRIBUS_API InlinePalette : public ScDockPalette
+class SCRIBUS_API InlinePalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/layers.cpp
===================================================================
--- scribus/ui/layers.cpp	(Revision 25545)
+++ scribus/ui/layers.cpp	(Arbeitskopie)
@@ -39,9 +39,10 @@
 #include "scribusdoc.h"
 #include "selection.h"
 #include "ui/scrspinbox.h"
+#include "docks/dock_panelbase.h"
 #include "undomanager.h"
 
-LayerPalette::LayerPalette(QWidget* parent) : ScDockPalette(parent, "Layers", Qt::WindowFlags())
+LayerPalette::LayerPalette(QWidget* parent) : DockPanelBase("Layers", parent)
 {
 	setObjectName(QString::fromLocal8Bit("Layers"));
 	setMinimumSize( QSize(220, 240) );
@@ -172,7 +173,7 @@
 
 void LayerPalette::installEventFilter(QObject *obj)
 {
-	ScDockPalette::installEventFilter(obj);
+	DockPanelBase::installEventFilter(obj);
 	Table->installEventFilter(obj);
 }
 
@@ -686,7 +689,7 @@
 	if (e->type() == QEvent::LanguageChange)
 		languageChange();
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void LayerPalette::iconSetChange()
Index: scribus/ui/layers.h
===================================================================
--- scribus/ui/layers.h	(Revision 25545)
+++ scribus/ui/layers.h	(Arbeitskopie)
@@ -10,7 +10,8 @@
 #include <QList>
 
 #include "scribusapi.h"
-#include "ui/scdockpalette.h"
+//#include "ui/scdockpalette.h"
+#include "ui/docks/dock_panelbase.h"
 #include "scribusstructs.h"
 
 class CheckBox;
@@ -27,7 +28,7 @@
 class ScrSpinBox;
 class ScribusDoc;
 
-class SCRIBUS_API LayerPalette : public ScDockPalette
+class SCRIBUS_API LayerPalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/outlinepalette.cpp
===================================================================
--- scribus/ui/outlinepalette.cpp	(Revision 25545)
+++ scribus/ui/outlinepalette.cpp	(Arbeitskopie)
@@ -431,7 +431,7 @@
 	return true;
 }
 
-OutlinePalette::OutlinePalette( QWidget* parent) : ScDockPalette(parent, "Tree", Qt::WindowFlags())
+OutlinePalette::OutlinePalette( QWidget* parent) : DockPanelBase("Tree", parent)
 {
 //	resize( 220, 240 );
 	setMinimumSize( QSize( 220, 240 ) );
@@ -506,9 +506,9 @@
 	clearPalette();
 }
 
-void OutlinePalette::setPaletteShown(bool visible)
+void OutlinePalette::toggleView(bool visible)
 {
-	ScDockPalette::setPaletteShown(visible);
+	DockPanelBase::toggleView(visible);
 	if (visible && (currDoc != nullptr))
 		BuildTree();
 }
@@ -1445,7 +1445,7 @@
 	if (e->type() == QEvent::LanguageChange)
 		languageChange();
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void OutlinePalette::iconSetChange()
Index: scribus/ui/outlinepalette.h
===================================================================
--- scribus/ui/outlinepalette.h	(Revision 25545)
+++ scribus/ui/outlinepalette.h	(Arbeitskopie)
@@ -18,6 +18,7 @@
 
 #include "scribusapi.h"
 #include "scdockpalette.h"
+#include "docks/dock_panelbase.h"
 
 class ScribusMainWindow;
 class ScribusDoc;
@@ -54,7 +55,7 @@
 	bool viewportEvent(QEvent *event) override;
 };
 
-class SCRIBUS_API OutlinePalette : public ScDockPalette
+class SCRIBUS_API OutlinePalette : public DockPanelBase
 {
 	Q_OBJECT
 
@@ -76,7 +77,7 @@
 	void iconSetChange();
 	void languageChange();
 	void slotShowSelect(int pageNr, PageItem *pageItem);
-	void setPaletteShown(bool) override;
+	void toggleView(bool);
 	void slotRightClick(QPoint point);
 	void setActiveLayer(int layerID);
 	void setLayerVisible(int layerID);
Index: scribus/ui/pagepalette.cpp
===================================================================
--- scribus/ui/pagepalette.cpp	(Revision 25545)
+++ scribus/ui/pagepalette.cpp	(Arbeitskopie)
@@ -21,7 +21,7 @@
 #include "scribusdoc.h"
 #include "scribusview.h"
 
-PagePalette::PagePalette(QWidget* parent) : ScDockPalette(parent, "PagePalette", Qt::WindowFlags())
+PagePalette::PagePalette(QWidget *parent) : DockPanelBase("PagePalette", parent)
 {
 	m_scMW = (ScribusMainWindow*) parent;
 	m_view = nullptr;
@@ -185,7 +193,7 @@
 	}
 	else
 	{
-		ScribusDoc* doc = m_view->m_doc;
+		//ScribusDoc* doc = m_view->m_doc;
 		PagePalette_MasterPages* mpWidget = this->masterpageWidget();
 		if (mpWidget->m_view != m_view)
 			mpWidget->setView(m_view, masterPage);
@@ -226,7 +234,7 @@
 		return;
 	}
 
-	ScDockPalette::changeEvent(e);
+	DockPanelBase::changeEvent(e);
 }
 
 void PagePalette::languageChange()
Index: scribus/ui/pagepalette.h
===================================================================
--- scribus/ui/pagepalette.h	(Revision 25545)
+++ scribus/ui/pagepalette.h	(Arbeitskopie)
@@ -23,19 +23,21 @@
 class TrashBin;
 
 #include "scribusapi.h"
-#include "scdockpalette.h"
+//#include "scdockpalette.h"
+#include "docks/dock_panelbase.h"
 
 class PagePalette_MasterPages;
 class PagePalette_Pages;
 class ScribusView;
 class ScribusMainWindow;
+class DockManager;
 
-class SCRIBUS_API PagePalette : public ScDockPalette
+class SCRIBUS_API PagePalette : public DockPanelBase
 {
 	Q_OBJECT
 
 public:
-	PagePalette(QWidget* parent);
+	PagePalette(QWidget *parent);
 	~PagePalette() {};
 	
 	QWidget* currentWidget();
Index: scribus/ui/propertiespalette.cpp
===================================================================
--- scribus/ui/propertiespalette.cpp	(Revision 25545)
+++ scribus/ui/propertiespalette.cpp	(Arbeitskopie)
@@ -46,7 +46,7 @@
 #include "util_math.h"
 
 
-PropertiesPalette::PropertiesPalette( QWidget* parent) : ScDockPalette(parent, "PropertiesPalette", Qt::WindowFlags())
+PropertiesPalette::PropertiesPalette(QWidget *parent) : DockPanelBase("PropertiesPalette", parent)
 {
 	undoManager = UndoManager::instance();
 
@@ -109,7 +109,7 @@
 			m_ScMW->view->RefreshGradient(m_item);
 		}
 	}
-	ScDockPalette::closeEvent(closeEvent);
+	DockPanelBase::closeEvent(closeEvent);
 }
 
 void PropertiesPalette::setMainWindow(ScribusMainWindow* mw)
@@ -735,7 +737,7 @@
 		languageChange();
 		return;
 	}
-	ScDockPalette::changeEvent(e);
+	DockPanelBase::changeEvent(e);
 }
 
 void PropertiesPalette::languageChange()
Index: scribus/ui/propertiespalette.h
===================================================================
--- scribus/ui/propertiespalette.h	(Revision 25545)
+++ scribus/ui/propertiespalette.h	(Arbeitskopie)
@@ -30,6 +30,7 @@
 #include "sctreewidget.h"
 #include "stylecombos.h"
 #include "units.h"
+#include "docks/dock_panelbase.h"
 
 class ColorCombo;
 class ColorPalette;
@@ -46,7 +47,7 @@
 class UndoManager;
 class TransparencyPalette;
 
-class SCRIBUS_API PropertiesPalette : public ScDockPalette
+class SCRIBUS_API PropertiesPalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/scrapbookpalette.cpp
===================================================================
--- scribus/ui/scrapbookpalette.cpp	(Revision 25545)
+++ scribus/ui/scrapbookpalette.cpp	(Arbeitskopie)
@@ -715,7 +715,7 @@
 }
 
 /* This is the main Dialog-Class for the Scrapbook */
-Biblio::Biblio(QWidget* parent) : ScDockPalette(parent, "Sclib", Qt::WindowFlags())
+Biblio::Biblio(QWidget* parent) : DockPanelBase("Sclib", parent)
 {
 	setObjectName(QString::fromLocal8Bit("Sclib"));
 	setMinimumSize( QSize(220, 240) );
@@ -2003,7 +2003,7 @@
 	if (e->type() == QEvent::LanguageChange)
 		languageChange();
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void Biblio::iconSetChange()
Index: scribus/ui/scrapbookpalette.h
===================================================================
--- scribus/ui/scrapbookpalette.h	(Revision 25545)
+++ scribus/ui/scrapbookpalette.h	(Arbeitskopie)
@@ -15,8 +15,9 @@
 class QEvent;
 
 #include "scribusapi.h"
-#include "scdockpalette.h"
+//#include "scdockpalette.h"
 #include "scribusstructs.h"
+#include "ui/docks/dock_panelbase.h"
 
 class QHBoxLayout;
 class QToolButton;
@@ -67,7 +68,7 @@
 	void startDrag(Qt::DropActions supportedActions) override;
 };
 
-class SCRIBUS_API Biblio : public ScDockPalette
+class SCRIBUS_API Biblio : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/symbolpalette.cpp
===================================================================
--- scribus/ui/symbolpalette.cpp	(Revision 25545)
+++ scribus/ui/symbolpalette.cpp	(Arbeitskopie)
@@ -150,7 +150,7 @@
 	clearSelection();
 }
 
-SymbolPalette::SymbolPalette( QWidget* parent) : ScDockPalette(parent, "Symb", Qt::WindowFlags())
+SymbolPalette::SymbolPalette( QWidget* parent) : DockPanelBase("Symb", parent)
 {
 	setContentsMargins(3, 3, 3, 3);
 	setMinimumSize( QSize( 220, 240 ) );
@@ -321,7 +321,7 @@
 		languageChange();
 	}
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void SymbolPalette::languageChange()
Index: scribus/ui/symbolpalette.h
===================================================================
--- scribus/ui/symbolpalette.h	(Revision 25545)
+++ scribus/ui/symbolpalette.h	(Arbeitskopie)
@@ -41,8 +41,9 @@
 
 
 #include "scribusapi.h"
-#include "scdockpalette.h"
+//#include "scdockpalette.h"
 #include "sclistwidgetdelegate.h"
+#include "ui/docks/dock_panelbase.h"
 
 class SCRIBUS_API SymbolView : public QListWidget
 {
@@ -70,7 +71,7 @@
 	ScListWidgetDelegate* m_delegate { nullptr };
 };
 
-class SCRIBUS_API SymbolPalette : public ScDockPalette
+class SCRIBUS_API SymbolPalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/undogui.cpp
===================================================================
--- scribus/undogui.cpp	(Revision 25545)
+++ scribus/undogui.cpp	(Arbeitskopie)
@@ -38,7 +38,7 @@
 #include "undogui.h"
 
 
-UndoGui::UndoGui(QWidget* parent, const char* name, Qt::WindowFlags f) : ScDockPalette(parent, name, f)
+UndoGui::UndoGui(QWidget* parent, const char* name) : DockPanelBase(name, parent)
 {
 	languageChange();
 }
@@ -184,9 +184,9 @@
 
 /*** UndoPalette **************************************************************/
 
-UndoPalette::UndoPalette(QWidget* parent, const char* name) : UndoGui(parent, name)
+UndoPalette::UndoPalette(QWidget* parent) : UndoGui(parent, "undoPalette")
 {
-	setObjectName(QString::fromLocal8Bit(name));
+	setObjectName(QString::fromLocal8Bit("undoPalette"));
 	setMinimumSize( QSize(220, 240) );
 	setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
 
Index: scribus/undogui.h
===================================================================
--- scribus/undogui.h	(Revision 25545)
+++ scribus/undogui.h	(Arbeitskopie)
@@ -33,7 +33,8 @@
 #include "scribusapi.h"
 #include "undoobject.h"
 #include "undostate.h"
-#include "ui/scdockpalette.h"
+//#include "ui/scdockpalette.h"
+#include "ui/docks/dock_panelbase.h"
 
 class QEvent;
 class QMenu;
@@ -56,18 +57,18 @@
  * @author Riku Leino  tsoots@gmail.com
  * @date December 2004
  */
-class SCRIBUS_API UndoGui : public ScDockPalette
+class SCRIBUS_API UndoGui : public DockPanelBase
 {
 	Q_OBJECT
 
 public:
 	/**
-	 * @brief Creates a new UndoGui instance. 
+	 * @brief Creates a new UndoGui instance.
 	 * @param parent Parent object for UndoGui
 	 * @param name Name of the object
 	 * @param f widget flags
 	 */
-	UndoGui(QWidget* parent = nullptr, const char* name = "UndoGui", Qt::WindowFlags f = Qt::WindowFlags());
+	UndoGui(QWidget* parent = nullptr, const char* name = "UndoGui");
 
 	/** @brief Destroys the widget */
 	virtual ~UndoGui() {}
@@ -268,7 +269,7 @@
 	 * Creates a new UndoPalette instance. After creation of an UndoPalette it must
 	 * be registered to the UndoManager with UndoManager's registerGui() method.
 	 */
-	UndoPalette(QWidget* parent = nullptr, const char* name = 0);
+	UndoPalette(QWidget* parent = nullptr);
 
 	/** @brief Destroys the widget */
 	~UndoPalette() = default;
ads_23-07-09_01.patch (191,020 bytes)   

cbradney

2023-07-09 21:19

administrator   ~0050272

Thanks Martin. Looking forward to an updated patch, as wlel as there are 2 missing action icon svgs.

nitramr

2023-07-12 20:54

developer   ~0050273

Patch Notes:

1. all QDockWidgets are replaced for all palettes
2. a new DockManager has been added to manage palettes and GUI layouts
3. a new central widget has been added to show mdi windows
4. GUI automatically saves the status on close
5. GUI automatically restore the status on startup
6. Support for plugins works
7. "undefined symbol" fix by set qt6advanceddocking library to public in CMake file

Leftovers:

- ScDockPalette still exists but is unused now
- implementation for scribusindigomainwindow is still there but not necessary anymore
ads_23-07-12_01.patch (195,430 bytes)   
Index: resources/iconsets/1_7_0/1_7_0.xml
===================================================================
--- resources/iconsets/1_7_0/1_7_0.xml	(Revision 25546)
+++ resources/iconsets/1_7_0/1_7_0.xml	(Arbeitskopie)
@@ -365,6 +365,10 @@
 		<icon id="/16/list-remove.png" file="16/action-remove.svg" />
 		<icon id="16/list-remove.png" file="16/action-remove.svg" />
 		<icon id="22/list-remove.png" file="16/action-remove.svg" />
+		<icon id="page-move" file="16/page-move.svg" />
+		<icon id="page-insert" file="16/page-insert.svg" />
+		<icon id="page-duplicate" file="16/page-duplicate.svg" />
+		<icon id="page-import" file="16/page-import.svg" />
     
 		<!-- PDF Tools -->
 		<icon id="16/insert-button.png" file="16/pdf-button.svg" />
@@ -551,7 +555,14 @@
 		<icon id="wizard16.png" file="16/tool-copy-style.svg" />
 		<!-- Red onLight="#E54545" onDark="#FF6666" -->
 		<icon id="16/insert-barcode.png" file="16/tool-insert-barcode.svg" />
-		<icon id="22/insert-barcode.png" file="16/tool-insert-barcode.svg" /> 
+		<icon id="22/insert-barcode.png" file="16/tool-insert-barcode.svg" />
 		
+		<!-- Windows -->
+		<!--		
+		<icon id="close" file="16/action-close.svg" />
+		<icon id="menu-down" file="16/action-chevron-down.svg" />
+		<icon id="dock-float" file="16/action-window-float.svg" />
+		-->
+		
 	</icons>
 </iconset>
Index: scribus/CMakeLists.txt
===================================================================
--- scribus/CMakeLists.txt	(Revision 25546)
+++ scribus/CMakeLists.txt	(Arbeitskopie)
@@ -285,7 +285,7 @@
 )
 
 if(WANT_QTADS)
-  target_link_libraries(${EXE_NAME} PRIVATE qt6advanceddocking)
+  target_link_libraries(${EXE_NAME} PUBLIC qt6advanceddocking)
 endif()
 
 if(WITH_TESTS)
Index: scribus/CMakeLists_Sources.txt
===================================================================
--- scribus/CMakeLists_Sources.txt	(Revision 25546)
+++ scribus/CMakeLists_Sources.txt	(Arbeitskopie)
@@ -257,6 +257,7 @@
 	imagedataloaders/scimgdataloader_qt.cpp
 	imagedataloaders/scimgdataloader_tiff.cpp
 	imagedataloaders/scimgdataloader_wpg.cpp
+	manager/dock_manager.cpp
 	palettes/cxfcolor.cpp
 	palettes/cxfcolorspecification.cpp
 	palettes/cxfdocument.cpp
@@ -535,6 +536,8 @@
 	ui/vruler.cpp
 	ui/useprintermarginsdialog.cpp
 	ui/weldedit.cpp
+	ui/docks/dock_centralwidget.cpp
+	ui/docks/dock_panelbase.cpp
 	${SCRIBUS_OSG_SRC}
 	${SCRIBUS_GMAGICK_SRC}
 	${SCRIBUS_JPEGXL_SRC}
Index: scribus/manager/dock_manager.cpp
===================================================================
--- scribus/manager/dock_manager.cpp	(nicht existent)
+++ scribus/manager/dock_manager.cpp	(Arbeitskopie)
@@ -0,0 +1,175 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+#include "dock_manager.h"
+
+#include "ui/docks/dock_centralwidget.h"
+#include "third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.h"
+#include <QMenu>
+
+#include "ui/pagepalette.h"
+#include "ui/outlinepalette.h"
+#include "ui/propertiespalette.h"
+#include "ui/contentpalette.h"
+#include "ui/layers.h"
+#include "ui/aligndistribute.h"
+#include "ui/inlinepalette.h"
+#include "ui/bookmarkpalette.h"
+#include "ui/scrapbookpalette.h"
+#include "ui/symbolpalette.h"
+#include "undogui.h"
+#include "prefsmanager.h"
+#include "prefsfile.h"
+
+//#include "icon_manager.h"
+
+/* ********************************************************************************* *
+ *
+ * Constructor + Setup
+ *
+ * ********************************************************************************* */
+
+DockManager::DockManager(QWidget *parent) : CDockManager(parent)
+{
+	dockCenter = new DockCentralWidget();
+	auto * areaCenter = CDockManager::setCentralWidget(dockCenter);
+	areaCenter->setAllowedAreas(DockWidgetArea::OuterDockAreas);
+
+	m_palettePrefs = PrefsManager::instance().prefsFile->getContext("user_preferences");
+
+}
+
+void DockManager::setupDocks()
+{
+	pagePalette = new PagePalette((QWidget*)this->parent());
+	contentPalette = new ContentPalette(this);
+	propertiesPalette = new PropertiesPalette(this);
+	outlinePalette = new OutlinePalette(this);
+	layerPalette = new LayerPalette(this);
+	inlinePalette = new InlinePalette(this);
+	alignDistributePalette = new AlignDistributePalette();
+	scrapbookPalette = new Biblio(this);
+	bookPalette = new BookPalette(this);
+	undoPalette = new UndoPalette(this);
+	symbolPalette = new SymbolPalette(this);
+
+    // Panel ToolProperties
+//    PanelToolProperties * panelTest = new PanelToolProperties();
+//    dockToolProperties->setWidget(panelTest);
+//    dockToolProperties->setFeature(ads::CDockWidget::NoTab, true);
+}
+
+
+void DockManager::setCentralWidget(QWidget *widget)
+{
+	dockCenter->setWidget(widget);
+}
+
+/* ********************************************************************************* *
+ *
+ * Public Methods
+ *
+ * ********************************************************************************* */
+
+void DockManager::loadDefaultWorkspace()
+{
+
+	// Left
+	auto * areaLeft = addDockWidget(LeftDockWidgetArea, pagePalette, dockCenter->dockAreaWidget());
+	addDockWidget(CenterDockWidgetArea, outlinePalette, areaLeft);
+	addDockWidget(CenterDockWidgetArea, inlinePalette, areaLeft);
+	addDockWidget(CenterDockWidgetArea, scrapbookPalette, areaLeft);
+	addDockWidget(CenterDockWidgetArea, bookPalette, areaLeft);
+	addDockWidget(CenterDockWidgetArea, symbolPalette, areaLeft);
+
+	// Left Bottom
+	auto * areaLeftBottom = addDockWidget(BottomDockWidgetArea, layerPalette, areaLeft);
+	addDockWidget(CenterDockWidgetArea, alignDistributePalette, areaLeftBottom);
+	addDockWidget(CenterDockWidgetArea, undoPalette, areaLeftBottom);
+
+	// Right Panel
+	auto * areaRight = addDockWidget(RightDockWidgetArea, propertiesPalette, dockCenter->dockAreaWidget());
+	addDockWidget(CenterDockWidgetArea, contentPalette, areaRight);
+
+	// active palettes
+	areaLeft->setCurrentDockWidget(pagePalette);
+	areaRight->setCurrentDockWidget(propertiesPalette);
+	areaLeftBottom->setCurrentDockWidget(layerPalette);
+
+
+    // Top Panel
+//    auto * areaTop = addDockWidget(TopDockWidgetArea, dockToolProperties);
+//    areaTop->setAllowedAreas(NoDockWidgetArea);
+//    areaTop->setDockAreaFlag(CDockAreaWidget::HideSingleWidgetTitleBar, true);
+
+	inlinePalette->toggleView(false);
+	scrapbookPalette->toggleView(false);
+	bookPalette->toggleView(false);
+	symbolPalette->toggleView(false);
+
+	this->addPerspective("Default");
+
+	if(!m_palettePrefs->get("ads_dockstate").isEmpty())
+		loadWorkspaceFromFile();
+
+}
+
+void DockManager::setTheme(QString theme)
+{
+	setStyleSheet(theme);
+}
+
+void DockManager::removeAllDockWidgets()
+{
+	QMap<QString, CDockWidget*> map = dockWidgetsMap();
+	foreach( QString key, map.keys() )
+	{
+		removeDockWidget(map.value(key));
+	}
+}
+
+CDockAreaWidget* DockManager::addDockFromPlugin(CDockWidget *dock, bool closed)
+{
+	CDockAreaWidget* a = addDockWidget(LeftDockWidgetArea, dock, dockCenter->dockAreaWidget());
+
+	dock->setFloating();
+//	if(closed){
+//		dock->toggleView(false);
+//	}
+	return a;
+}
+
+void DockManager::loadWorkspaceFromFile()
+{
+	if(m_palettePrefs)
+	{
+		QByteArray ba = QByteArray::fromHex(m_palettePrefs->get("ads_dockstate").toLatin1());
+		this->restoreState(ba);
+	}
+}
+
+void DockManager::saveWorkspaceToFile()
+{
+	if(m_palettePrefs)
+	{
+		QByteArray data = this->saveState();
+		QString s = data.toHex();
+		m_palettePrefs->set("ads_dockstate", s);
+	}
+}
+
Index: scribus/manager/dock_manager.h
===================================================================
--- scribus/manager/dock_manager.h	(nicht existent)
+++ scribus/manager/dock_manager.h	(Arbeitskopie)
@@ -0,0 +1,79 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+#ifndef DOCK_MANAGER_H
+#define DOCK_MANAGER_H
+
+#include "prefscontext.h"
+#include "scribusapi.h"
+#include "third_party/Qt-Advanced-Docking-System/src/DockManager.h"
+
+using namespace ads;
+
+class ScribusMainWindow;
+class PagePalette;
+class OutlinePalette;
+class PropertiesPalette;
+class ContentPalette;
+class LayerPalette;
+class AlignDistributePalette;
+class InlinePalette;
+class Biblio;
+class BookPalette;
+class UndoPalette;
+class SymbolPalette;
+class DockCentralWidget;
+
+class SCRIBUS_API DockManager : public CDockManager
+{
+    Q_OBJECT
+
+public:
+	DockManager(QWidget *parent);
+
+	void setCentralWidget(QWidget * widget);
+	void setupDocks();
+	void loadDefaultWorkspace();
+	void setTheme(QString theme);
+	void removeAllDockWidgets();
+	CDockAreaWidget* addDockFromPlugin(CDockWidget * dock, bool closed = true);
+
+
+	PagePalette *pagePalette {nullptr};
+	OutlinePalette * outlinePalette {nullptr};
+	PropertiesPalette * propertiesPalette {nullptr};
+	ContentPalette * contentPalette {nullptr};
+	LayerPalette * layerPalette {nullptr};
+	AlignDistributePalette * alignDistributePalette {nullptr};
+	InlinePalette * inlinePalette {nullptr};
+	Biblio * scrapbookPalette {nullptr};
+	BookPalette * bookPalette {nullptr};
+	UndoPalette * undoPalette {nullptr};
+	SymbolPalette * symbolPalette {nullptr};
+
+public slots:
+	void loadWorkspaceFromFile();
+	void saveWorkspaceToFile();
+
+private:
+	DockCentralWidget * dockCenter {nullptr};
+	PrefsContext* m_palettePrefs {nullptr};
+
+};
+
+#endif // DOCK_MANAGER_H
Index: scribus/plugins/shapes/shapepalette.cpp
===================================================================
--- scribus/plugins/shapes/shapepalette.cpp	(Revision 25546)
+++ scribus/plugins/shapes/shapepalette.cpp	(Arbeitskopie)
@@ -21,6 +21,7 @@
  *                                                                         *
  ***************************************************************************/
 #include "iconmanager.h"
+#include "manager/dock_manager.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"
 #include "scmimedata.h"
@@ -31,6 +32,7 @@
 #include "scribusXml.h"
 #include "selection.h"
 #include "shapepalette.h"
+#include "third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.h"
 #include "ui/scmessagebox.h"
 #include "util.h"
 #include "util_math.h"
@@ -278,7 +280,7 @@
 	}
 }
 
-ShapePalette::ShapePalette( QWidget* parent) : ScDockPalette(parent, "Shap", Qt::WindowFlags())
+ShapePalette::ShapePalette(QWidget *parent) : DockPanelBase("Shap", parent)
 {
 	setMinimumSize( QSize( 220, 240 ) );
 	setObjectName(QString::fromLocal8Bit("Shap"));
@@ -593,7 +595,7 @@
 		languageChange();
 	}
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void ShapePalette::iconSetChange()
Index: scribus/plugins/shapes/shapepalette.h
===================================================================
--- scribus/plugins/shapes/shapepalette.h	(Revision 25546)
+++ scribus/plugins/shapes/shapepalette.h	(Arbeitskopie)
@@ -40,7 +40,8 @@
 
 
 #include "pluginapi.h"
-#include "ui/scdockpalette.h"
+//#include "ui/scdockpalette.h"
+#include "ui/docks/dock_panelbase.h"
 #include "ui/sclistwidgetdelegate.h"
 #include "fpointarray.h"
 
@@ -85,12 +86,12 @@
 	ScListWidgetDelegate* delegate;
 };
 
-class PLUGIN_API ShapePalette : public ScDockPalette
+class PLUGIN_API ShapePalette : public DockPanelBase
 {
 	Q_OBJECT
 
 public:
-	ShapePalette(QWidget* parent);
+	ShapePalette(QWidget *parent);
 	~ShapePalette() {};
 
 	void writeToPrefs();
Index: scribus/plugins/shapes/shapeplugin.cpp
===================================================================
--- scribus/plugins/shapes/shapeplugin.cpp	(Revision 25546)
+++ scribus/plugins/shapes/shapeplugin.cpp	(Arbeitskopie)
@@ -69,15 +69,18 @@
 	if (!sc_palette)
 		return;
 
-	sc_palette->setMainWindow(mw);
+	sc_palette->setMainWindow(mw);	
 	languageChange();
 	m_actions.insert("shapeShowPalette", new ScrAction(QObject::tr("Custom Shapes"), QKeySequence(), this));
 	m_actions["shapeShowPalette"]->setToggleAction(true);
 	m_actions["shapeShowPalette"]->setChecked(false);
-	connect(m_actions["shapeShowPalette"], SIGNAL(toggled(bool)), sc_palette, SLOT(setPaletteShown(bool)));
-	connect(sc_palette, SIGNAL(paletteShown(bool)), m_actions["shapeShowPalette"], SLOT(setChecked(bool)));
+	connect(m_actions["shapeShowPalette"], SIGNAL(toggled(bool)), sc_palette, SLOT(toggleView(bool)));
+	connect(sc_palette, SIGNAL(viewToggled(bool)), m_actions["shapeShowPalette"], SLOT(setChecked(bool)));
 	mw->scrMenuMgr->addMenuItemStringAfter("shapeShowPalette", "toolsInline", "Windows");
 	mw->scrMenuMgr->addMenuItemStringsToMenuBar("Windows", m_actions);
+
+	// For some reason we can't call addDockWidget(...) directly. If we do so Scribus crashes.
+	mw->dockManager->addDockFromPlugin(sc_palette);
 }
 
 QString ShapePlugin::fullTrName() const
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(Revision 25546)
+++ scribus/scribus.cpp	(Arbeitskopie)
@@ -240,6 +240,7 @@
 #include "util.h"
 #include "util_file.h"
 #include "util_formats.h"
+#include "third_party/Qt-Advanced-Docking-System/src/IconProvider.h"
 
 #ifdef HAVE_SVNVERSION
 	#include "svnversion.h"
@@ -259,6 +260,7 @@
 #include "sclimits.h"
 
 using namespace std;
+using namespace ads;
 
 bool previewDinUse;
 bool printDinUse;
@@ -273,11 +275,13 @@
 ScribusMainWindow::ScribusMainWindow() :
 	m_prefsManager(PrefsManager::instance())
 {
+
 #ifdef Q_OS_MACOS
 	//commenting this out until this is resolved :https://bugreports.qt.io/browse/QTBUG-44565
 	//ScQApp->setAttribute(Qt::AA_DontShowIconsInMenus);
 	//noIcon = IconManager::instance().loadPixmap("noicon.png");
 #endif
+
 }
 
 /*
@@ -285,6 +289,32 @@
  */
 int ScribusMainWindow::initScMW(bool primaryMainWindow)
 {
+	// Documentation: https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/blob/master/doc/user-guide.md
+	CDockManager::setConfigFlag(CDockManager::AlwaysShowTabs, false);
+	CDockManager::setConfigFlag(CDockManager::FloatingContainerHasWidgetIcon, true);
+	CDockManager::setConfigFlag(CDockManager::FloatingContainerHasWidgetTitle, true);
+	CDockManager::setConfigFlag(CDockManager::HideSingleCentralWidgetTitleBar, false);
+	CDockManager::setConfigFlag(CDockManager::OpaqueSplitterResize, true);
+	CDockManager::setConfigFlag(CDockManager::TabCloseButtonIsToolButton, true);
+	CDockManager::setConfigFlag(CDockManager::AllTabsHaveCloseButton, false);
+	CDockManager::setConfigFlag(CDockManager::DockAreaDynamicTabsMenuButtonVisibility, true);
+	CDockManager::setConfigFlag(CDockManager::DockAreaHasCloseButton, false);
+	CDockManager::setConfigFlag(CDockManager::DockAreaHasUndockButton, false);
+	CDockManager::setConfigFlag(CDockManager::DockAreaHideDisabledButtons, true);
+	CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true);
+
+	// Documentation: https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/blob/master/doc/user-guide.md#auto-hide-configuration-flags
+//	CDockManager::setAutoHideConfigFlags(CDockManager::DefaultAutoHideConfig);
+//	CDockManager::setAutoHideConfigFlag(CDockManager::AutoHideShowOnMouseOver, true);
+//	CDockManager::setAutoHideConfigFlag(CDockManager::AutoHideCloseButtonCollapsesDock, true);
+//	CDockManager::setAutoHideConfigFlag(CDockManager::AutoHideButtonTogglesArea, true);
+
+//	IconManager &iconmanager = IconManager::instance();
+//	CDockManager::iconProvider().registerCustomIcon(TabCloseIcon, iconmanager.loadPixmap("close"));
+//	CDockManager::iconProvider().registerCustomIcon(DockAreaCloseIcon, iconmanager.loadPixmap("close"));
+//	CDockManager::iconProvider().registerCustomIcon(DockAreaMenuIcon, iconmanager.loadPixmap("menu-down"));
+//	CDockManager::iconProvider().registerCustomIcon(DockAreaUndockIcon, iconmanager.loadPixmap("dock-float"));
+
 	int retVal=0;
 	//qsrand(1234);
 	QByteArray stylesheet;
@@ -323,6 +353,7 @@
 	appModeHelper = new AppModeHelper();
 	appModeHelper->setup(actionManager, &scrActions, &scrRecentFileActions, &scrWindowsActions, &scrScrapActions, &scrLayersActions, &scrRecentPasteActions);
 	scrMenuMgr = new ScMWMenuManager(menuBar(), actionManager);
+	dockManager = new DockManager(this/*, QString(stylesheet)*/); // style sheet should be enabled when theme manager is implemented to handle color palettes in css file.
 	m_formatsManager = FormatsManager::instance();
 	m_objectSpecificUndo = false;
 
@@ -338,7 +369,6 @@
 	QApplication::processEvents();
 
 	actionManager->init(this);
-
 	initMdiArea();
 	initMenuBar();
 	createMenuBar();
@@ -346,12 +376,10 @@
 	ScCore->pluginManager->setupPluginActions(this);
 	ScCore->pluginManager->enableOnlyStartupPluginActions(this);
 	ScCore->pluginManager->languageChange();
-
 	if (primaryMainWindow)
 		ScCore->setSplashStatus( tr("Applying User Shortcuts") );
 	m_prefsManager.applyLoadedShortCuts();
 	initKeyboardShortcuts();
-
 	resize(800, 600);
 	connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(newActWin(QMdiSubWindow*)));
 	//Connect windows cascade and tile actions to the workspace after its created. Only depends on mdiArea created.
@@ -359,7 +387,6 @@
 	connect( scrActions["windowsTile"], SIGNAL(triggered()) , mdiArea, SLOT(tileSubWindows()) );
 	initPalettes();
 
-
 	viewToolBar->previewQualitySwitcher->setCurrentIndex(m_prefsManager.appPrefs.itemToolPrefs.imageLowResType);
 	if (primaryMainWindow)
 		ScCore->setSplashStatus( tr("Initializing Story Editor") );
@@ -366,7 +393,6 @@
 	storyEditor = new StoryEditor(this);
 
 	DocDir = m_prefsManager.documentDir();
-
 	if (primaryMainWindow)
 		ScCore->setSplashStatus( tr("Initializing Languages") );
 	LanguageManager::instance();
@@ -378,7 +404,6 @@
 	if (primaryMainWindow)
 		ScCore->setSplashStatus( tr("Reading Scrapbook") );
 	initScrapbook();
-
 	scrActions["helpTooltips"]->setChecked(m_prefsManager.appPrefs.displayPrefs.showToolTips);
 	scrActions["showMouseCoordinates"]->setChecked(m_prefsManager.appPrefs.displayPrefs.showMouseCoordinates);
 	scrActions["stickyTools"]->setChecked(m_prefsManager.appPrefs.uiPrefs.stickyTools);
@@ -646,51 +671,75 @@
 {
 	//CB TODO hide the publicly available members of some palettes
 	// these must be filtered too as they take control of the palettes events
-	outlinePalette = new OutlinePalette(this);
+
+	dockManager->setupDocks();
+
+	// Outliner
+	outlinePalette = dockManager->outlinePalette;
 	outlinePalette->setMainWindow(this);
-	connect( scrActions["toolsOutline"], SIGNAL(toggled(bool)) , outlinePalette, SLOT(setPaletteShown(bool)));
-	connect( outlinePalette, SIGNAL(paletteShown(bool)), scrActions["toolsOutline"], SLOT(setChecked(bool)));
+	connect( scrActions["toolsOutline"], SIGNAL(toggled(bool)) , outlinePalette, SLOT(toggleView(bool)));
+	connect( outlinePalette, SIGNAL(viewToggled(bool)), scrActions["toolsOutline"], SLOT(setChecked(bool)));
 
-	propertiesPalette = new PropertiesPalette(this);
+	// Frame Properties
+	propertiesPalette = dockManager->propertiesPalette;
 	propertiesPalette->setMainWindow(this);
-	connect( scrActions["toolsProperties"], SIGNAL(toggled(bool)) , propertiesPalette, SLOT(setPaletteShown(bool)));
-	connect( propertiesPalette, SIGNAL(paletteShown(bool)), scrActions["toolsProperties"], SLOT(setChecked(bool)));
+	connect( scrActions["toolsProperties"], SIGNAL(toggled(bool)) , propertiesPalette, SLOT(toggleView(bool)));
+	connect( propertiesPalette, SIGNAL(viewToggled(bool)), scrActions["toolsProperties"], SLOT(setChecked(bool)));
 	emit UpdateRequest(reqDefFontListUpdate);
 	propertiesPalette->installEventFilter(this);
 
-	contentPalette = new ContentPalette(this);
+	// Content Properties
+	contentPalette = dockManager->contentPalette;
 	contentPalette->setMainWindow(this);
-	connect( scrActions["toolsContent"], &QAction::toggled, contentPalette, &ContentPalette::setPaletteShown);
-	connect( contentPalette, &ContentPalette::paletteShown, scrActions["toolsContent"], &QAction::setChecked);
+	connect( scrActions["toolsContent"], SIGNAL(toggled(bool)), contentPalette, SLOT(toggleView(bool)));
+	connect( contentPalette, SIGNAL(viewToggled(bool)), scrActions["toolsContent"], SLOT(setChecked(bool)));
 	contentPalette->installEventFilter(this);
 
+	// Nodes
 	nodePalette = new NodePalette(this);
 	nodePalette->installEventFilter(this);
-	layerPalette = new LayerPalette(this);
+
+	// Guides
 	guidePalette = new GuideManager(this);
+
+	// Character Selection
 	charPalette = new CharSelect(this);
-	connect( scrActions["toolsLayers"], SIGNAL(toggled(bool)) , layerPalette, SLOT(setPaletteShown(bool)));
-	connect( layerPalette, SIGNAL(paletteShown(bool)), scrActions["toolsLayers"], SLOT(setChecked(bool)));
+
+	// Layer
+	layerPalette = dockManager->layerPalette;
+	connect( scrActions["toolsLayers"], SIGNAL(toggled(bool)) , layerPalette, SLOT(toggleView(bool)));
+	connect( layerPalette, SIGNAL(viewToggled(bool)), scrActions["toolsLayers"], SLOT(setChecked(bool)));
 	layerPalette->installEventFilter(this);
-	scrapbookPalette = new Biblio(this);
-	connect( scrActions["toolsScrapbook"], SIGNAL(toggled(bool)) , scrapbookPalette, SLOT(setPaletteShown(bool)));
-	connect( scrapbookPalette, SIGNAL(paletteShown(bool)), scrActions["toolsScrapbook"], SLOT(setChecked(bool)));
+
+	// Scrapbook
+	scrapbookPalette = dockManager->scrapbookPalette;
+	connect( scrActions["toolsScrapbook"], SIGNAL(toggled(bool)) , scrapbookPalette, SLOT(toggleView(bool)));
+	connect( scrapbookPalette, SIGNAL(viewToggled(bool)), scrActions["toolsScrapbook"], SLOT(setChecked(bool)));
 	connect( scrapbookPalette, SIGNAL(pasteToActualPage(QString)), this, SLOT(pasteFromScrapbook(QString)));
 	connect( scrapbookPalette, SIGNAL(scrapbookListChanged()), this, SLOT(rebuildScrapbookMenu()));
 	scrapbookPalette->installEventFilter(this);
-	pagePalette = new PagePalette(this);
-	connect( scrActions["toolsPages"], SIGNAL(toggled(bool)) , pagePalette, SLOT(setPaletteShown(bool)) );
-	connect( pagePalette, SIGNAL(paletteShown(bool)), scrActions["toolsPages"], SLOT(setChecked(bool)));
+
+	// Pages
+	pagePalette = dockManager->pagePalette;
+	pagePalette->setMainWindow(this);
+	connect( scrActions["toolsPages"], SIGNAL(toggled(bool)) , pagePalette, SLOT(toggleView(bool)) );
+	connect( pagePalette, SIGNAL(viewToggled(bool)), scrActions["toolsPages"], SLOT(setChecked(bool)));
 	pagePalette->installEventFilter(this);
-	bookmarkPalette = new BookPalette(this);
-	connect( scrActions["toolsBookmarks"], SIGNAL(toggled(bool)) , bookmarkPalette, SLOT(setPaletteShown(bool)) );
-	connect( bookmarkPalette, SIGNAL(paletteShown(bool)), scrActions["toolsBookmarks"], SLOT(setChecked(bool)));
+
+	// Bookmark
+	bookmarkPalette = dockManager->bookPalette;
+	connect( scrActions["toolsBookmarks"], SIGNAL(toggled(bool)) , bookmarkPalette, SLOT(toggleView(bool)) );
+	connect( bookmarkPalette, SIGNAL(viewToggled(bool)), scrActions["toolsBookmarks"], SLOT(setChecked(bool)));
 	bookmarkPalette->installEventFilter(this);
+
+	// Downloads
 	downloadsPalette = new DownloadsPalette(this);
 	connect( scrActions["toolsDownloads"], SIGNAL(toggled(bool)) , downloadsPalette, SLOT(setPaletteShown(bool)) );
 	connect( downloadsPalette, SIGNAL(paletteShown(bool)), scrActions["toolsDownloads"], SLOT(setChecked(bool)));
 	downloadsPalette->installEventFilter(this);
 	connect( scrActions["toolsMeasurements"], SIGNAL(toggledData(bool,int)) , this, SLOT(setAppModeByToggle(bool,int)) );
+
+	// Preflight
 	docCheckerPalette = new CheckDocument(this, false);
 	connect( scrActions["toolsPreflightVerifier"], SIGNAL(toggled(bool)) , docCheckerPalette, SLOT(setPaletteShown(bool)) );
 	connect( scrActions["toolsPreflightVerifier"], SIGNAL(toggled(bool)) , this, SLOT(docCheckToggle(bool)) );
@@ -699,36 +748,38 @@
 	docCheckerPalette->installEventFilter(this);
 	docCheckerPalette->hide();
 
-	alignDistributePalette = new AlignDistributePalette(this, "AlignDistributePalette");
-	connect( scrActions["toolsAlignDistribute"], SIGNAL(toggled(bool)) , alignDistributePalette, SLOT(setPaletteShown(bool)) );
-	connect( alignDistributePalette, SIGNAL(paletteShown(bool)), scrActions["toolsAlignDistribute"], SLOT(setChecked(bool)));
+	// Align & Distribute
+	alignDistributePalette = dockManager->alignDistributePalette;
+	connect( scrActions["toolsAlignDistribute"], SIGNAL(toggled(bool)) , alignDistributePalette, SLOT(toggleView(bool)) );
+	connect( alignDistributePalette, SIGNAL(viewToggled(bool)), scrActions["toolsAlignDistribute"], SLOT(setChecked(bool)));
 	connect( alignDistributePalette, SIGNAL(documentChanged()), this, SLOT(slotDocCh()));
 	alignDistributePalette->installEventFilter(this);
 
-	symbolPalette = new SymbolPalette(this);
+	// Symbols
+	symbolPalette = dockManager->symbolPalette;
 	symbolPalette->setMainWindow(this);
-	connect(scrActions["toolsSymbols"], SIGNAL(toggled(bool)), symbolPalette, SLOT(setPaletteShown(bool)));
-	connect(symbolPalette, SIGNAL(paletteShown(bool)), scrActions["toolsSymbols"], SLOT(setChecked(bool)));
+	connect(scrActions["toolsSymbols"], SIGNAL(toggled(bool)), symbolPalette, SLOT(toggleView(bool)) );
+	connect(symbolPalette, SIGNAL(viewToggled(bool)), scrActions["toolsSymbols"], SLOT(setChecked(bool)));
 	connect(symbolPalette, SIGNAL(startEdit(QString)), this, SLOT(editSymbolStart(QString)));
 	connect(symbolPalette, SIGNAL(endEdit()), this, SLOT(editSymbolEnd()));
 	connect(symbolPalette, SIGNAL(objectDropped()), this, SLOT(PutToPatterns()));
 	symbolPalette->installEventFilter(this);
-	symbolPalette->hide();
 
-	inlinePalette = new InlinePalette(this);
+	// Inline Elements
+	inlinePalette = dockManager->inlinePalette;
 	inlinePalette->setMainWindow(this);
-	connect(scrActions["toolsInline"], SIGNAL(toggled(bool)), inlinePalette, SLOT(setPaletteShown(bool)));
-	connect(inlinePalette, SIGNAL(paletteShown(bool)), scrActions["toolsInline"], SLOT(setChecked(bool)));
+	connect(scrActions["toolsInline"], SIGNAL(toggled(bool)), inlinePalette, SLOT(toggleView(bool)) );
+	connect(inlinePalette, SIGNAL(viewToggled(bool)), scrActions["toolsInline"], SLOT(setChecked(bool)));
 	connect(inlinePalette, SIGNAL(startEdit(int)), this, SLOT(editInlineStart(int)));
 	connect(inlinePalette, SIGNAL(endEdit()), this, SLOT(editInlineEnd()));
 	connect(inlinePalette, SIGNAL(objectDropped(QString)), this, SLOT(PutToInline(QString)));
 	inlinePalette->installEventFilter(this);
-	inlinePalette->hide();
 
-	undoPalette = new UndoPalette(this, "undoPalette");
+	// Undo
+	undoPalette = dockManager->undoPalette;
 	undoPalette->installEventFilter(this);
 	m_undoManager->registerGui(undoPalette);
-	connect(undoPalette, SIGNAL(paletteShown(bool)), this, SLOT(setUndoPalette(bool)));
+	connect(undoPalette, SIGNAL(viewToggled(bool)), this, SLOT(setUndoPalette(bool)));
 	connect(undoPalette, SIGNAL(objectMode(bool)), this, SLOT(setUndoMode(bool)));
 
 	// initializing style manager here too even it's not strictly a palette
@@ -749,6 +800,8 @@
 	connect( marksManager, SIGNAL(paletteShown(bool)), scrActions["editMarks"], SLOT(setChecked(bool)));
 	marksManager->installEventFilter(this);
 	// initializing notes styles manager
+
+	// Note Styles
 	nsEditor = new NotesStylesEditor(this, "notesStylesEditor");
 	connect( scrActions["editNotesStyles"], SIGNAL(toggled(bool)), nsEditor, SLOT(setPaletteShown(bool)) );
 	connect( nsEditor, SIGNAL(paletteShown(bool)), scrActions["editNotesStyles"], SLOT(setChecked(bool)));
@@ -775,6 +828,9 @@
 	// char palette
 	connect(scrActions["insertGlyph"], SIGNAL(toggled(bool)), charPalette, SLOT(setPaletteShown(bool)));
 	connect(charPalette, SIGNAL(paletteShown(bool)), scrActions["insertGlyph"], SLOT(setChecked(bool)));
+
+	dockManager->loadDefaultWorkspace();
+
 }
 
 
@@ -831,7 +887,8 @@
 	}
 	else
 		mdiArea->setViewMode(QMdiArea::SubWindowView);
-	setCentralWidget(mdiArea);
+	//setCentralWidget(mdiArea);
+	dockManager->setCentralWidget(mdiArea);
 }
 
 void ScribusMainWindow::initMenuBar()
@@ -1782,6 +1839,9 @@
 		return;
 	}
 
+	// Save GUI state
+	dockManager->saveWorkspaceToFile();
+
 	disconnect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(newActWin(QMdiSubWindow*)));
 
 	QList<QMdiSubWindow *> windows = mdiArea->subWindowList();
@@ -1830,22 +1890,13 @@
 			m_prefsManager.appPrefs.uiPrefs.tabbedPalettes.append(currentTab);
 	}
 
-	propertiesPalette->hide();
-	contentPalette->hide();
-	outlinePalette->hide();
-	scrapbookPalette->hide();
-	bookmarkPalette->hide();
-	downloadsPalette->hide();
-	layerPalette->hide();
-	pagePalette->hide();
-	docCheckerPalette->hide();
-	undoPalette->hide();
-	alignDistributePalette->hide();
-	guidePalette->hide();
-	charPalette->hide();
-	symbolPalette->hide();
-	inlinePalette->hide();
+	// We need to remove all docks from the DockManager to prevent a memory leak
+	// in case a plugin has added a dock in the DockManager and is simply deleted
+	// on cleanup before it is removed from the DockManager.
+	// Removed Docks are not deleted directly.
+	dockManager->removeAllDockWidgets();
 
+
 	// Clean up plugins, THEN save prefs to disk
 	ScCore->pluginManager->cleanupPlugins();
 	if (!m_prefsManager.appPrefs.scrapbookPrefs.persistentScrapbook)
@@ -5445,7 +5504,7 @@
 
 void ScribusMainWindow::setUndoPalette(bool visible)
 {
-	undoPalette->setPaletteShown(visible);
+	undoPalette->toggleView(visible);
 	scrActions["toolsActionHistory"]->setChecked(visible);
 }
 
Index: scribus/scribus.h
===================================================================
--- scribus/scribus.h	(Revision 25546)
+++ scribus/scribus.h	(Arbeitskopie)
@@ -56,6 +56,7 @@
 // application specific includes
 #include "scribusapi.h"
 #include "scribusdoc.h"
+#include "manager/dock_manager.h"
 #include "styleoptions.h"
 #include "ui/customfdialog.h"
 #include "ui/scmessagebox.h"
@@ -69,6 +70,7 @@
 class CharSelect;
 class CheckDocument;
 class ColorCombo;
+class DockManager;
 class DownloadsPalette;
 class EditToolBar;
 class FileToolBar;
@@ -218,6 +220,7 @@
 	/** \brief private doc for managing default patterns. */
 	ScribusDoc* m_doc {nullptr};
 
+	DockManager * dockManager {nullptr};
 
 	QProgressBar* mainWindowProgressBar {nullptr};
 	ScrSpinBox* zoomSpinBox {nullptr}; //zoom spinbox at bottom of view
Index: scribus/scribusindigomainwindow.cpp
===================================================================
--- scribus/scribusindigomainwindow.cpp	(Revision 25546)
+++ scribus/scribusindigomainwindow.cpp	(Arbeitskopie)
@@ -11,6 +11,9 @@
 #include "third_party/Qt-Advanced-Docking-System/src/DockManager.h"
 #include "third_party/Qt-Advanced-Docking-System/src/IconProvider.h"
 
+#include "iconmanager.h"
+#include "manager/dock_manager.h"
+
 ScribusIndigoMainWindow::ScribusIndigoMainWindow(QWidget *parent)
 	: QMainWindow{parent}
 	{
@@ -29,14 +32,14 @@
 //	ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHasUndockButton, false);
 //	ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHideDisabledButtons, true);
 
-	//		ads::CDockManager::iconProvider().registerCustomIcon(ads::TabCloseIcon,
-	//IconManager::instance().icon("close"));
-	//		ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaCloseIcon,
-	//IconManager::instance().icon("close"));
-	//		ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaMenuIcon,
-	//IconManager::instance().icon("menu-down"));
-	//		ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaUndockIcon,
-	//IconManager::instance().icon("dock-float"));
+////	ads::CDockManager::iconProvider().registerCustomIcon(ads::TabCloseIcon, IconManager::instance().loadIcon("close"));
+////	ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaCloseIcon, IconManager::instance().loadIcon("close"));
+////	ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaMenuIcon, IconManager::instance().loadIcon("menu-down"));
+////	ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaUndockIcon, IconManager::instance().loadIcon("dock-float"));
+
+//	dockManager = new DockManager(this);
+
+
 	}
 
 
Index: scribus/scribusindigomainwindow.h
===================================================================
--- scribus/scribusindigomainwindow.h	(Revision 25546)
+++ scribus/scribusindigomainwindow.h	(Arbeitskopie)
@@ -5,6 +5,8 @@
 
 #include "scribusapi.h"
 
+//class DockManager;
+
 class SCRIBUS_API ScribusIndigoMainWindow : public QMainWindow
 	{
 		Q_OBJECT
@@ -16,9 +18,9 @@
 	signals:
 	private:
 
+	//DockManager *dockManager;
 
 
-
 	};
 
 #endif // SCRIBUSINDIGOMAINWINDOW_H
Index: scribus/third_party/Qt-Advanced-Docking-System/CMakeLists.txt
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/CMakeLists.txt	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/CMakeLists.txt	(Arbeitskopie)
@@ -1,5 +1,5 @@
 ###<< Scribus
-set(ADS_VERSION "4.0.3")
+set(ADS_VERSION "4.0.4")
 ###>> Scribus
 cmake_minimum_required(VERSION 3.5)
 
Index: scribus/third_party/Qt-Advanced-Docking-System/README.md
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/README.md	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/README.md	(Arbeitskopie)
@@ -119,6 +119,8 @@
   - [RDE – Robox Development Environment](#rde--robox-development-environment)
   - [ResInsight](#resinsight)
   - [ADTF 3](#adtf-3)
+  - [DREAM.3D NX](#dream3d-nx)
+  - [LabPlot](#labplot)
 - [Alternative Docking System Implementations](#alternative-docking-system-implementations)
   - [KDDockWidgets](#kddockwidgets)
   - [QtitanDocking](#qtitandocking)
@@ -254,7 +256,7 @@
 
 - [mborgerson](https://github.com/mborgerson)
 
-For more information about the PySide6 bindings read [this](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/298) issue.
+Please file PySide6-QtAds-specific issues on its [pyside6_qtads](https://github.com/mborgerson/pyside6_qtads) fork for tracking. For more information about the PySide6 bindings read [this](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/298) issue.
 
 ### PyQt5
 
@@ -318,7 +320,9 @@
 ## Build
 
 The Linux build requires private header files. Make sure that they are installed.
-The library uses SVG icons, so ensure that Qt SVG support is installed.
+The library uses SVG icons, so ensure that Qt SVG support is installed. The demo
+application creates a `QQuickWidget` for testing, so ensure that the required
+libraries are installed.
 
 ### Qt5 on Ubuntu 18.04 or 20.04
 
@@ -329,13 +333,13 @@
 ### Qt5 on Ubuntu 22.04
 
 ```bash
-sudo apt install qtbase5-dev qtbase5-private-dev qtbase5-dev-tools libqt5svg5
+sudo apt install qtbase5-dev qtbase5-private-dev qtbase5-dev-tools libqt5svg5 libqt5qml5 qtdeclarative5-dev
 ```
 
 ### Qt6 on Ubuntu 22.04
 
 ```bash
-sudo apt install qt6-base-dev qt6-base-private-dev qt6-tools-dev libqt6svg6
+sudo apt install qt6-default qt6-base-dev qt6-base-private-dev qt6-tools-dev libqt6svg6 qt6-qtdeclarative
 ```
 
 Open the `ads.pro` file with QtCreator and start the build, that's it.
@@ -593,6 +597,26 @@
 
 ![ADTF](doc/showcase_adtf.png)
 
+### [DREAM.3D NX](https://github.com/BlueQuartzSoftware/DREAM3D)
+
+DREAM.3D *(Digital Representation Environment for Analysis of Materials in 3D)* is an open source, cross-platform and modular, software suite that allows users to prepare, reconstruct, quantify, instantiate, and mesh, multidimensional, multimodal microstructural data, as well as many other applications.
+
+[BlueQuartz Software](http://www.bluequartz.net/) is currently completely rewriting the DREAM.3D application. For the upcoming version **[DREAM3D NX](http://www.dream3d.io/)** they improved the UI by using the Advanced Docking System. An [early version](http://www.dream3d.io/) of **DREAM3D NX** with ADS is already available to any user who would like to take the brand new version out for a spin.
+
+![DREAM.3D NX](doc/showcase_dream3d_nx.png)
+
+[read more...](http://dream3d.bluequartz.net/)
+
+### [LabPlot](https://labplot.kde.org/)
+
+KDE LabPlot is the ultimate free, open source and cross-platform tool for scientists, engineers, and students who need to analyze and visualize data. With its intuitive interface and powerful features, you can create stunning plots and diagrams with ease. Whether you're working with CSV, FITS, or HDF5 data, KDE LabPlot makes it simple to import and analyze your data.
+
+The LabPlot project recently switched to the Qt Advanced Docking System for their user interface. This switch represents a significant improvement to the LabPlot software, allowing users to create and manage complex data visualization layouts with ease.
+
+![LabPlot](doc/showcase_labplot.png)
+
+[read more...](https://labplot.kde.org/)
+
 ## Alternative Docking System Implementations
 
 If this Qt Advanced Docking System does not fit to your needs you may consider some of the alternative docking system solutions for Qt.
@@ -599,7 +623,7 @@
 
 ### KDDockWidgets
 
-This is an advanced docking framework for Qt from [KDAB](https://www.kdab.com/). The interesting thing is, that they separated GUI code from logic, so they can easily provide a QtQuick backend in the future. 
+This is an advanced docking framework for Qt from [KDAB](https://www.kdab.com/). The interesting thing is, that they separated GUI code from logic, so they can easily provide a QtQuick backend in the future.
 
 - [Blog post about KDDockWidgets](https://www.kdab.com/kddockwidgets/)
 - [GitHub project](https://github.com/KDAB/KDDockWidgets)
Index: scribus/third_party/Qt-Advanced-Docking-System/doc/user-guide.md
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/doc/user-guide.md	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/doc/user-guide.md	(Arbeitskopie)
@@ -39,6 +39,7 @@
   - [`AutoHideButtonCheckable`](#autohidebuttoncheckable)
   - [`AutoHideSideBarsIconOnly`](#autohidesidebarsicononly)
   - [`AutoHideShowOnMouseOver`](#autohideshowonmouseover)
+  - [`AutoHideCloseButtonCollapsesDock`](#autohideclosebuttoncollapsesdock)
 - [DockWidget Feature Flags](#dockwidget-feature-flags)
   - [`DockWidgetClosable`](#dockwidgetclosable)
   - [`DockWidgetMovable`](#dockwidgetmovable)
@@ -589,6 +590,21 @@
 mouse outside of the Auto-Hide widget. Showing and hiding my mouse click still
 works if this feature is enabled.
 
+### `AutoHideCloseButtonCollapsesDock`
+
+Some users don't understand the distinction between closing an auto hide dock and
+collapsing an auto hide dock. This may lead to situations where they press the
+close button (losing the side tab widget) instead of simply clicking outside
+the auto hide dock (collapsing the dock). 
+
+![AutoHideCloseButtonCollapsesDock false](cfg_flag_AutoHideCloseButtonCollapsesDock_false.gif)
+
+If `AutoHideCloseButtonCollapsesDock` option is active, the
+close button in an auto hide widget collapses the auto hide widget instead of
+closing it.
+
+![AutoHideCloseButtonCollapsesDock true](cfg_flag_AutoHideCloseButtonCollapsesDock_true.gif)
+
 ## DockWidget Feature Flags
 
 ### `DockWidgetClosable`
Index: scribus/third_party/Qt-Advanced-Docking-System/pyproject.toml
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/pyproject.toml	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/pyproject.toml	(Arbeitskopie)
@@ -71,5 +71,5 @@
 	"src/PushButton.cpp",
 	"src/ResizeHandle.cpp",
 	"src/ads_globals.cpp",
-	"src/linux/FloatingWidgetTitleBar.h; platform_system == 'Linux'",
+	"src/linux/FloatingWidgetTitleBar.cpp; platform_system == 'Linux'",
 ]
Index: scribus/third_party/Qt-Advanced-Docking-System/sip/AutoHideSideBar.sip
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/sip/AutoHideSideBar.sip	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/sip/AutoHideSideBar.sip	(Arbeitskopie)
@@ -28,6 +28,8 @@
 	Qt::Orientation orientation() const;
 	ads::CAutoHideTab* tabAt(int index) const;
 	int tabCount() const;
+    int visibleTabCount() const;
+    bool hasVisibleTabs() const;
 	ads::SideBarLocation sideBarLocation() const;
 	virtual QSize minimumSizeHint() const;
 	virtual QSize sizeHint() const;
Index: scribus/third_party/Qt-Advanced-Docking-System/sip/DockFocusController.sip
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/sip/DockFocusController.sip	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/sip/DockFocusController.sip	(Arbeitskopie)
@@ -23,6 +23,7 @@
     ads::CDockWidget* focusedDockWidget() const;
     void setDockWidgetTabFocused(ads::CDockWidgetTab* Tab);
     void clearDockWidgetFocus(ads::CDockWidget* dockWidget);
+    void setDockWidgetTabPressed(bool Value);
 
 public slots:
 	void setDockWidgetFocused(ads::CDockWidget* focusedNow);
Index: scribus/third_party/Qt-Advanced-Docking-System/sip/DockManager.sip
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/sip/DockManager.sip	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/sip/DockManager.sip	(Arbeitskopie)
@@ -188,6 +188,7 @@
 		AutoHideSideBarsIconOnly,
 		AutoHideShowOnMouseOver,
 		DefaultAutoHideConfig,
+        AutoHideCloseButtonCollapsesDock,
 	};
     typedef QFlags<ads::CDockManager::eAutoHideFlag> AutoHideFlags;
 
@@ -237,6 +238,7 @@
 	QMenu* viewMenu() const;
 	void setViewMenuInsertionOrder(ads::CDockManager::eViewMenuInsertionOrder Order);
 	bool isRestoringState() const;
+    bool isLeavingMinimizedState() const;
 	static int startDragDistance();
     ads::CDockWidget* focusedDockWidget() const;
     QList<int> splitterSizes(ads::CDockAreaWidget *ContainedArea) const;
@@ -245,6 +247,7 @@
 	static QString floatingContainersTitle();
 
 public slots:
+    void endLeavingMinimizedState();
 	void openPerspective(const QString& PerspectiveName);
     void setDockWidgetFocused(ads::CDockWidget* DockWidget);
 
Index: scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidget.sip
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidget.sip	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidget.sip	(Arbeitskopie)
@@ -60,7 +60,9 @@
     enum eMinimumSizeHintMode
     {
     	MinimumSizeHintFromDockWidget,
-    	MinimumSizeHintFromContent
+    	MinimumSizeHintFromContent,
+        MinimumSizeHintFromDockWidgetMinimumSize,
+    	MinimumSizeHintFromContentMinimumSize,
     };
 
 	enum eToggleViewActionMode
@@ -94,6 +96,7 @@
 	QAction* toggleViewAction() const;
 	void setToggleViewActionMode(ads::CDockWidget::eToggleViewActionMode Mode);
 	void setMinimumSizeHintMode(ads::CDockWidget::eMinimumSizeHintMode Mode);
+    ads::CDockWidget::eMinimumSizeHintMode minimumSizeHintMode() const;
     bool isCentralWidget() const;
 	void setIcon(const QIcon& Icon);
 	QIcon icon() const;
Index: scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidgetTab.sip
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidgetTab.sip	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidgetTab.sip	(Arbeitskopie)
@@ -37,6 +37,7 @@
     void updateStyle();
     QSize iconSize() const;
     void setIconSize(const QSize& Size);
+    bool mousePressed() const;
 
 public slots:
 	virtual void setVisible(bool visible);
Index: scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.cpp	(Arbeitskopie)
@@ -127,27 +127,6 @@
 		}
 		break;
 
-	case QEvent::Resize:
-		if (_this->tabCount())
-		{
-			auto ev = static_cast<QResizeEvent*>(e);
-			auto Tab = _this->tabAt(0);
-			int Size = isHorizontal() ? ev->size().height() : ev->size().width();
-			int TabSize = isHorizontal() ? Tab->size().height() : Tab->size().width();
-			// If the size of the side bar is less than the size of the first tab
-			// then there are no visible tabs in this side bar. This check will
-			// fail if someone will force a very big border via CSS!!
-			if (Size < TabSize)
-			{
-				_this->hide();
-			}
-		}
-		else
-		{
-			_this->hide();
-		}
-		break;
-
 	default:
 		break;
 	}
@@ -288,20 +267,33 @@
 //============================================================================
 bool CAutoHideSideBar::eventFilter(QObject *watched, QEvent *event)
 {
-	if (event->type() != QEvent::ShowToParent)
+	auto Tab = qobject_cast<CAutoHideTab*>(watched);
+	if (!Tab)
 	{
 		return false;
 	}
 
-	// As soon as on tab is shown, we need to show the side tab bar
-	auto Tab = qobject_cast<CAutoHideTab*>(watched);
-	if (Tab)
+	switch (event->type())
 	{
-		show();
+	case QEvent::ShowToParent:
+		 show();
+	     break;
+
+	case QEvent::HideToParent:
+		 if (!hasVisibleTabs())
+		 {
+			 hide();
+		 }
+		 break;
+
+	default:
+		break;
 	}
+
 	return false;
 }
 
+
 //============================================================================
 Qt::Orientation CAutoHideSideBar::orientation() const
 {
@@ -324,6 +316,39 @@
 
 
 //============================================================================
+int CAutoHideSideBar::visibleTabCount() const
+{
+	int count = 0;
+	auto ParentWidget = parentWidget();
+	for (auto i = 0; i < tabCount(); i++)
+	{
+		if (tabAt(i)->isVisibleTo(ParentWidget))
+		{
+			count++;
+		}
+	}
+
+	return count;
+}
+
+
+//============================================================================
+bool CAutoHideSideBar::hasVisibleTabs() const
+{
+	auto ParentWidget = parentWidget();
+	for (auto i = 0; i < tabCount(); i++)
+	{
+		if (tabAt(i)->isVisibleTo(ParentWidget))
+		{
+			return true;
+		}
+	}
+
+	return false;
+}
+
+
+//============================================================================
 SideBarLocation CAutoHideSideBar::sideBarLocation() const
 {
 	return d->SideTabArea;
Index: scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.h	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.h	(Arbeitskopie)
@@ -135,6 +135,19 @@
 	int tabCount() const;
 
 	/**
+	 * Returns the number of visible tabs to its parent widget.
+	 */
+	int visibleTabCount() const;
+
+	/**
+	 * Returns true, if the sidebar contains visible tabs to its parent widget.
+	 * The function returns as soon as it finds the first visible tab.
+	 * That means, if you just want to find out if there are visible tabs
+	 * then this function is quicker than visibleTabCount()
+	 */
+	bool hasVisibleTabs() const;
+
+	/**
 	 * Getter for side tab bar area property
 	 */
 	SideBarLocation sideBarLocation() const;
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTabBar.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTabBar.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTabBar.cpp	(Arbeitskopie)
@@ -36,6 +36,7 @@
 #include <QBoxLayout>
 #include <QApplication>
 #include <QtGlobal>
+#include <QTimer>
 
 #include "FloatingDockContainer.h"
 #include "DockAreaWidget.h"
@@ -107,7 +108,12 @@
 		{
 			TabWidget->show();
 			TabWidget->setActiveTab(true);
-			_this->ensureWidgetVisible(TabWidget);
+			// Sometimes the synchronous calculation of the rectangular area fails
+			// Therefore we use QTimer::singleShot here to execute the call
+			// within the event loop - see #520
+			QTimer::singleShot(0, [&, TabWidget]{
+			    _this->ensureWidgetVisible(TabWidget);
+			});
 		}
 		else
 		{
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTitleBar.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTitleBar.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTitleBar.cpp	(Arbeitskopie)
@@ -415,8 +415,13 @@
 void CDockAreaTitleBar::onCloseButtonClicked()
 {
     ADS_PRINT("CDockAreaTitleBar::onCloseButtonClicked");
-	if (d->testConfigFlag(CDockManager::DockAreaCloseButtonClosesTab))
+	if (CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideCloseButtonCollapsesDock) &&
+		d->DockArea->autoHideDockContainer())
 	{
+		d->DockArea->autoHideDockContainer()->collapseView(true);
+	}
+	else if (d->testConfigFlag(CDockManager::DockAreaCloseButtonClosesTab))
+	{
 		d->TabBar->closeTab(d->TabBar->currentIndex());
 	}
 	else
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.cpp	(Arbeitskopie)
@@ -140,6 +140,7 @@
 			{
 				LayoutItem->widget()->setParent(nullptr);
 			}
+			delete LayoutItem;
 			m_CurrentWidget = nullptr;
 			m_CurrentIndex = -1;
 		}
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.cpp	(Arbeitskopie)
@@ -27,7 +27,7 @@
 #include "DockManager.h"
 #include "DockAreaTitleBar.h"
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include "linux/FloatingWidgetTitleBar.h"
 #endif
 
@@ -44,11 +44,12 @@
 	QPointer<CDockWidget> FocusedDockWidget = nullptr;
 	QPointer<CDockAreaWidget> FocusedArea = nullptr;
 	QPointer<CDockWidget> OldFocusedDockWidget = nullptr;
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
      QPointer<CFloatingDockContainer> FloatingWidget = nullptr;
 #endif
 	CDockManager* DockManager;
     bool ForceFocusChangedSignal = false;
+    bool TabPressed = false;
 
 	/**
 	 * Private data constructor
@@ -84,7 +85,7 @@
 
 
 //===========================================================================
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 static void updateFloatingWidgetFocusStyle(CFloatingDockContainer* FloatingWidget, bool Focused)
 {
 	if (FloatingWidget->hasNativeTitleBar())
@@ -168,7 +169,7 @@
     }
 
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	// This code is required for styling the floating widget titlebar for linux
 	// depending on the current focus state
 	if (FloatingWidget != NewFloatingWidget)
@@ -267,7 +268,9 @@
 {
     Q_UNUSED(focusedOld);
 
-	if (d->DockManager->isRestoringState())
+    // Ignore focus changes if we are restoring state, or if user clicked
+    // a tab wich in turn caused the focus change
+	if (d->DockManager->isRestoringState() || d->TabPressed)
 	{
 		return;
 	}
@@ -285,7 +288,7 @@
 		DockWidget = internal::findParent<CDockWidget*>(focusedNow);
 	}
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     if (!DockWidget)
 	{
 		return;
@@ -418,6 +421,12 @@
 	return d->FocusedDockWidget.data();
 }
 
+
+//==========================================================================
+void CDockFocusController::setDockWidgetTabPressed(bool Value)
+{
+	d->TabPressed = Value;
+}
 } // namespace ads
 
 //---------------------------------------------------------------------------
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.h	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.h	(Arbeitskopie)
@@ -80,6 +80,12 @@
 	 */
 	void clearDockWidgetFocus(CDockWidget* dockWidget);
 
+	/**
+	 * Notifies the dock focus controller, that a the mouse is pressed or
+	 * released
+	 */
+	void setDockWidgetTabPressed(bool Value);
+
 public Q_SLOTS:
 	/**
 	 * Request a focus change to the given dock widget
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.cpp	(Arbeitskopie)
@@ -47,6 +47,7 @@
 #include <QMenu>
 #include <QApplication>
 #include <QWindow>
+#include <QWindowStateChangeEvent>
 
 #include "FloatingDockContainer.h"
 #include "DockOverlay.h"
@@ -59,7 +60,7 @@
 #include "DockFocusController.h"
 #include "DockSplitter.h"
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include "linux/FloatingWidgetTitleBar.h"
 #endif
 
@@ -116,6 +117,7 @@
 	QVector<CFloatingDockContainer*> UninitializedFloatingWidgets;
 	CDockFocusController* FocusController = nullptr;
     CDockWidget* CentralWidget = nullptr;
+    bool IsLeavingMinimized = false;
 
 	/**
 	 * Private data constructor
@@ -192,7 +194,7 @@
 	QString FileName = ":ads/stylesheets/";
 	FileName += CDockManager::testConfigFlag(CDockManager::FocusHighlighting)
 		? "focus_highlighting" : "default";
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     FileName += "_linux";
 #endif
     FileName += ".css";
@@ -510,9 +512,10 @@
 		d->FocusController = new CDockFocusController(this);
 	}
 
-#ifdef Q_OS_LINUX
+
 	window()->installEventFilter(this);
 
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     connect(qApp, &QApplication::focusWindowChanged, [](QWindow* focusWindow)
     {
         // bring modal dialogs to foreground to ensure that they are in front of any
@@ -552,7 +555,7 @@
 }
 
 //============================================================================
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 bool CDockManager::eventFilter(QObject *obj, QEvent *e)
 {
 	// Emulate Qt:Tool behaviour.
@@ -629,9 +632,40 @@
 	}
 	return Super::eventFilter(obj, e);
 }
+#else
+//============================================================================
+bool CDockManager::eventFilter(QObject *obj, QEvent *e)
+{
+	if (e->type() == QEvent::WindowStateChange)
+	{
+		QWindowStateChangeEvent* ev = static_cast<QWindowStateChangeEvent*>(e);
+		if (ev->oldState().testFlag(Qt::WindowMinimized))
+		{
+			d->IsLeavingMinimized = true;
+			QMetaObject::invokeMethod(this, "endLeavingMinimizedState", Qt::QueuedConnection);
+		}
+	}
+	return Super::eventFilter(obj, e);
+}
 #endif
 
+
 //============================================================================
+void CDockManager::endLeavingMinimizedState()
+{
+	d->IsLeavingMinimized = false;
+	this->activateWindow();
+}
+
+
+//============================================================================
+bool CDockManager::isLeavingMinimizedState() const
+{
+	return d->IsLeavingMinimized;
+}
+
+
+//============================================================================
 void CDockManager::registerFloatingWidget(CFloatingDockContainer* FloatingWidget)
 {
 	d->FloatingWidgets.append(FloatingWidget);
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.h	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.h	(Arbeitskopie)
@@ -88,7 +88,13 @@
 	friend class CAutoHideDockContainer;
 	friend CAutoHideSideBar;
 
+public Q_SLOTS:
+	/**
+	 * Ends the isRestoringFromMinimizedState
+	 */
+	void endLeavingMinimizedState();
 
+
 protected:
 	/**
 	 * Registers the given floating widget in the internal list of
@@ -239,6 +245,7 @@
 		AutoHideButtonCheckable = 0x08, //!< If the flag is set, the auto hide button will be checked and unchecked depending on the auto hide state. Mainly for styling purposes.
 		AutoHideSideBarsIconOnly = 0x10,///< show only icons in auto hide side tab - if a tab has no icon, then the text will be shown
 		AutoHideShowOnMouseOver = 0x20, ///< show the auto hide window on mouse over tab and hide it if mouse leaves auto hide container
+		AutoHideCloseButtonCollapsesDock = 0x40, ///< Close button of an auto hide container collapses the dock instead of hiding it completely
 
 		DefaultAutoHideConfig = AutoHideFeatureEnabled
 			                  | DockAreaHasAutoHideButton ///< the default configuration for left and right side bars
@@ -540,6 +547,15 @@
 	bool isRestoringState() const;
 
 	/**
+	 * This function returns true, if the DockManager window is restoring from
+	 * minimized state.
+	 * The DockManager is in this state starting from the QWindowStateChangeEvent
+	 * that signals the state change from minimized to normal until
+	 * endLeavingMinimizedState() function is called.
+	 */
+	bool isLeavingMinimizedState() const;
+
+	/**
 	 * The distance the user needs to move the mouse with the left button
 	 * hold down before a dock widget start floating
 	 */
@@ -560,9 +576,7 @@
 		widget->setFocus(Qt::OtherFocusReason);
 	}
 
-#ifdef Q_OS_LINUX
 	bool eventFilter(QObject *obj, QEvent *e) override;
-#endif
 
 	/**
 	 * Returns the dock widget that has focus style in the ui or a nullptr if
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockOverlay.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockOverlay.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockOverlay.cpp	(Arbeitskopie)
@@ -139,7 +139,7 @@
      */
     qreal dropIndicatiorWidth(QLabel* l) const
     {
-    #ifdef Q_OS_LINUX
+    #if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
         Q_UNUSED(l)
         return 40;
     #else
@@ -333,7 +333,7 @@
 {
 	d->Mode = Mode;
 	d->Cross = new CDockOverlayCross(this);
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint);
 #else
 	setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);
@@ -595,7 +595,7 @@
 	d(new DockOverlayCrossPrivate(this))
 {
 	d->DockOverlay = overlay;
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint);
 #else
 	setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.cpp	(Arbeitskopie)
@@ -623,6 +623,13 @@
 
 
 //============================================================================
+CDockWidget::eMinimumSizeHintMode CDockWidget::minimumSizeHintMode() const
+{
+	return d->MinimumSizeHintMode;
+}
+
+
+//============================================================================
 bool CDockWidget::isCentralWidget() const
 {
 	return dockManager()->centralWidget() == this;
@@ -643,14 +650,20 @@
 	// If the dock widget state is different, then we really need to toggle
 	// the state. If we are in the right state, then we simply make this
 	// dock widget the current dock widget
+	auto AutoHideContainer = autoHideDockContainer();
 	if (d->Closed != !Open)
 	{
 		toggleViewInternal(Open);
 	}
-	else if (Open && d->DockArea)
+	else if (Open && d->DockArea && !AutoHideContainer)
 	{
 		raise();
 	}
+
+	if (Open && AutoHideContainer)
+	{
+		AutoHideContainer->collapseView(false);
+	}
 }
 
 
@@ -984,14 +997,20 @@
 //============================================================================
 QSize CDockWidget::minimumSizeHint() const
 {
-	if (d->MinimumSizeHintMode == CDockWidget::MinimumSizeHintFromDockWidget || !d->Widget)
+	if (!d->Widget)
 	{
 		return QSize(60, 40);
 	}
-	else
+
+	switch (d->MinimumSizeHintMode)
 	{
-		return d->Widget->minimumSizeHint();
+		case MinimumSizeHintFromDockWidget: return QSize(60, 40);
+    	case MinimumSizeHintFromContent: return d->Widget->minimumSizeHint();
+    	case MinimumSizeHintFromDockWidgetMinimumSize: return minimumSize();
+    	case MinimumSizeHintFromContentMinimumSize: return d->Widget->minimumSize();
 	}
+
+	return d->Widget->minimumSizeHint();
 }
 
 
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.h	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.h	(Arbeitskopie)
@@ -208,12 +208,17 @@
      * reimplements minimumSizeHint() function to return a very small minimum
      * size hint. If you would like to adhere the minimumSizeHint() from the
      * content widget, then set the minimumSizeHintMode() to
-     * MinimumSizeHintFromContent.
+     * MinimumSizeHintFromContent. If you would like to use the minimumSize()
+     * value of the content widget or the dock widget, then you can use the
+     * MinimumSizeHintFromDockWidgetMinimumSize or
+     * MinimumSizeHintFromContentMinimumSize modes.
      */
     enum eMinimumSizeHintMode
     {
     	MinimumSizeHintFromDockWidget,
-    	MinimumSizeHintFromContent
+    	MinimumSizeHintFromContent,
+    	MinimumSizeHintFromDockWidgetMinimumSize,
+    	MinimumSizeHintFromContentMinimumSize,
     };
 
 
@@ -412,6 +417,11 @@
     void setMinimumSizeHintMode(eMinimumSizeHintMode Mode);
 
     /**
+     * Get the minimum size hint mode configured by setMinimumSizeHintMode
+     */
+    eMinimumSizeHintMode minimumSizeHintMode() const;
+
+    /**
      * Returns true if the dock widget is set as central widget of it's dock manager
      */
     bool isCentralWidget() const;
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.cpp	(Arbeitskopie)
@@ -79,6 +79,7 @@
 	QSpacerItem* IconTextSpacer;
 	QPoint TabDragStartPosition;
 	QSize IconSize;
+	bool MousePressed = false;
 
 	/**
 	 * Private data constructor
@@ -372,10 +373,12 @@
 	if (ev->button() == Qt::LeftButton)
 	{
 		ev->accept();
+		d->MousePressed = true;
         d->saveDragStartMousePosition(internal::globalPositionOf(ev));
         d->DragState = DraggingMousePressed;
         if (CDockManager::testConfigFlag(CDockManager::FocusHighlighting))
         {
+        	d->focusController()->setDockWidgetTabPressed(true);
         	d->focusController()->setDockWidgetTabFocused(this);
         }
         Q_EMIT clicked();
@@ -391,6 +394,7 @@
 {
 	if (ev->button() == Qt::LeftButton)
 	{
+		d->MousePressed = false;
 		auto CurrentDragState = d->DragState;
 		d->GlobalDragStartMousePosition = QPoint();
 		d->DragStartMousePosition = QPoint();
@@ -412,7 +416,12 @@
 			 d->FloatingWidget->finishDragging();
 			 break;
 
-		default:; // do nothing
+		default:
+			if (CDockManager::testConfigFlag(CDockManager::FocusHighlighting))
+			{
+				d->focusController()->setDockWidgetTabPressed(false);
+			}
+			break; // do nothing
 		}
 	} 
 	else if (ev->button() == Qt::MiddleButton)
@@ -802,6 +811,7 @@
 	d->IconSize = Size;
 	d->updateIcon();
 }
+
 } // namespace ads
 //---------------------------------------------------------------------------
 // EOF DockWidgetTab.cpp
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.h	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.h	(Arbeitskopie)
@@ -178,6 +178,12 @@
 	 */
 	void setIconSize(const QSize& Size);
 
+	/**
+	 * Returns true, if the tab has been clicked and the mouse is currently
+	 * pressed.
+	 */
+	bool mousePressed() const;
+
 public Q_SLOTS:
 	virtual void setVisible(bool visible) override;
 
Index: scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.cpp	(Arbeitskopie)
@@ -52,7 +52,7 @@
 #pragma comment(lib, "User32.lib")
 #endif
 #endif
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include "linux/FloatingWidgetTitleBar.h"
 #include <xcb/xcb.h>
 #endif
@@ -374,10 +374,11 @@
 	QPoint DragStartPos;
 	bool Hiding = false;
 	bool AutoHideChildren = true;
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     QWidget* MouseEventHandler = nullptr;
     CFloatingWidgetTitleBar* TitleBar = nullptr;
 	bool IsResizing = false;
+    bool MousePressed = false;
 #endif
 
 	/**
@@ -424,7 +425,7 @@
 
 	void setWindowTitle(const QString &Text)
 	{
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 		if (TitleBar)
 		{
 			TitleBar->setTitle(Text);
@@ -540,7 +541,7 @@
 		return;
 	}
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	// Prevent display of drop overlays and docking as long as a model dialog
 	// is active
     if (qApp->activeModalWidget())
@@ -641,7 +642,7 @@
 	connect(d->DockContainer, SIGNAL(dockAreasRemoved()), this,
 	    SLOT(onDockAreasAddedOrRemoved()));
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	QDockWidget::setWidget(d->DockContainer);
 	QDockWidget::setFloating(true);
 	QDockWidget::setFeatures(QDockWidget::DockWidgetClosable
@@ -763,18 +764,43 @@
 void CFloatingDockContainer::changeEvent(QEvent *event)
 {
 	Super::changeEvent(event);
-	if ((event->type() == QEvent::ActivationChange) && isActiveWindow())
+	switch (event->type())
 	{
-		ADS_PRINT("FloatingWidget::changeEvent QEvent::ActivationChange ");
-		d->zOrderIndex = ++zOrderCounter;
+	case QEvent::ActivationChange:
+		if (isActiveWindow())
+		{
+			ADS_PRINT("FloatingWidget::changeEvent QEvent::ActivationChange ");
+			d->zOrderIndex = ++zOrderCounter;
 
-#ifdef Q_OS_LINUX
-		if (d->DraggingState == DraggingFloatingWidget)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
+			if (d->DraggingState == DraggingFloatingWidget)
+			{
+				d->titleMouseReleaseEvent();
+				d->DraggingState = DraggingInactive;
+			}
+#endif
+		}
+		break;
+
+	case QEvent::WindowStateChange:
+	    // If the DockManager window is restored from minimized on Windows
+		// then the FloatingWidgets are not properly restored to maximized but
+		// to normal state.
+		// We simply check here, if the FloatingWidget was maximized before
+		// and if the DockManager is just leaving the minimized state. In this
+		// case, we restore the maximized state of this floating widget
+		if (d->DockManager->isLeavingMinimizedState())
 		{
-			d->titleMouseReleaseEvent();
-			d->DraggingState = DraggingInactive;
+			QWindowStateChangeEvent* ev = static_cast<QWindowStateChangeEvent*>(event);
+			if (ev->oldState().testFlag(Qt::WindowMaximized))
+			{
+				this->showMaximized();
+			}
 		}
-#endif
+		break;
+
+	default:
+		break; // do nothing
 	}
 }
 
@@ -920,7 +946,7 @@
 void CFloatingDockContainer::showEvent(QShowEvent *event)
 {
 	Super::showEvent(event);
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     if (CDockManager::testConfigFlag(CDockManager::FocusHighlighting))
     {
         this->window()->activateWindow();
@@ -933,7 +959,7 @@
 void CFloatingDockContainer::startFloating(const QPoint &DragStartMousePos,
     const QSize &Size, eDragState DragState, QWidget *MouseEventHandler)
 {
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     if (!isMaximized())
     {
 		resize(Size);
@@ -985,7 +1011,7 @@
 		// the main window as the active window for some reason. This fixes
 		// that by resetting the active window to the floating widget after
 		// updating the overlays.
-		QApplication::setActiveWindow(this);
+		activateWindow();
 #endif
 		break;
 	default:
@@ -1070,7 +1096,7 @@
 		return false;
 	}
 	onDockAreasAddedOrRemoved();
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	if(d->TitleBar)
 	{
 		d->TitleBar->setMaximizedIcon(windowState() == Qt::WindowMaximized);
@@ -1108,6 +1134,11 @@
 	d->AutoHideChildren = false;
 	hide();
 	deleteLater();
+	if (d->DockManager)
+	{
+		d->DockManager->removeFloatingWidget(this);
+		d->DockManager->removeDockContainer(this->dockContainer());
+	}
 }
 
 //============================================================================
@@ -1114,7 +1145,7 @@
 void CFloatingDockContainer::finishDragging()
 {
 	ADS_PRINT("CFloatingDockContainer::finishDragging");
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	setWindowOpacity(1);
 	activateWindow();
 	if (d->MouseEventHandler)
@@ -1218,7 +1249,7 @@
 		// the main window as the active window for some reason. This fixes
 		// that by resetting the active window to the floating widget after
 		// updating the overlays.
-		QApplication::setActiveWindow(this);
+		activateWindow();
 		break;
 	default:
 		break;
@@ -1229,7 +1260,7 @@
 #endif
 
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 //============================================================================
 void CFloatingDockContainer::onMaximizeRequest()
 {
@@ -1298,12 +1329,12 @@
 	Super::resizeEvent(event);
 }
 
-static bool s_mousePressed = false;
+
 //============================================================================
 void CFloatingDockContainer::moveEvent(QMoveEvent *event)
 {
 	Super::moveEvent(event);
-	if (!d->IsResizing && event->spontaneous() && s_mousePressed)
+    if (!d->IsResizing && event->spontaneous() && d->MousePressed)
 	{
         d->setState(DraggingFloatingWidget);
 		d->updateDropOverlays(QCursor::pos());
@@ -1319,10 +1350,10 @@
 	switch (e->type())
 	{
 	case QEvent::WindowActivate:
-		s_mousePressed = false;
+        d->MousePressed = false;
 		break;
 	case QEvent::WindowDeactivate:
-		s_mousePressed = true;
+        d->MousePressed = true;
 		break;
 	default:
 		break;
Index: scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.h	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.h	(Arbeitskopie)
@@ -33,7 +33,7 @@
 
 #include <QRubberBand>
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include <QDockWidget>
 #define tFloatingWidgetBase QDockWidget
 #else
@@ -182,11 +182,9 @@
 
 #ifdef Q_OS_MACOS
 	virtual bool event(QEvent *e) override;
+    virtual void moveEvent(QMoveEvent *event) override;
+#elif defined(Q_OS_UNIX)
 	virtual void moveEvent(QMoveEvent *event) override;
-#endif
-
-#ifdef Q_OS_LINUX
-	virtual void moveEvent(QMoveEvent *event) override;
 	virtual void resizeEvent(QResizeEvent *event) override;
 	virtual bool event(QEvent *e) override;
 #endif
@@ -264,7 +262,7 @@
 	 */
 	void hideAndDeleteLater();
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     /**
 	 * This is a function that responds to FloatingWidgetTitleBar::maximizeRequest()
 	 * Maximize or normalize the container size.
@@ -300,7 +298,6 @@
 	 */
 	bool hasNativeTitleBar();
 #endif
-
 }; // class FloatingDockContainer
 }
  // namespace ads
Index: scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDragPreview.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDragPreview.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDragPreview.cpp	(Arbeitskopie)
@@ -262,7 +262,7 @@
 		setAttribute(Qt::WA_TranslucentBackground);
 	}
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     auto Flags = windowFlags();
     Flags |= Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint;
     setWindowFlags(Flags);
Index: scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.cpp	(Arbeitskopie)
@@ -38,7 +38,7 @@
 #include "IconProvider.h"
 #include "ads_globals.h"
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include <QSettings>
 #include <QFile>
 #include <QApplication>
@@ -52,7 +52,7 @@
 {
 const int FloatingWidgetDragStartEvent = QEvent::registerEventType();
 const int DockedWidgetDragStartEvent = QEvent::registerEventType();
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 static QString _window_manager;
 static QHash<QString, xcb_atom_t> _xcb_atom_cache;
 
@@ -371,7 +371,7 @@
 		return;
 	}
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	Button->setIcon(Button->style()->standardIcon(StandarPixmap));
 #else
 	// The standard icons does not look good on high DPI screens so we create
Index: scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.h	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.h	(Arbeitskopie)
@@ -40,7 +40,7 @@
 
 #include <iostream>
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include <xcb/xcb.h>
 #endif
 
@@ -156,7 +156,7 @@
 extern const int FloatingWidgetDragStartEvent;
 extern const int DockedWidgetDragStartEvent;
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 // Utils to directly communicate with the X server
 /**
  * Get atom from cache or request it from the XServer.
Index: scribus/ui/aligndistribute.cpp
===================================================================
--- scribus/ui/aligndistribute.cpp	(Revision 25546)
+++ scribus/ui/aligndistribute.cpp	(Arbeitskopie)
@@ -47,14 +47,24 @@
 
 //TODO Distribute with 
 
-AlignDistributePalette::AlignDistributePalette( QWidget* parent, const char* name) : ScDockPalette(parent, name, Qt::WindowFlags())
+AlignDistribute::AlignDistribute(QWidget* parent) : QWidget(parent)
 {
 	setupUi(this);
+}
+
+
+// =============================
+
+
+AlignDistributePalette::AlignDistributePalette(QWidget* parent) : DockPanelBase("AlignDistributePalette", parent)
+{
 	setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
-	setObjectName(name);
+	setObjectName("AlignDistributePalette");
 
+	ad = new AlignDistribute(this);
+	setWidget(ad);
 	//set up scrspinboxes
-	distributeDistSpinBox->setValues(-10000.0, 10000.0, 2, 0.0);
+	ad->distributeDistSpinBox->setValues(-10000.0, 10000.0, 2, 0.0);
 
 	resize( QSize(100, 100).expandedTo(minimumSizeHint()) );
 	languageChange();
@@ -72,113 +82,113 @@
 		languageChange();
 		return;
 	}
-	ScDockPalette::changeEvent(e);
+	DockPanelBase::changeEvent(e);
 }
 
 void AlignDistributePalette::languageChange()
 {
-	retranslateUi(this);
+	ad->retranslateUi(this);
 
-	int alignComboValue=alignRelativeToCombo->currentIndex();
-	alignRelativeToCombo->clear();
-	alignRelativeToCombo->addItem( tr( "First Selected" ) );
-	alignRelativeToCombo->addItem( tr( "Last Selected" ) );
-	alignRelativeToCombo->addItem( tr( "Page" ) );
-	alignRelativeToCombo->addItem( tr( "Margins" ) );
-	alignRelativeToCombo->addItem( tr( "Guide" ) );		
-	alignRelativeToCombo->addItem( tr( "Selection" ) );
-	alignRelativeToCombo->setCurrentIndex(alignComboValue);
-	alignRelativeToCombo->setToolTip( tr( "<qt>Align relative to the:<ul><li>First selected item</li><li>Second Selected Item</li><li>The current page</li><li>The margins of the current page</li><li>A Guide</li><li>The selection</ul></qt>" ) );
+	int alignComboValue = ad->alignRelativeToCombo->currentIndex();
+	ad->alignRelativeToCombo->clear();
+	ad->alignRelativeToCombo->addItem( tr( "First Selected" ) );
+	ad->alignRelativeToCombo->addItem( tr( "Last Selected" ) );
+	ad->alignRelativeToCombo->addItem( tr( "Page" ) );
+	ad->alignRelativeToCombo->addItem( tr( "Margins" ) );
+	ad->alignRelativeToCombo->addItem( tr( "Guide" ) );
+	ad->alignRelativeToCombo->addItem( tr( "Selection" ) );
+	ad->alignRelativeToCombo->setCurrentIndex(alignComboValue);
+	ad->alignRelativeToCombo->setToolTip( tr( "<qt>Align relative to the:<ul><li>First selected item</li><li>Second Selected Item</li><li>The current page</li><li>The margins of the current page</li><li>A Guide</li><li>The selection</ul></qt>" ) );
 	alignToChanged(alignComboValue);
 
-	int alignMethodValue=alignMoveOrResizeCombo->currentIndex();
-	alignMoveOrResizeCombo->clear();
-	alignMoveOrResizeCombo->addItem( tr("Move") );
-	alignMoveOrResizeCombo->addItem( tr("Resize") );
-	alignMoveOrResizeCombo->setToolTip( tr( "<qt>When aligning one side of an item do one of the following:<ul><li>Always move the other side too (preserve existing width and height)</li><li>Keep the other side fixed (resize the item instead of moving it) whenever possible</li></ul></qt>" ));
+	int alignMethodValue = ad->alignMoveOrResizeCombo->currentIndex();
+	ad->alignMoveOrResizeCombo->clear();
+	ad->alignMoveOrResizeCombo->addItem( tr("Move") );
+	ad->alignMoveOrResizeCombo->addItem( tr("Resize") );
+	ad->alignMoveOrResizeCombo->setToolTip( tr( "<qt>When aligning one side of an item do one of the following:<ul><li>Always move the other side too (preserve existing width and height)</li><li>Keep the other side fixed (resize the item instead of moving it) whenever possible</li></ul></qt>" ));
 	alignMethodChanged(alignMethodValue);
 
-	alignGuideLineEdit->setToolTip( tr( "The location of the selected guide to align to" ) );
-	alignLeftOutToolButton->setToolTip( tr( "Align right sides of items to left side of anchor" ) );
-	alignRightOutToolButton->setToolTip( tr( "Align left sides of items to right side of anchor" ) );
-	alignBottomInToolButton->setToolTip( tr( "Align bottoms" ) );
-	alignRightInToolButton->setToolTip( tr( "Align right sides" ) );
-	alignBottomOutToolButton->setToolTip( tr( "Align tops of items to bottom of anchor" ) );
-	alignCenterHorToolButton->setToolTip( tr( "Center on vertical axis" ) );
-	alignLeftInToolButton->setToolTip( tr( "Align left sides" ) );
-	alignCenterVerToolButton->setToolTip( tr( "Center on horizontal axis" ) );
-	alignTopOutToolButton->setToolTip( tr( "Align bottoms of items to top of anchor" ) );
-	alignTopInToolButton->setToolTip( tr( "Align tops" ) );
-		
-	distributeDistHToolButton->setToolTip( tr( "Make horizontal gaps between items equal" ) );
-	distributeDistValueHToolButton->setToolTip( tr( "Make horizontal gaps between items equal to the value specified" ) );
-	
-	distributeRightToolButton->setToolTip( tr( "Distribute right sides equidistantly" ) );
-	distributeBottomToolButton->setToolTip( tr( "Distribute bottoms equidistantly" ) );
-	distributeCenterHToolButton->setToolTip( tr( "Distribute centers equidistantly horizontally" ) );
-	distributeDistVToolButton->setToolTip( tr( "Make vertical gaps between items equal" ) );
-	distributeDistValueVToolButton->setToolTip( tr( "Make vertical gaps between items equal to the value specified" ) );
-	distributeLeftToolButton->setToolTip( tr( "Distribute left sides equidistantly" ) );
-	distributeCenterVToolButton->setToolTip( tr( "Distribute centers equidistantly vertically" ) );
-	distributeTopToolButton->setToolTip( tr( "Distribute tops equidistantly" ) );
-	distributeAcrossPageToolButton->setToolTip( tr( "Make horizontal gaps between items and sides of page equal" ) );
-	distributeDownPageToolButton->setToolTip( tr( "Make vertical gaps between items and the top and bottom of page equal" ) );
-	distributeAcrossMarginsToolButton->setToolTip( tr( "Make horizontal gaps between items and sides of page margins equal" ) );
-	distributeDownMarginsToolButton->setToolTip( tr( "Make vertical gaps between items and the top and bottom of page margins equal" ) );
+	ad->alignGuideLineEdit->setToolTip( tr( "The location of the selected guide to align to" ) );
+	ad->alignLeftOutToolButton->setToolTip( tr( "Align right sides of items to left side of anchor" ) );
+	ad->alignRightOutToolButton->setToolTip( tr( "Align left sides of items to right side of anchor" ) );
+	ad->alignBottomInToolButton->setToolTip( tr( "Align bottoms" ) );
+	ad->alignRightInToolButton->setToolTip( tr( "Align right sides" ) );
+	ad->alignBottomOutToolButton->setToolTip( tr( "Align tops of items to bottom of anchor" ) );
+	ad->alignCenterHorToolButton->setToolTip( tr( "Center on vertical axis" ) );
+	ad->alignLeftInToolButton->setToolTip( tr( "Align left sides" ) );
+	ad->alignCenterVerToolButton->setToolTip( tr( "Center on horizontal axis" ) );
+	ad->alignTopOutToolButton->setToolTip( tr( "Align bottoms of items to top of anchor" ) );
+	ad->alignTopInToolButton->setToolTip( tr( "Align tops" ) );
 
-	distributeDistSpinBox->setToolTip( tr( "Distribute the items with the distance specified" ) );
-	reverseDistributionCheckBox->setToolTip( tr("When distributing by a set distance, reverse the direction of the distribution of items") );
-	
+	ad->distributeDistHToolButton->setToolTip( tr( "Make horizontal gaps between items equal" ) );
+	ad->distributeDistValueHToolButton->setToolTip( tr( "Make horizontal gaps between items equal to the value specified" ) );
+
+	ad->distributeRightToolButton->setToolTip( tr( "Distribute right sides equidistantly" ) );
+	ad->distributeBottomToolButton->setToolTip( tr( "Distribute bottoms equidistantly" ) );
+	ad->distributeCenterHToolButton->setToolTip( tr( "Distribute centers equidistantly horizontally" ) );
+	ad->distributeDistVToolButton->setToolTip( tr( "Make vertical gaps between items equal" ) );
+	ad->distributeDistValueVToolButton->setToolTip( tr( "Make vertical gaps between items equal to the value specified" ) );
+	ad->distributeLeftToolButton->setToolTip( tr( "Distribute left sides equidistantly" ) );
+	ad->distributeCenterVToolButton->setToolTip( tr( "Distribute centers equidistantly vertically" ) );
+	ad->distributeTopToolButton->setToolTip( tr( "Distribute tops equidistantly" ) );
+	ad->distributeAcrossPageToolButton->setToolTip( tr( "Make horizontal gaps between items and sides of page equal" ) );
+	ad->distributeDownPageToolButton->setToolTip( tr( "Make vertical gaps between items and the top and bottom of page equal" ) );
+	ad->distributeAcrossMarginsToolButton->setToolTip( tr( "Make horizontal gaps between items and sides of page margins equal" ) );
+	ad->distributeDownMarginsToolButton->setToolTip( tr( "Make vertical gaps between items and the top and bottom of page margins equal" ) );
+
+	ad->distributeDistSpinBox->setToolTip( tr( "Distribute the items with the distance specified" ) );
+	ad->reverseDistributionCheckBox->setToolTip( tr("When distributing by a set distance, reverse the direction of the distribution of items") );
+
 	guideInfoTextNone = tr("None Selected");
 
-	swapLeftToolButton->setToolTip( tr( "Swap items to the left" ) );
-	swapRightToolButton->setToolTip( tr( "Swap items to the right" ) );
+	ad->swapLeftToolButton->setToolTip( tr( "Swap items to the left" ) );
+	ad->swapRightToolButton->setToolTip( tr( "Swap items to the right" ) );
 }
 
 void AlignDistributePalette::init()
 {
 	undoManager = UndoManager::instance();
-	
+
 	iconSetChange();
 
-	connect(alignLeftOutToolButton, SIGNAL(clicked()), this, SLOT(alignLeftOut()));
-	connect(alignRightOutToolButton, SIGNAL(clicked()), this, SLOT(alignRightOut()));
-	connect(alignBottomInToolButton, SIGNAL(clicked()), this, SLOT(alignBottomIn()));
-	connect(alignRightInToolButton, SIGNAL(clicked()), this, SLOT(alignRightIn()));
-	connect(alignBottomOutToolButton, SIGNAL(clicked()), this, SLOT(alignBottomOut()));
-	connect(alignCenterHorToolButton, SIGNAL(clicked()), this, SLOT(alignCenterHor()));
-	connect(alignLeftInToolButton, SIGNAL(clicked()), this, SLOT(alignLeftIn()));
-	connect(alignCenterVerToolButton, SIGNAL(clicked()), this, SLOT(alignCenterVer()));
-	connect(alignTopOutToolButton, SIGNAL(clicked()), this, SLOT(alignTopOut()));
-	connect(alignTopInToolButton, SIGNAL(clicked()), this, SLOT(alignTopIn()));
-	connect(distributeDistHToolButton, SIGNAL(clicked()), this, SLOT(distributeDistH()));
-	connect(distributeDistValueHToolButton, SIGNAL(clicked()), this, SLOT(distributeDistValH()));
-	connect(distributeRightToolButton, SIGNAL(clicked()), this, SLOT(distributeRight()));
-	connect(distributeBottomToolButton, SIGNAL(clicked()), this, SLOT(distributeBottom()));
-	connect(distributeCenterHToolButton, SIGNAL(clicked()), this, SLOT(distributeCenterH()));
-	connect(distributeDistVToolButton, SIGNAL(clicked()), this, SLOT(distributeDistV()));
-	connect(distributeDistValueVToolButton, SIGNAL(clicked()), this, SLOT(distributeDistValV()));
-	connect(distributeLeftToolButton, SIGNAL(clicked()), this, SLOT(distributeLeft()));
-	connect(distributeCenterVToolButton, SIGNAL(clicked()), this, SLOT(distributeCenterV()));
-	connect(distributeTopToolButton, SIGNAL(clicked()), this, SLOT(distributeTop()));
-	connect(distributeAcrossPageToolButton, SIGNAL(clicked()), this, SLOT(distributeDistAcrossPage()));
-	connect(distributeDownPageToolButton, SIGNAL(clicked()), this, SLOT(distributeDistDownPage()));
-	connect(distributeAcrossMarginsToolButton, SIGNAL(clicked()), this, SLOT(distributeDistAcrossMargins()));
-	connect(distributeDownMarginsToolButton, SIGNAL(clicked()), this, SLOT(distributeDistDownMargins()));
-	connect(swapLeftToolButton, SIGNAL(clicked()), this, SLOT(swapLeft()));
-	connect(swapRightToolButton, SIGNAL(clicked()), this, SLOT(swapRight()));
-	
-	alignRelativeToCombo->setCurrentIndex(0);
+	connect(ad->alignLeftOutToolButton, SIGNAL(clicked()), this, SLOT(alignLeftOut()));
+	connect(ad->alignRightOutToolButton, SIGNAL(clicked()), this, SLOT(alignRightOut()));
+	connect(ad->alignBottomInToolButton, SIGNAL(clicked()), this, SLOT(alignBottomIn()));
+	connect(ad->alignRightInToolButton, SIGNAL(clicked()), this, SLOT(alignRightIn()));
+	connect(ad->alignBottomOutToolButton, SIGNAL(clicked()), this, SLOT(alignBottomOut()));
+	connect(ad->alignCenterHorToolButton, SIGNAL(clicked()), this, SLOT(alignCenterHor()));
+	connect(ad->alignLeftInToolButton, SIGNAL(clicked()), this, SLOT(alignLeftIn()));
+	connect(ad->alignCenterVerToolButton, SIGNAL(clicked()), this, SLOT(alignCenterVer()));
+	connect(ad->alignTopOutToolButton, SIGNAL(clicked()), this, SLOT(alignTopOut()));
+	connect(ad->alignTopInToolButton, SIGNAL(clicked()), this, SLOT(alignTopIn()));
+	connect(ad->distributeDistHToolButton, SIGNAL(clicked()), this, SLOT(distributeDistH()));
+	connect(ad->distributeDistValueHToolButton, SIGNAL(clicked()), this, SLOT(distributeDistValH()));
+	connect(ad->distributeRightToolButton, SIGNAL(clicked()), this, SLOT(distributeRight()));
+	connect(ad->distributeBottomToolButton, SIGNAL(clicked()), this, SLOT(distributeBottom()));
+	connect(ad->distributeCenterHToolButton, SIGNAL(clicked()), this, SLOT(distributeCenterH()));
+	connect(ad->distributeDistVToolButton, SIGNAL(clicked()), this, SLOT(distributeDistV()));
+	connect(ad->distributeDistValueVToolButton, SIGNAL(clicked()), this, SLOT(distributeDistValV()));
+	connect(ad->distributeLeftToolButton, SIGNAL(clicked()), this, SLOT(distributeLeft()));
+	connect(ad->distributeCenterVToolButton, SIGNAL(clicked()), this, SLOT(distributeCenterV()));
+	connect(ad->distributeTopToolButton, SIGNAL(clicked()), this, SLOT(distributeTop()));
+	connect(ad->distributeAcrossPageToolButton, SIGNAL(clicked()), this, SLOT(distributeDistAcrossPage()));
+	connect(ad->distributeDownPageToolButton, SIGNAL(clicked()), this, SLOT(distributeDistDownPage()));
+	connect(ad->distributeAcrossMarginsToolButton, SIGNAL(clicked()), this, SLOT(distributeDistAcrossMargins()));
+	connect(ad->distributeDownMarginsToolButton, SIGNAL(clicked()), this, SLOT(distributeDistDownMargins()));
+	connect(ad->swapLeftToolButton, SIGNAL(clicked()), this, SLOT(swapLeft()));
+	connect(ad->swapRightToolButton, SIGNAL(clicked()), this, SLOT(swapRight()));
+
+	ad->alignRelativeToCombo->setCurrentIndex(0);
 	alignToChanged(0);
 	alignMethodChanged(0);
-	connect(alignRelativeToCombo, SIGNAL(activated(int)), this, SLOT(alignToChanged(int)));
-	connect(alignMoveOrResizeCombo, SIGNAL(activated(int)), this, SLOT(alignMethodChanged(int)));
-	
+	connect(ad->alignRelativeToCombo, SIGNAL(activated(int)), this, SLOT(alignToChanged(int)));
+	connect(ad->alignMoveOrResizeCombo, SIGNAL(activated(int)), this, SLOT(alignMethodChanged(int)));
+
 	unitRatio = 1.0;
 	guideDirection = -1;
-	
+
 	guideInfoText = guideInfoTextNone;
-	alignGuideLineEdit->setText(guideInfoTextNone);
+	ad->alignGuideLineEdit->setText(guideInfoTextNone);
 }
 
 void AlignDistributePalette::iconSetChange()
@@ -185,37 +195,37 @@
 {
 	IconManager& im = IconManager::instance();
 
-	alignLeftOutToolButton->setIcon(im.loadIcon("22/align-horizontal-left-out.png"));
-	alignLeftInToolButton->setIcon(im.loadIcon("22/align-horizontal-left.png"));
-	alignCenterHorToolButton->setIcon(im.loadIcon("22/align-horizontal-center.png"));
-	alignRightInToolButton->setIcon(im.loadIcon("22/align-horizontal-right.png"));
-	alignRightOutToolButton->setIcon(im.loadIcon("22/align-horizontal-right-out.png"));
+	ad->alignLeftOutToolButton->setIcon(im.loadIcon("22/align-horizontal-left-out.png"));
+	ad->alignLeftInToolButton->setIcon(im.loadIcon("22/align-horizontal-left.png"));
+	ad->alignCenterHorToolButton->setIcon(im.loadIcon("22/align-horizontal-center.png"));
+	ad->alignRightInToolButton->setIcon(im.loadIcon("22/align-horizontal-right.png"));
+	ad->alignRightOutToolButton->setIcon(im.loadIcon("22/align-horizontal-right-out.png"));
 
-	alignTopOutToolButton->setIcon(im.loadIcon("22/align-vertical-top-out.png"));
-	alignTopInToolButton->setIcon(im.loadIcon("22/align-vertical-top.png"));
-	alignCenterVerToolButton->setIcon(im.loadIcon("22/align-vertical-center.png"));
-	alignBottomInToolButton->setIcon(im.loadIcon("22/align-vertical-bottom.png"));
-	alignBottomOutToolButton->setIcon(im.loadIcon("22/align-vertical-bottom-out.png"));
+	ad->alignTopOutToolButton->setIcon(im.loadIcon("22/align-vertical-top-out.png"));
+	ad->alignTopInToolButton->setIcon(im.loadIcon("22/align-vertical-top.png"));
+	ad->alignCenterVerToolButton->setIcon(im.loadIcon("22/align-vertical-center.png"));
+	ad->alignBottomInToolButton->setIcon(im.loadIcon("22/align-vertical-bottom.png"));
+	ad->alignBottomOutToolButton->setIcon(im.loadIcon("22/align-vertical-bottom-out.png"));
 
-	distributeLeftToolButton->setIcon(im.loadIcon("22/distribute-horizontal-left.png"));
-	distributeCenterHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-center.png"));
-	distributeRightToolButton->setIcon(im.loadIcon("22/distribute-horizontal-right.png"));
-	distributeDistHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-equal.png"));
+	ad->distributeLeftToolButton->setIcon(im.loadIcon("22/distribute-horizontal-left.png"));
+	ad->distributeCenterHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-center.png"));
+	ad->distributeRightToolButton->setIcon(im.loadIcon("22/distribute-horizontal-right.png"));
+	ad->distributeDistHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-equal.png"));
 
-	distributeBottomToolButton->setIcon(im.loadIcon("22/distribute-vertical-bottom.png"));
-	distributeCenterVToolButton->setIcon(im.loadIcon("22/distribute-vertical-center.png"));
-	distributeTopToolButton->setIcon(im.loadIcon("22/distribute-vertical-top.png"));
-	distributeDistVToolButton->setIcon(im.loadIcon("22/distribute-vertical-equal.png"));
+	ad->distributeBottomToolButton->setIcon(im.loadIcon("22/distribute-vertical-bottom.png"));
+	ad->distributeCenterVToolButton->setIcon(im.loadIcon("22/distribute-vertical-center.png"));
+	ad->distributeTopToolButton->setIcon(im.loadIcon("22/distribute-vertical-top.png"));
+	ad->distributeDistVToolButton->setIcon(im.loadIcon("22/distribute-vertical-equal.png"));
 
-	distributeAcrossPageToolButton->setIcon(im.loadIcon("22/distribute-horizontal-page.png"));
-	distributeDownPageToolButton->setIcon(im.loadIcon("22/distribute-vertical-page.png"));
-	distributeAcrossMarginsToolButton->setIcon(im.loadIcon("22/distribute-horizontal-margin.png"));
-	distributeDownMarginsToolButton->setIcon(im.loadIcon("22/distribute-vertical-margin.png"));
-	distributeDistValueHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-x.png"));
-	distributeDistValueVToolButton->setIcon(im.loadIcon("22/distribute-vertical-y.png"));
+	ad->distributeAcrossPageToolButton->setIcon(im.loadIcon("22/distribute-horizontal-page.png"));
+	ad->distributeDownPageToolButton->setIcon(im.loadIcon("22/distribute-vertical-page.png"));
+	ad->distributeAcrossMarginsToolButton->setIcon(im.loadIcon("22/distribute-horizontal-margin.png"));
+	ad->distributeDownMarginsToolButton->setIcon(im.loadIcon("22/distribute-vertical-margin.png"));
+	ad->distributeDistValueHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-x.png"));
+	ad->distributeDistValueVToolButton->setIcon(im.loadIcon("22/distribute-vertical-y.png"));
 
-	swapLeftToolButton->setIcon(im.loadIcon("22/swap-left.png"));
-	swapRightToolButton->setIcon(im.loadIcon("22/swap-right.png"));
+	ad->swapLeftToolButton->setIcon(im.loadIcon("22/swap-left.png"));
+	ad->swapRightToolButton->setIcon(im.loadIcon("22/swap-right.png"));
 }
 
 void AlignDistributePalette::unitChange()
@@ -223,7 +233,7 @@
 	if (currDoc == nullptr)
 		return;
 	unitRatio = unitGetRatioFromIndex(currDoc->unitIndex());
-	distributeDistSpinBox->setNewUnit(currDoc->unitIndex());
+	ad->distributeDistSpinBox->setNewUnit(currDoc->unitIndex());
 	enableGuideButtons();
 }
 
@@ -320,12 +330,12 @@
 void AlignDistributePalette::distributeDistH(bool usingDistance)
 {
 	if (currDoc != nullptr)
-		currDoc->itemSelection_DistributeDistH(usingDistance, distributeDistSpinBox->value(), reverseDistributionCheckBox->isChecked());
+		currDoc->itemSelection_DistributeDistH(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionCheckBox->isChecked());
 }
 
 void AlignDistributePalette::distributeDistValH()
 {
-	distributeDistSpinBox->interpretText();
+	ad->distributeDistSpinBox->interpretText();
 	if (currDoc != nullptr)
 		distributeDistH(true);
 }
@@ -375,12 +385,12 @@
 void AlignDistributePalette::distributeDistV(bool usingDistance)
 {
 	if (currDoc != nullptr)
-		currDoc->itemSelection_DistributeDistV(usingDistance, distributeDistSpinBox->value(), reverseDistributionCheckBox->isChecked());
+		currDoc->itemSelection_DistributeDistV(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionCheckBox->isChecked());
 }
 
 void AlignDistributePalette::distributeDistValV()
 {
-	distributeDistSpinBox->interpretText();
+	ad->distributeDistSpinBox->interpretText();
 	if (currDoc != nullptr)
 		distributeDistV(true);
 }
@@ -421,7 +431,7 @@
 void AlignDistributePalette::localeChange()
 {
 	const QLocale& l(LocaleManager::instance().userPreferredLocale());
-	distributeDistSpinBox->setLocale(l);
+	ad->distributeDistSpinBox->setLocale(l);
 }
 
 void AlignDistributePalette::enableGuideButtons()
@@ -458,18 +468,19 @@
 	bool setterO = true;
 	if (currAlignTo == ScribusDoc::alignGuide)
 		setterO = false;
-		
-	alignLeftInToolButton->setEnabled(setterV);
-	alignLeftOutToolButton->setEnabled(setterO);
-	alignRightInToolButton->setEnabled(setterV);
-	alignRightOutToolButton->setEnabled(setterO);
-	alignCenterHorToolButton->setEnabled(setterV);
 
-	alignTopInToolButton->setEnabled(setterH);
-	alignTopOutToolButton->setEnabled(setterO);
-	alignBottomInToolButton->setEnabled(setterH);
-	alignBottomOutToolButton->setEnabled(setterO);
-	alignCenterVerToolButton->setEnabled(setterH);
-	
-	alignGuideLineEdit->setText(guideInfoText);
+	ad->alignLeftInToolButton->setEnabled(setterV);
+	ad->alignLeftOutToolButton->setEnabled(setterO);
+	ad->alignRightInToolButton->setEnabled(setterV);
+	ad->alignRightOutToolButton->setEnabled(setterO);
+	ad->alignCenterHorToolButton->setEnabled(setterV);
+
+	ad->alignTopInToolButton->setEnabled(setterH);
+	ad->alignTopOutToolButton->setEnabled(setterO);
+	ad->alignBottomInToolButton->setEnabled(setterH);
+	ad->alignBottomOutToolButton->setEnabled(setterO);
+	ad->alignCenterVerToolButton->setEnabled(setterH);
+
+	ad->alignGuideLineEdit->setText(guideInfoText);
 }
+
Index: scribus/ui/aligndistribute.h
===================================================================
--- scribus/ui/aligndistribute.h	(Revision 25546)
+++ scribus/ui/aligndistribute.h	(Arbeitskopie)
@@ -35,6 +35,7 @@
 #include "scribusapi.h"
 #include "scribusdoc.h"
 #include "ui/scdockpalette.h"
+#include "docks/dock_panelbase.h"
 
 class QComboBox;
 class QLabel;
@@ -48,15 +49,25 @@
 
 struct AlignObjs;
 
+class SCRIBUS_API AlignDistribute : public QWidget, Ui::AlignDistribute
+{
+	friend class AlignDistributePalette;
 
+public:
+	AlignDistribute( QWidget* parent = nullptr);
+	~AlignDistribute() = default;
+};
+
+
+
 /*! \brief Align/Distribute palette.
 */
-class SCRIBUS_API AlignDistributePalette : public ScDockPalette, Ui::AlignDistribute
+class SCRIBUS_API AlignDistributePalette : public DockPanelBase
 {
 	Q_OBJECT
 
 public:
-	AlignDistributePalette( QWidget* parent = nullptr, const char* name = 0);
+	AlignDistributePalette( QWidget* parent = nullptr);
 	~AlignDistributePalette() = default;
 
 	virtual void setDoc( ScribusDoc* newDoc );
@@ -68,6 +79,7 @@
 
 protected:
 	ScribusView *currView { nullptr };
+	AlignDistribute * ad {nullptr};
 
 	void changeEvent(QEvent *e) override;
 	
Index: scribus/ui/aligndistribute.ui
===================================================================
--- scribus/ui/aligndistribute.ui	(Revision 25546)
+++ scribus/ui/aligndistribute.ui	(Arbeitskopie)
@@ -1,1061 +1,1059 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>AlignDistribute</class>
- <widget class="ScDockPalette" name="AlignDistribute">
+ <widget class="QWidget" name="AlignDistribute">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>269</width>
-    <height>308</height>
+    <width>247</width>
+    <height>277</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Align and Distribute</string>
   </property>
-  <widget class="QWidget" name="dockWidgetContents">
-   <layout class="QVBoxLayout" name="verticalLayout_3">
-    <property name="leftMargin">
-     <number>3</number>
-    </property>
-    <property name="topMargin">
-     <number>3</number>
-    </property>
-    <property name="rightMargin">
-     <number>3</number>
-    </property>
-    <property name="bottomMargin">
-     <number>3</number>
-    </property>
-    <item>
-     <widget class="QTabWidget" name="tabWidget">
-      <property name="currentIndex">
-       <number>0</number>
-      </property>
-      <widget class="QWidget" name="tabAlign">
-       <attribute name="title">
-        <string>Align</string>
-       </attribute>
-       <layout class="QVBoxLayout">
-        <property name="spacing">
-         <number>3</number>
-        </property>
-        <property name="leftMargin">
-         <number>6</number>
-        </property>
-        <property name="topMargin">
-         <number>6</number>
-        </property>
-        <property name="rightMargin">
-         <number>6</number>
-        </property>
-        <property name="bottomMargin">
-         <number>6</number>
-        </property>
-        <item>
-         <layout class="QHBoxLayout" name="_2">
-          <property name="spacing">
-           <number>3</number>
-          </property>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <layout class="QGridLayout" name="_3">
-            <item row="1" column="0">
-             <widget class="QLabel" name="alignGuideLabel">
-              <property name="text">
-               <string>&amp;Selected Guide:</string>
-              </property>
-              <property name="wordWrap">
-               <bool>false</bool>
-              </property>
-              <property name="buddy">
-               <cstring>alignGuideLineEdit</cstring>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="0">
-             <widget class="QLabel" name="alignRelativeToLabel">
-              <property name="text">
-               <string>&amp;Relative To:</string>
-              </property>
-              <property name="wordWrap">
-               <bool>false</bool>
-              </property>
-              <property name="buddy">
-               <cstring>alignRelativeToCombo</cstring>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="1">
-             <widget class="QLineEdit" name="alignGuideLineEdit"/>
-            </item>
-            <item row="0" column="1">
-             <widget class="QComboBox" name="alignRelativeToCombo"/>
-            </item>
-            <item row="2" column="0">
-             <widget class="QLabel" name="alignMoveOrResizeLabel">
-              <property name="text">
-               <string>&amp;Align Sides By:</string>
-              </property>
-              <property name="wordWrap">
-               <bool>false</bool>
-              </property>
-              <property name="buddy">
-               <cstring>alignMoveOrResizeCombo</cstring>
-              </property>
-             </widget>
-            </item>
-            <item row="2" column="1">
-             <widget class="QComboBox" name="alignMoveOrResizeCombo"/>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <layout class="QHBoxLayout" name="_4">
-          <property name="spacing">
-           <number>3</number>
-          </property>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <layout class="QGridLayout" name="_5">
-            <item row="1" column="3">
-             <widget class="QToolButton" name="alignBottomInToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="1">
-             <widget class="QToolButton" name="alignTopInToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="1">
-             <widget class="QToolButton" name="alignLeftInToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="3">
-             <widget class="QToolButton" name="alignRightInToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="4">
-             <widget class="QToolButton" name="alignBottomOutToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="0">
-             <widget class="QToolButton" name="alignTopOutToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="2">
-             <widget class="QToolButton" name="alignCenterVerToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="0">
-             <widget class="QToolButton" name="alignLeftOutToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="4">
-             <widget class="QToolButton" name="alignRightOutToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="2">
-             <widget class="QToolButton" name="alignCenterHorToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <spacer>
-          <property name="orientation">
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Expanding</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>20</width>
-            <height>0</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="tabDistribute">
-       <attribute name="title">
-        <string>Distribute</string>
-       </attribute>
-       <layout class="QVBoxLayout" name="verticalLayout_2">
-        <property name="spacing">
-         <number>3</number>
-        </property>
-        <property name="leftMargin">
-         <number>6</number>
-        </property>
-        <property name="topMargin">
-         <number>6</number>
-        </property>
-        <property name="rightMargin">
-         <number>6</number>
-        </property>
-        <property name="bottomMargin">
-         <number>6</number>
-        </property>
-        <item>
-         <layout class="QHBoxLayout" name="_6">
-          <property name="spacing">
-           <number>3</number>
-          </property>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>63</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <layout class="QGridLayout" name="_7">
-            <item row="0" column="3">
-             <widget class="QToolButton" name="distributeDistHToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="2">
-             <widget class="QToolButton" name="distributeTopToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="1">
-             <widget class="QToolButton" name="distributeCenterVToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="2">
-             <widget class="QToolButton" name="distributeRightToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="2" column="2">
-             <widget class="QToolButton" name="distributeAcrossMarginsToolButton">
-              <property name="enabled">
-               <bool>true</bool>
-              </property>
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="0">
-             <widget class="QToolButton" name="distributeLeftToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="2" column="0">
-             <widget class="QToolButton" name="distributeAcrossPageToolButton">
-              <property name="enabled">
-               <bool>true</bool>
-              </property>
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="3" column="1">
-             <widget class="QToolButton" name="distributeDistValueHToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="2" column="3">
-             <widget class="QToolButton" name="distributeDownMarginsToolButton">
-              <property name="enabled">
-               <bool>true</bool>
-              </property>
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="1">
-             <widget class="QToolButton" name="distributeCenterHToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="2" column="1">
-             <widget class="QToolButton" name="distributeDownPageToolButton">
-              <property name="enabled">
-               <bool>true</bool>
-              </property>
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="3" column="2">
-             <widget class="QToolButton" name="distributeDistValueVToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="3">
-             <widget class="QToolButton" name="distributeDistVToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="0">
-             <widget class="QToolButton" name="distributeBottomToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>62</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <layout class="QHBoxLayout" name="_8">
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <layout class="QHBoxLayout" name="_9">
-            <property name="spacing">
-             <number>3</number>
-            </property>
-            <item>
-             <widget class="QLabel" name="distributeDistLabel">
-              <property name="text">
-               <string>&amp;Distance:</string>
-              </property>
-              <property name="wordWrap">
-               <bool>false</bool>
-              </property>
-              <property name="indent">
-               <number>-1</number>
-              </property>
-              <property name="buddy">
-               <cstring>distributeDistSpinBox</cstring>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="ScrSpinBox" name="distributeDistSpinBox">
-              <property name="minimumSize">
-               <size>
-                <width>50</width>
-                <height>24</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <layout class="QHBoxLayout" name="horizontalLayout_2">
-          <property name="spacing">
-           <number>3</number>
-          </property>
-          <item>
-           <spacer name="spacer">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <widget class="QCheckBox" name="reverseDistributionCheckBox">
-            <property name="text">
-             <string>Reverse Distribution</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <spacer name="spacer_2">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <spacer>
-          <property name="orientation">
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Expanding</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>20</width>
-            <height>0</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="tabSwap">
-       <attribute name="title">
-        <string>Swap</string>
-       </attribute>
-       <layout class="QVBoxLayout" name="verticalLayout">
-        <property name="spacing">
-         <number>3</number>
-        </property>
-        <property name="leftMargin">
-         <number>6</number>
-        </property>
-        <property name="topMargin">
-         <number>6</number>
-        </property>
-        <property name="rightMargin">
-         <number>6</number>
-        </property>
-        <property name="bottomMargin">
-         <number>6</number>
-        </property>
-        <item>
-         <layout class="QHBoxLayout" name="horizontalLayout">
-          <property name="spacing">
-           <number>3</number>
-          </property>
-          <item>
-           <spacer name="horizontalSpacer">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <widget class="QToolButton" name="swapLeftToolButton">
-            <property name="minimumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="iconSize">
-             <size>
-              <width>22</width>
-              <height>22</height>
-             </size>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QToolButton" name="swapRightToolButton">
-            <property name="minimumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="iconSize">
-             <size>
-              <width>22</width>
-              <height>22</height>
-             </size>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <spacer name="horizontalSpacer_2">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <spacer name="verticalSpacer">
-          <property name="orientation">
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>20</width>
-            <height>0</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </widget>
+  <layout class="QVBoxLayout" name="verticalLayout_3">
+   <property name="leftMargin">
+    <number>3</number>
+   </property>
+   <property name="topMargin">
+    <number>3</number>
+   </property>
+   <property name="rightMargin">
+    <number>3</number>
+   </property>
+   <property name="bottomMargin">
+    <number>3</number>
+   </property>
+   <item>
+    <widget class="QTabWidget" name="tabWidget">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="tabAlign">
+      <attribute name="title">
+       <string>Align</string>
+      </attribute>
+      <layout class="QVBoxLayout">
+       <property name="spacing">
+        <number>3</number>
+       </property>
+       <property name="leftMargin">
+        <number>6</number>
+       </property>
+       <property name="topMargin">
+        <number>6</number>
+       </property>
+       <property name="rightMargin">
+        <number>6</number>
+       </property>
+       <property name="bottomMargin">
+        <number>6</number>
+       </property>
+       <item>
+        <layout class="QHBoxLayout" name="_2">
+         <property name="spacing">
+          <number>3</number>
+         </property>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <layout class="QGridLayout" name="_3">
+           <item row="1" column="0">
+            <widget class="QLabel" name="alignGuideLabel">
+             <property name="text">
+              <string>&amp;Selected Guide:</string>
+             </property>
+             <property name="wordWrap">
+              <bool>false</bool>
+             </property>
+             <property name="buddy">
+              <cstring>alignGuideLineEdit</cstring>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="0">
+            <widget class="QLabel" name="alignRelativeToLabel">
+             <property name="text">
+              <string>&amp;Relative To:</string>
+             </property>
+             <property name="wordWrap">
+              <bool>false</bool>
+             </property>
+             <property name="buddy">
+              <cstring>alignRelativeToCombo</cstring>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="1">
+            <widget class="QLineEdit" name="alignGuideLineEdit"/>
+           </item>
+           <item row="0" column="1">
+            <widget class="QComboBox" name="alignRelativeToCombo"/>
+           </item>
+           <item row="2" column="0">
+            <widget class="QLabel" name="alignMoveOrResizeLabel">
+             <property name="text">
+              <string>&amp;Align Sides By:</string>
+             </property>
+             <property name="wordWrap">
+              <bool>false</bool>
+             </property>
+             <property name="buddy">
+              <cstring>alignMoveOrResizeCombo</cstring>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="1">
+            <widget class="QComboBox" name="alignMoveOrResizeCombo"/>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="_4">
+         <property name="spacing">
+          <number>3</number>
+         </property>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <layout class="QGridLayout" name="_5">
+           <item row="1" column="3">
+            <widget class="QToolButton" name="alignBottomInToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="1">
+            <widget class="QToolButton" name="alignTopInToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="1">
+            <widget class="QToolButton" name="alignLeftInToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="3">
+            <widget class="QToolButton" name="alignRightInToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="4">
+            <widget class="QToolButton" name="alignBottomOutToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="0">
+            <widget class="QToolButton" name="alignTopOutToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="2">
+            <widget class="QToolButton" name="alignCenterVerToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="0">
+            <widget class="QToolButton" name="alignLeftOutToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="4">
+            <widget class="QToolButton" name="alignRightOutToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="2">
+            <widget class="QToolButton" name="alignCenterHorToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer>
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Expanding</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
      </widget>
-    </item>
-   </layout>
-  </widget>
+     <widget class="QWidget" name="tabDistribute">
+      <attribute name="title">
+       <string>Distribute</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <property name="spacing">
+        <number>3</number>
+       </property>
+       <property name="leftMargin">
+        <number>6</number>
+       </property>
+       <property name="topMargin">
+        <number>6</number>
+       </property>
+       <property name="rightMargin">
+        <number>6</number>
+       </property>
+       <property name="bottomMargin">
+        <number>6</number>
+       </property>
+       <item>
+        <layout class="QHBoxLayout" name="_6">
+         <property name="spacing">
+          <number>3</number>
+         </property>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>63</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <layout class="QGridLayout" name="_7">
+           <item row="0" column="3">
+            <widget class="QToolButton" name="distributeDistHToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="2">
+            <widget class="QToolButton" name="distributeTopToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="1">
+            <widget class="QToolButton" name="distributeCenterVToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="2">
+            <widget class="QToolButton" name="distributeRightToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="2">
+            <widget class="QToolButton" name="distributeAcrossMarginsToolButton">
+             <property name="enabled">
+              <bool>true</bool>
+             </property>
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="0">
+            <widget class="QToolButton" name="distributeLeftToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="0">
+            <widget class="QToolButton" name="distributeAcrossPageToolButton">
+             <property name="enabled">
+              <bool>true</bool>
+             </property>
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="3" column="1">
+            <widget class="QToolButton" name="distributeDistValueHToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="3">
+            <widget class="QToolButton" name="distributeDownMarginsToolButton">
+             <property name="enabled">
+              <bool>true</bool>
+             </property>
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="1">
+            <widget class="QToolButton" name="distributeCenterHToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="1">
+            <widget class="QToolButton" name="distributeDownPageToolButton">
+             <property name="enabled">
+              <bool>true</bool>
+             </property>
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="3" column="2">
+            <widget class="QToolButton" name="distributeDistValueVToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="3">
+            <widget class="QToolButton" name="distributeDistVToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="0">
+            <widget class="QToolButton" name="distributeBottomToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>62</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="_8">
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="_9">
+           <property name="spacing">
+            <number>3</number>
+           </property>
+           <item>
+            <widget class="QLabel" name="distributeDistLabel">
+             <property name="text">
+              <string>&amp;Distance:</string>
+             </property>
+             <property name="wordWrap">
+              <bool>false</bool>
+             </property>
+             <property name="indent">
+              <number>-1</number>
+             </property>
+             <property name="buddy">
+              <cstring>distributeDistSpinBox</cstring>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="ScrSpinBox" name="distributeDistSpinBox">
+             <property name="minimumSize">
+              <size>
+               <width>50</width>
+               <height>24</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_2">
+         <property name="spacing">
+          <number>3</number>
+         </property>
+         <item>
+          <spacer name="spacer">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QCheckBox" name="reverseDistributionCheckBox">
+           <property name="text">
+            <string>Reverse Distribution</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="spacer_2">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer>
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Expanding</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tabSwap">
+      <attribute name="title">
+       <string>Swap</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <property name="spacing">
+        <number>3</number>
+       </property>
+       <property name="leftMargin">
+        <number>6</number>
+       </property>
+       <property name="topMargin">
+        <number>6</number>
+       </property>
+       <property name="rightMargin">
+        <number>6</number>
+       </property>
+       <property name="bottomMargin">
+        <number>6</number>
+       </property>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout">
+         <property name="spacing">
+          <number>3</number>
+         </property>
+         <item>
+          <spacer name="horizontalSpacer">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QToolButton" name="swapLeftToolButton">
+           <property name="minimumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="iconSize">
+            <size>
+             <width>22</width>
+             <height>22</height>
+            </size>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QToolButton" name="swapRightToolButton">
+           <property name="minimumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="iconSize">
+            <size>
+             <width>22</width>
+             <height>22</height>
+            </size>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_2">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer name="verticalSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
  </widget>
  <customwidgets>
   <customwidget>
@@ -1063,12 +1061,6 @@
    <extends>QDoubleSpinBox</extends>
    <header>ui/scrspinbox.h</header>
   </customwidget>
-  <customwidget>
-   <class>ScDockPalette</class>
-   <extends>QDockWidget</extends>
-   <header>ui/scdockpalette.h</header>
-   <container>1</container>
-  </customwidget>
  </customwidgets>
  <tabstops>
   <tabstop>alignRelativeToCombo</tabstop>
@@ -1106,7 +1098,6 @@
  </tabstops>
  <includes>
   <include location="local">ui/scrspinbox.h</include>
-  <include location="local">ui/scdockpalette.h</include>
  </includes>
  <resources/>
  <connections/>
Index: scribus/ui/bookmarkpalette.cpp
===================================================================
--- scribus/ui/bookmarkpalette.cpp	(Revision 25546)
+++ scribus/ui/bookmarkpalette.cpp	(Arbeitskopie)
@@ -25,7 +25,7 @@
 
 #include "bookmarkpalette.h"
 
-BookPalette::BookPalette(QWidget* parent) : ScDockPalette( parent, "Books" )
+BookPalette::BookPalette(QWidget* parent) : DockPanelBase( "Books", parent )
 {
 	setObjectName(QString::fromLocal8Bit("Books"));
 	setContentsMargins(3, 3, 3, 3);
@@ -41,7 +41,7 @@
 	if (e->type() == QEvent::LanguageChange)
 		languageChange();
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void BookPalette::languageChange()
Index: scribus/ui/bookmarkpalette.h
===================================================================
--- scribus/ui/bookmarkpalette.h	(Revision 25546)
+++ scribus/ui/bookmarkpalette.h	(Arbeitskopie)
@@ -29,7 +29,8 @@
 class QEvent;
 
 #include "scribusapi.h"
-#include "scdockpalette.h"
+//#include "scdockpalette.h"
+#include "ui/docks/dock_panelbase.h"
 #include "bookmwin.h"
 /**
   *@author Franz Schmid
@@ -36,7 +37,7 @@
   */
 
 /*! \brief A Bookmark Palette */
-class SCRIBUS_API BookPalette : public ScDockPalette
+class SCRIBUS_API BookPalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/contentpalette.cpp
===================================================================
--- scribus/ui/contentpalette.cpp	(Revision 25546)
+++ scribus/ui/contentpalette.cpp	(Arbeitskopie)
@@ -25,8 +25,8 @@
 #include "styles/paragraphstyle.h"
 #include "styles/charstyle.h"
 
-ContentPalette::ContentPalette(QWidget* parent) :
-	ScDockPalette(parent, "ContentPalette", Qt::WindowFlags())
+ContentPalette::ContentPalette(QWidget *parent) :
+	DockPanelBase("ContentPalette", parent)
 {
 	setObjectName(QString::fromLocal8Bit("ContentPalette"));
 
@@ -276,7 +276,7 @@
 		updatePanelTitle();
 	}
 	updateGeometry();
-	ScDockPalette::update();
+	DockPanelBase::update();
 }
 
 void ContentPalette::unitChange()
@@ -320,7 +320,7 @@
 		languageChange();
 		return;
 	}
-	ScDockPalette::changeEvent(e);
+	DockPanelBase::changeEvent(e);
 }
 
 void ContentPalette::updatePanelTitle()
Index: scribus/ui/contentpalette.h
===================================================================
--- scribus/ui/contentpalette.h	(Revision 25546)
+++ scribus/ui/contentpalette.h	(Arbeitskopie)
@@ -9,6 +9,7 @@
 
 #include "scribusapi.h"
 #include "scdockpalette.h"
+#include "docks/dock_panelbase.h"
 #include "scguardedptr.h"
 
 class QStackedWidget;
@@ -28,7 +29,7 @@
 class ParagraphStyle;
 class CharStyle;
 
-class SCRIBUS_API ContentPalette : public ScDockPalette
+class SCRIBUS_API ContentPalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/docks/dock_centralwidget.cpp
===================================================================
--- scribus/ui/docks/dock_centralwidget.cpp	(nicht existent)
+++ scribus/ui/docks/dock_centralwidget.cpp	(Arbeitskopie)
@@ -0,0 +1,29 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+#include "dock_centralwidget.h"
+
+DockCentralWidget::DockCentralWidget(QWidget *parent) : ads::CDockWidget(QString(), parent)
+{
+
+	setObjectName(QString::fromLocal8Bit("DockCentralWidget"));
+
+    setFeature(ads::CDockWidget::NoTab, true);
+    setFeature(ads::CDockWidget::DockWidgetFloatable, false);
+}
+
Index: scribus/ui/docks/dock_centralwidget.h
===================================================================
--- scribus/ui/docks/dock_centralwidget.h	(nicht existent)
+++ scribus/ui/docks/dock_centralwidget.h	(Arbeitskopie)
@@ -0,0 +1,35 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+
+#ifndef DOCK_CENTRALWIDGET_H
+#define DOCK_CENTRALWIDGET_H
+
+#include "third_party/Qt-Advanced-Docking-System/src/DockWidget.h"
+
+class DockCentralWidget : public ads::CDockWidget
+{
+    Q_OBJECT
+
+public:
+    explicit DockCentralWidget(QWidget *parent = nullptr);
+
+
+};
+
+#endif // DOCK_CENTRALWIDGET_H
Index: scribus/ui/docks/dock_panelbase.cpp
===================================================================
--- scribus/ui/docks/dock_panelbase.cpp	(nicht existent)
+++ scribus/ui/docks/dock_panelbase.cpp	(Arbeitskopie)
@@ -0,0 +1,92 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+
+#include "dock_panelbase.h"
+
+#include <QApplication>
+
+#include "iconmanager.h"
+#include "prefscontext.h"
+#include "prefsfile.h"
+#include "prefsmanager.h"
+
+DockPanelBase::DockPanelBase(const QString &title, QIcon icon, QWidget *parent)  : DockPanelBase(title, parent)
+{
+	this->setIcon(icon);
+}
+
+
+DockPanelBase::DockPanelBase(const QString &title, QWidget *parent) : CDockWidget(title, parent)
+{
+	if (PrefsManager::instance().appPrefs.uiPrefs.useSmallWidgets)
+	{
+		setStyleSheet("	QToolButton { margin: 1px; padding: 0px; font-size: 10px; } \
+						QToolButton:pressed { padding-top: 2px; padding-left: 2px } \
+						QPushButton { margin: 1px; padding: 0px; font-size: 10px; } \
+						QPushButton:pressed { padding-top: 2px; padding-left: 2px } \
+						QRadioButton, QComboBox, QLineEdit \
+							QListView, QLabel { margin:1px; padding: 0px; font-size: 10px; } \
+						QCheckBox, QSpinBox, QDoubleSpinBox \
+							{ margin:1px; padding: 0px; font-size: 10px; } \
+						QTabWidget, QTabBar, QTableView, QGroupBox, QTreeView \
+							{ font-size: 10px ; } \
+						QToolBox::tab { font-size: 10px; padding: 0px; margin: 0px; } \
+					");
+	}
+	m_originalParent = parent;
+//	setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+	setWindowIcon(IconManager::instance().loadPixmap("AppIcon.png"));
+	setPrefsContext(title);
+	setObjectName(title);
+	connect(&PrefsManager::instance(), SIGNAL(prefsChanged()), this, SLOT(setFontSize()));
+}
+
+void DockPanelBase::setWidget(QWidget *widget)
+{
+    ads::CDockWidget::setWidget(widget);
+
+}
+
+void DockPanelBase::setPrefsContext(const QString& context)
+{
+	if (m_prefsContextName.isEmpty())
+	{
+		m_prefsContextName=context;
+		if (!m_prefsContextName.isEmpty())
+		{
+			m_palettePrefs = PrefsManager::instance().prefsFile->getContext(m_prefsContextName);
+		}
+		else
+			m_palettePrefs = nullptr;
+	}
+}
+
+void DockPanelBase::startup()
+{
+	setFontSize();
+}
+
+void DockPanelBase::setFontSize()
+{
+	QFont newfont(font());
+	newfont.setPointSize(PrefsManager::instance().appPrefs.uiPrefs.paletteFontSize);
+	setFont(newfont);
+}
+
+
Index: scribus/ui/docks/dock_panelbase.h
===================================================================
--- scribus/ui/docks/dock_panelbase.h	(nicht existent)
+++ scribus/ui/docks/dock_panelbase.h	(Arbeitskopie)
@@ -0,0 +1,54 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+
+#ifndef DOCK_PANELBASE_H
+#define DOCK_PANELBASE_H
+
+#include "third_party/Qt-Advanced-Docking-System/src/DockWidget.h"
+#include "scribusapi.h"
+using namespace ads;
+
+class PrefsContext;
+
+class SCRIBUS_API DockPanelBase : public CDockWidget
+{
+	Q_OBJECT
+
+public:
+    DockPanelBase(const QString &title, QWidget *parent = 0);
+    DockPanelBase(const QString &title, QIcon icon, QWidget *parent = 0);
+
+    void setWidget(QWidget *widget);
+	void startup();
+
+public slots:
+	virtual void setFontSize();
+
+protected:
+	/** @brief Set the Preferences context to be used for storage of startup visibility and position and size */
+	virtual void setPrefsContext(const QString& context);
+
+	PrefsContext* m_palettePrefs {nullptr};
+	QString m_prefsContextName;
+	QWidget* m_originalParent {nullptr};
+	QWidget* m_tempParent {nullptr};
+
+};
+
+#endif // DOCK_PANELBASE_H
Index: scribus/ui/inlinepalette.cpp
===================================================================
--- scribus/ui/inlinepalette.cpp	(Revision 25546)
+++ scribus/ui/inlinepalette.cpp	(Arbeitskopie)
@@ -101,7 +101,7 @@
 	clearSelection();
 }
 
-InlinePalette::InlinePalette( QWidget* parent) : ScDockPalette(parent, "Inline", Qt::WindowFlags())
+InlinePalette::InlinePalette( QWidget* parent) : DockPanelBase("Inline", parent)
 {
 	setContentsMargins(3, 3, 3, 3);
 	setMinimumSize( QSize( 220, 240 ) );
@@ -282,7 +282,7 @@
 		languageChange();
 	}
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void InlinePalette::languageChange()
Index: scribus/ui/inlinepalette.h
===================================================================
--- scribus/ui/inlinepalette.h	(Revision 25546)
+++ scribus/ui/inlinepalette.h	(Arbeitskopie)
@@ -43,7 +43,7 @@
 
 
 #include "scribusapi.h"
-#include "scdockpalette.h"
+#include "ui/docks/dock_panelbase.h"
 #include "sclistwidgetdelegate.h"
 
 class SCRIBUS_API InlineView : public QListWidget
@@ -67,7 +67,7 @@
 	ScListWidgetDelegate* delegate { nullptr };
 };
 
-class SCRIBUS_API InlinePalette : public ScDockPalette
+class SCRIBUS_API InlinePalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/layers.cpp
===================================================================
--- scribus/ui/layers.cpp	(Revision 25546)
+++ scribus/ui/layers.cpp	(Arbeitskopie)
@@ -39,9 +39,10 @@
 #include "scribusdoc.h"
 #include "selection.h"
 #include "ui/scrspinbox.h"
+#include "docks/dock_panelbase.h"
 #include "undomanager.h"
 
-LayerPalette::LayerPalette(QWidget* parent) : ScDockPalette(parent, "Layers", Qt::WindowFlags())
+LayerPalette::LayerPalette(QWidget* parent) : DockPanelBase("Layers", parent)
 {
 	setObjectName(QString::fromLocal8Bit("Layers"));
 	setMinimumSize( QSize(220, 240) );
@@ -172,7 +173,7 @@
 
 void LayerPalette::installEventFilter(QObject *obj)
 {
-	ScDockPalette::installEventFilter(obj);
+	DockPanelBase::installEventFilter(obj);
 	Table->installEventFilter(obj);
 }
 
@@ -686,7 +689,7 @@
 	if (e->type() == QEvent::LanguageChange)
 		languageChange();
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void LayerPalette::iconSetChange()
Index: scribus/ui/layers.h
===================================================================
--- scribus/ui/layers.h	(Revision 25546)
+++ scribus/ui/layers.h	(Arbeitskopie)
@@ -10,7 +10,8 @@
 #include <QList>
 
 #include "scribusapi.h"
-#include "ui/scdockpalette.h"
+//#include "ui/scdockpalette.h"
+#include "ui/docks/dock_panelbase.h"
 #include "scribusstructs.h"
 
 class CheckBox;
@@ -27,7 +28,7 @@
 class ScrSpinBox;
 class ScribusDoc;
 
-class SCRIBUS_API LayerPalette : public ScDockPalette
+class SCRIBUS_API LayerPalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/outlinepalette.cpp
===================================================================
--- scribus/ui/outlinepalette.cpp	(Revision 25546)
+++ scribus/ui/outlinepalette.cpp	(Arbeitskopie)
@@ -431,7 +431,7 @@
 	return true;
 }
 
-OutlinePalette::OutlinePalette( QWidget* parent) : ScDockPalette(parent, "Tree", Qt::WindowFlags())
+OutlinePalette::OutlinePalette( QWidget* parent) : DockPanelBase("Tree", parent)
 {
 //	resize( 220, 240 );
 	setMinimumSize( QSize( 220, 240 ) );
@@ -506,9 +506,9 @@
 	clearPalette();
 }
 
-void OutlinePalette::setPaletteShown(bool visible)
+void OutlinePalette::toggleView(bool visible)
 {
-	ScDockPalette::setPaletteShown(visible);
+	DockPanelBase::toggleView(visible);
 	if (visible && (currDoc != nullptr))
 		BuildTree();
 }
@@ -1445,7 +1445,7 @@
 	if (e->type() == QEvent::LanguageChange)
 		languageChange();
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void OutlinePalette::iconSetChange()
Index: scribus/ui/outlinepalette.h
===================================================================
--- scribus/ui/outlinepalette.h	(Revision 25546)
+++ scribus/ui/outlinepalette.h	(Arbeitskopie)
@@ -18,6 +18,7 @@
 
 #include "scribusapi.h"
 #include "scdockpalette.h"
+#include "docks/dock_panelbase.h"
 
 class ScribusMainWindow;
 class ScribusDoc;
@@ -54,7 +55,7 @@
 	bool viewportEvent(QEvent *event) override;
 };
 
-class SCRIBUS_API OutlinePalette : public ScDockPalette
+class SCRIBUS_API OutlinePalette : public DockPanelBase
 {
 	Q_OBJECT
 
@@ -76,7 +77,7 @@
 	void iconSetChange();
 	void languageChange();
 	void slotShowSelect(int pageNr, PageItem *pageItem);
-	void setPaletteShown(bool) override;
+	void toggleView(bool);
 	void slotRightClick(QPoint point);
 	void setActiveLayer(int layerID);
 	void setLayerVisible(int layerID);
Index: scribus/ui/pagepalette.cpp
===================================================================
--- scribus/ui/pagepalette.cpp	(Revision 25546)
+++ scribus/ui/pagepalette.cpp	(Arbeitskopie)
@@ -21,9 +21,9 @@
 #include "scribusdoc.h"
 #include "scribusview.h"
 
-PagePalette::PagePalette(QWidget* parent) : ScDockPalette(parent, "PagePalette", Qt::WindowFlags())
+PagePalette::PagePalette(QWidget *parent) : DockPanelBase("PagePalette", parent)
 {
-	m_scMW = (ScribusMainWindow*) parent;
+	m_scMW = nullptr;//(ScribusMainWindow*) parent;
 	m_view = nullptr;
 
 	setObjectName(QString::fromLocal8Bit("PagePalette"));
@@ -31,16 +31,13 @@
 	QStackedWidget* stackedWidget = new QStackedWidget(this);
 	stackedWidget->setObjectName(QString::fromLocal8Bit("stackedWidget"));
 
-	PagePalette_Pages* pageWidget = new PagePalette_Pages(stackedWidget);
-	pageWidget->setObjectName(QString::fromLocal8Bit("PagePalette_Pages"));
-	stackedWidget->addWidget(pageWidget);
+	m_pageWidget = new PagePalette_Pages(stackedWidget);
+	m_pageWidget->setObjectName(QString::fromLocal8Bit("PagePalette_Pages"));
+	stackedWidget->addWidget(m_pageWidget);
 
 	setWidget(stackedWidget);
 
-	connect(pageWidget, SIGNAL(gotoMasterPage(QString)), m_scMW, SLOT(editMasterPagesStart(QString)));
-	
-	rebuild();
-	languageChange();
+
 }
 
 QWidget* PagePalette::currentWidget()
@@ -65,6 +62,16 @@
 	return nullptr;
 }
 
+void PagePalette::setMainWindow(ScribusMainWindow *scMW)
+{
+	m_scMW = scMW;
+
+	connect(m_pageWidget, SIGNAL(gotoMasterPage(QString)), m_scMW, SLOT(editMasterPagesStart(QString)));
+
+	rebuild();
+	languageChange();
+}
+
 QStackedWidget* PagePalette::stackedWidget() const
 {
 	QStackedWidget* sw = dynamic_cast<QStackedWidget*>(this->widget());
@@ -185,7 +200,7 @@
 	}
 	else
 	{
-		ScribusDoc* doc = m_view->m_doc;
+		//ScribusDoc* doc = m_view->m_doc;
 		PagePalette_MasterPages* mpWidget = this->masterpageWidget();
 		if (mpWidget->m_view != m_view)
 			mpWidget->setView(m_view, masterPage);
@@ -226,7 +241,7 @@
 		return;
 	}
 
-	ScDockPalette::changeEvent(e);
+	DockPanelBase::changeEvent(e);
 }
 
 void PagePalette::languageChange()
Index: scribus/ui/pagepalette.h
===================================================================
--- scribus/ui/pagepalette.h	(Revision 25546)
+++ scribus/ui/pagepalette.h	(Arbeitskopie)
@@ -23,19 +23,21 @@
 class TrashBin;
 
 #include "scribusapi.h"
-#include "scdockpalette.h"
+//#include "scdockpalette.h"
+#include "docks/dock_panelbase.h"
 
 class PagePalette_MasterPages;
 class PagePalette_Pages;
 class ScribusView;
 class ScribusMainWindow;
+class DockManager;
 
-class SCRIBUS_API PagePalette : public ScDockPalette
+class SCRIBUS_API PagePalette : public DockPanelBase
 {
 	Q_OBJECT
 
 public:
-	PagePalette(QWidget* parent);
+	PagePalette(QWidget *parent);
 	~PagePalette() {};
 	
 	QWidget* currentWidget();
@@ -44,9 +46,12 @@
 	PagePalette_MasterPages* masterpageWidget() const;
 	PagePalette_Pages* pageWidget() const;
 
+	void setMainWindow(ScribusMainWindow * scMW);
+
 protected:
 	ScribusView       *m_view;
 	ScribusMainWindow *m_scMW;
+	PagePalette_Pages* m_pageWidget {nullptr};
 
 	void changeEvent(QEvent *e) override;
 
Index: scribus/ui/propertiespalette.cpp
===================================================================
--- scribus/ui/propertiespalette.cpp	(Revision 25546)
+++ scribus/ui/propertiespalette.cpp	(Arbeitskopie)
@@ -46,7 +46,7 @@
 #include "util_math.h"
 
 
-PropertiesPalette::PropertiesPalette( QWidget* parent) : ScDockPalette(parent, "PropertiesPalette", Qt::WindowFlags())
+PropertiesPalette::PropertiesPalette(QWidget *parent) : DockPanelBase("PropertiesPalette", parent)
 {
 	undoManager = UndoManager::instance();
 
@@ -109,7 +109,7 @@
 			m_ScMW->view->RefreshGradient(m_item);
 		}
 	}
-	ScDockPalette::closeEvent(closeEvent);
+	DockPanelBase::closeEvent(closeEvent);
 }
 
 void PropertiesPalette::setMainWindow(ScribusMainWindow* mw)
@@ -735,7 +737,7 @@
 		languageChange();
 		return;
 	}
-	ScDockPalette::changeEvent(e);
+	DockPanelBase::changeEvent(e);
 }
 
 void PropertiesPalette::languageChange()
Index: scribus/ui/propertiespalette.h
===================================================================
--- scribus/ui/propertiespalette.h	(Revision 25546)
+++ scribus/ui/propertiespalette.h	(Arbeitskopie)
@@ -30,6 +30,7 @@
 #include "sctreewidget.h"
 #include "stylecombos.h"
 #include "units.h"
+#include "docks/dock_panelbase.h"
 
 class ColorCombo;
 class ColorPalette;
@@ -46,7 +47,7 @@
 class UndoManager;
 class TransparencyPalette;
 
-class SCRIBUS_API PropertiesPalette : public ScDockPalette
+class SCRIBUS_API PropertiesPalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/scrapbookpalette.cpp
===================================================================
--- scribus/ui/scrapbookpalette.cpp	(Revision 25546)
+++ scribus/ui/scrapbookpalette.cpp	(Arbeitskopie)
@@ -715,7 +715,7 @@
 }
 
 /* This is the main Dialog-Class for the Scrapbook */
-Biblio::Biblio(QWidget* parent) : ScDockPalette(parent, "Sclib", Qt::WindowFlags())
+Biblio::Biblio(QWidget* parent) : DockPanelBase("Sclib", parent)
 {
 	setObjectName(QString::fromLocal8Bit("Sclib"));
 	setMinimumSize( QSize(220, 240) );
@@ -2003,7 +2003,7 @@
 	if (e->type() == QEvent::LanguageChange)
 		languageChange();
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void Biblio::iconSetChange()
Index: scribus/ui/scrapbookpalette.h
===================================================================
--- scribus/ui/scrapbookpalette.h	(Revision 25546)
+++ scribus/ui/scrapbookpalette.h	(Arbeitskopie)
@@ -15,8 +15,9 @@
 class QEvent;
 
 #include "scribusapi.h"
-#include "scdockpalette.h"
+//#include "scdockpalette.h"
 #include "scribusstructs.h"
+#include "ui/docks/dock_panelbase.h"
 
 class QHBoxLayout;
 class QToolButton;
@@ -67,7 +68,7 @@
 	void startDrag(Qt::DropActions supportedActions) override;
 };
 
-class SCRIBUS_API Biblio : public ScDockPalette
+class SCRIBUS_API Biblio : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/symbolpalette.cpp
===================================================================
--- scribus/ui/symbolpalette.cpp	(Revision 25546)
+++ scribus/ui/symbolpalette.cpp	(Arbeitskopie)
@@ -150,7 +150,7 @@
 	clearSelection();
 }
 
-SymbolPalette::SymbolPalette( QWidget* parent) : ScDockPalette(parent, "Symb", Qt::WindowFlags())
+SymbolPalette::SymbolPalette( QWidget* parent) : DockPanelBase("Symb", parent)
 {
 	setContentsMargins(3, 3, 3, 3);
 	setMinimumSize( QSize( 220, 240 ) );
@@ -321,7 +321,7 @@
 		languageChange();
 	}
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void SymbolPalette::languageChange()
Index: scribus/ui/symbolpalette.h
===================================================================
--- scribus/ui/symbolpalette.h	(Revision 25546)
+++ scribus/ui/symbolpalette.h	(Arbeitskopie)
@@ -41,8 +41,9 @@
 
 
 #include "scribusapi.h"
-#include "scdockpalette.h"
+//#include "scdockpalette.h"
 #include "sclistwidgetdelegate.h"
+#include "ui/docks/dock_panelbase.h"
 
 class SCRIBUS_API SymbolView : public QListWidget
 {
@@ -70,7 +71,7 @@
 	ScListWidgetDelegate* m_delegate { nullptr };
 };
 
-class SCRIBUS_API SymbolPalette : public ScDockPalette
+class SCRIBUS_API SymbolPalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/undogui.cpp
===================================================================
--- scribus/undogui.cpp	(Revision 25546)
+++ scribus/undogui.cpp	(Arbeitskopie)
@@ -38,7 +38,7 @@
 #include "undogui.h"
 
 
-UndoGui::UndoGui(QWidget* parent, const char* name, Qt::WindowFlags f) : ScDockPalette(parent, name, f)
+UndoGui::UndoGui(QWidget* parent, const char* name) : DockPanelBase(name, parent)
 {
 	languageChange();
 }
@@ -184,9 +184,9 @@
 
 /*** UndoPalette **************************************************************/
 
-UndoPalette::UndoPalette(QWidget* parent, const char* name) : UndoGui(parent, name)
+UndoPalette::UndoPalette(QWidget* parent) : UndoGui(parent, "undoPalette")
 {
-	setObjectName(QString::fromLocal8Bit(name));
+	setObjectName(QString::fromLocal8Bit("undoPalette"));
 	setMinimumSize( QSize(220, 240) );
 	setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
 
Index: scribus/undogui.h
===================================================================
--- scribus/undogui.h	(Revision 25546)
+++ scribus/undogui.h	(Arbeitskopie)
@@ -33,7 +33,8 @@
 #include "scribusapi.h"
 #include "undoobject.h"
 #include "undostate.h"
-#include "ui/scdockpalette.h"
+//#include "ui/scdockpalette.h"
+#include "ui/docks/dock_panelbase.h"
 
 class QEvent;
 class QMenu;
@@ -56,18 +57,18 @@
  * @author Riku Leino  tsoots@gmail.com
  * @date December 2004
  */
-class SCRIBUS_API UndoGui : public ScDockPalette
+class SCRIBUS_API UndoGui : public DockPanelBase
 {
 	Q_OBJECT
 
 public:
 	/**
-	 * @brief Creates a new UndoGui instance. 
+	 * @brief Creates a new UndoGui instance.
 	 * @param parent Parent object for UndoGui
 	 * @param name Name of the object
 	 * @param f widget flags
 	 */
-	UndoGui(QWidget* parent = nullptr, const char* name = "UndoGui", Qt::WindowFlags f = Qt::WindowFlags());
+	UndoGui(QWidget* parent = nullptr, const char* name = "UndoGui");
 
 	/** @brief Destroys the widget */
 	virtual ~UndoGui() {}
@@ -268,7 +269,7 @@
 	 * Creates a new UndoPalette instance. After creation of an UndoPalette it must
 	 * be registered to the UndoManager with UndoManager's registerGui() method.
 	 */
-	UndoPalette(QWidget* parent = nullptr, const char* name = 0);
+	UndoPalette(QWidget* parent = nullptr);
 
 	/** @brief Destroys the widget */
 	~UndoPalette() = default;
ads_23-07-12_01.patch (195,430 bytes)   

nitramr

2023-07-16 18:29

developer   ~0050274

Patch Notes:

1. fix width of default panels (290px)
2. fix standard icons for moving things up and down (on all most all placed it used the new layer up and down icons)
3. shape panel is now docked by default, but hidden
ads_2023-07-16_01.patch (201,122 bytes)   
Index: resources/iconsets/1_7_0/16/page-duplicate.svg
===================================================================
Kann nicht anzeigen: Dateityp ist als binär angegeben.
svn:mime-type = image/svg+xml

Property changes on: resources/iconsets/1_7_0/16/page-duplicate.svg
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-image/svg+xml
\ No newline at end of property
Index: resources/iconsets/1_7_0/16/page-import.svg
===================================================================
Kann nicht anzeigen: Dateityp ist als binär angegeben.
svn:mime-type = image/svg+xml

Property changes on: resources/iconsets/1_7_0/16/page-import.svg
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-image/svg+xml
\ No newline at end of property
Index: resources/iconsets/1_7_0/16/page-insert.svg
===================================================================
Kann nicht anzeigen: Dateityp ist als binär angegeben.
svn:mime-type = image/svg+xml

Property changes on: resources/iconsets/1_7_0/16/page-insert.svg
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-image/svg+xml
\ No newline at end of property
Index: resources/iconsets/1_7_0/16/page-move.svg
===================================================================
Kann nicht anzeigen: Dateityp ist als binär angegeben.
svn:mime-type = image/svg+xml

Property changes on: resources/iconsets/1_7_0/16/page-move.svg
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-image/svg+xml
\ No newline at end of property
Index: resources/iconsets/1_7_0/1_7_0.xml
===================================================================
--- resources/iconsets/1_7_0/1_7_0.xml	(Revision 25546)
+++ resources/iconsets/1_7_0/1_7_0.xml	(Arbeitskopie)
@@ -347,13 +347,13 @@
 		<icon id="32/page-doublesided.png" file="32/page-double.svg" />
 		<icon id="32/page-simple.png" file="32/page-simple.svg" />
 		<icon id="16/go-bottom.png" file="16/object-level-background.svg" />
-		<icon id="16/go-down.png" file="16/object-level-down.svg" />
+		<icon id="16/go-down.png" file="16/action-chevron-down.svg" />
 		<icon id="16/go-top.png" file="16/object-level-foreground.svg" />
-		<icon id="16/go-up.png" file="16/object-level-up.svg" />
+		<icon id="16/go-up.png" file="16/action-chevron-up.svg" />
 		<icon id="22/go-bottom.png" file="16/object-level-background.svg" />
-		<icon id="22/go-down.png" file="16/object-level-down.svg" />
+		<icon id="22/go-down.png" file="16/action-chevron-down.svg" />
 		<icon id="22/go-top.png" file="16/object-level-foreground.svg" />
-		<icon id="22/go-up.png" file="16/object-level-up.svg" />
+		<icon id="22/go-up.png" file="16/action-chevron-up.svg" />
 		<icon id="layer-outline.png" file="16/object-outline.svg" />
 		<icon id="16/layer-flow-around.png" file="16/text-wrap-shape.svg" />
 		<icon id="16/lock-unlocked.png" file="16/action-unlock.svg" />
@@ -365,6 +365,12 @@
 		<icon id="/16/list-remove.png" file="16/action-remove.svg" />
 		<icon id="16/list-remove.png" file="16/action-remove.svg" />
 		<icon id="22/list-remove.png" file="16/action-remove.svg" />
+		<icon id="page-move" file="16/page-move.svg" />
+		<icon id="page-insert" file="16/page-insert.svg" />
+		<icon id="page-duplicate" file="16/page-duplicate.svg" />
+		<icon id="page-import" file="16/page-import.svg" />
+		<icon id="layer-move-down" file="16/object-level-down.svg" />
+		<icon id="layer-move-up" file="16/object-level-up.svg" />
     
 		<!-- PDF Tools -->
 		<icon id="16/insert-button.png" file="16/pdf-button.svg" />
@@ -551,7 +557,14 @@
 		<icon id="wizard16.png" file="16/tool-copy-style.svg" />
 		<!-- Red onLight="#E54545" onDark="#FF6666" -->
 		<icon id="16/insert-barcode.png" file="16/tool-insert-barcode.svg" />
-		<icon id="22/insert-barcode.png" file="16/tool-insert-barcode.svg" /> 
+		<icon id="22/insert-barcode.png" file="16/tool-insert-barcode.svg" />
 		
+		<!-- Windows -->
+		<!--		
+		<icon id="close" file="16/action-close.svg" />
+		<icon id="menu-down" file="16/action-chevron-down.svg" />
+		<icon id="dock-float" file="16/action-window-float.svg" />
+		-->
+		
 	</icons>
 </iconset>
Index: scribus/CMakeLists.txt
===================================================================
--- scribus/CMakeLists.txt	(Revision 25546)
+++ scribus/CMakeLists.txt	(Arbeitskopie)
@@ -285,7 +285,7 @@
 )
 
 if(WANT_QTADS)
-  target_link_libraries(${EXE_NAME} PRIVATE qt6advanceddocking)
+  target_link_libraries(${EXE_NAME} PUBLIC qt6advanceddocking)
 endif()
 
 if(WITH_TESTS)
Index: scribus/CMakeLists_Sources.txt
===================================================================
--- scribus/CMakeLists_Sources.txt	(Revision 25546)
+++ scribus/CMakeLists_Sources.txt	(Arbeitskopie)
@@ -240,7 +240,7 @@
 	util_printer.cpp
 	util_text.cpp
 	vgradient.cpp
-	vgradientex.cpp
+	vgradientex.cpp	
 	downloadmanager/scdlmgr.cpp
 	downloadmanager/scdlthread.cpp
 	imagedataloaders/scimgdataloader.cpp
@@ -257,6 +257,7 @@
 	imagedataloaders/scimgdataloader_qt.cpp
 	imagedataloaders/scimgdataloader_tiff.cpp
 	imagedataloaders/scimgdataloader_wpg.cpp
+	manager/dock_manager.cpp
 	palettes/cxfcolor.cpp
 	palettes/cxfcolorspecification.cpp
 	palettes/cxfdocument.cpp
@@ -535,6 +536,8 @@
 	ui/vruler.cpp
 	ui/useprintermarginsdialog.cpp
 	ui/weldedit.cpp
+	ui/docks/dock_centralwidget.cpp
+	ui/docks/dock_panelbase.cpp
 	${SCRIBUS_OSG_SRC}
 	${SCRIBUS_GMAGICK_SRC}
 	${SCRIBUS_JPEGXL_SRC}
Index: scribus/manager/dock_manager.cpp
===================================================================
--- scribus/manager/dock_manager.cpp	(nicht existent)
+++ scribus/manager/dock_manager.cpp	(Arbeitskopie)
@@ -0,0 +1,215 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+#include "dock_manager.h"
+
+#include "ui/docks/dock_centralwidget.h"
+#include "third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.h"
+#include "third_party/Qt-Advanced-Docking-System/src/DockSplitter.h"
+#include <QMenu>
+
+#include "ui/pagepalette.h"
+#include "ui/outlinepalette.h"
+#include "ui/propertiespalette.h"
+#include "ui/contentpalette.h"
+#include "ui/layers.h"
+#include "ui/aligndistribute.h"
+#include "ui/inlinepalette.h"
+#include "ui/bookmarkpalette.h"
+#include "ui/scrapbookpalette.h"
+#include "ui/symbolpalette.h"
+#include "undogui.h"
+#include "prefsmanager.h"
+#include "prefsfile.h"
+
+//#include "icon_manager.h"
+
+/* ********************************************************************************* *
+ *
+ * Constructor + Setup
+ *
+ * ********************************************************************************* */
+
+DockManager::DockManager(QWidget *parent) : CDockManager(parent)
+{
+	dockCenter = new DockCentralWidget();
+	auto * areaCenter = CDockManager::setCentralWidget(dockCenter);
+	areaCenter->setAllowedAreas(DockWidgetArea::OuterDockAreas);
+
+	m_palettePrefs = PrefsManager::instance().prefsFile->getContext("user_preferences");
+
+}
+
+void DockManager::setupDocks()
+{
+	pagePalette = new PagePalette((QWidget*)this->parent());
+	contentPalette = new ContentPalette(this);
+	propertiesPalette = new PropertiesPalette(this);
+	outlinePalette = new OutlinePalette(this);
+	layerPalette = new LayerPalette(this);
+	inlinePalette = new InlinePalette(this);
+	alignDistributePalette = new AlignDistributePalette();
+	scrapbookPalette = new Biblio(this);
+	bookPalette = new BookPalette(this);
+	undoPalette = new UndoPalette(this);
+	symbolPalette = new SymbolPalette(this);
+
+    // Panel ToolProperties
+//    PanelToolProperties * panelTest = new PanelToolProperties();
+//    dockToolProperties->setWidget(panelTest);
+//    dockToolProperties->setFeature(ads::CDockWidget::NoTab, true);
+}
+
+
+void DockManager::setCentralWidget(QWidget *widget)
+{
+	dockCenter->setWidget(widget);
+}
+
+/* ********************************************************************************* *
+ *
+ * Public Methods
+ *
+ * ********************************************************************************* */
+
+void DockManager::loadDefaultWorkspace()
+{
+	/************************************************************
+	 *
+	 *
+	 *      LAYOUT SCHEME
+	 *
+	 *        290px     290px           *             290px
+	 *     |---------|---------|-------------------|---------|
+	 *     |  Left   |  Center |      Center       |  Right  |
+	 * 2/3 |         |  Left   |                   |         |
+	 *     |         |         |                   |         |
+	 *     |         |         |                   |         |
+	 *     |---------|         |                   |         |
+	 * 1/3 | Bottom  |         |                   |         |
+	 *     | Left    |         |                   |         |
+	 *     |---------|---------|-------------------|---------|
+	 *
+	 *
+	 *************************************************************/
+
+
+	auto * areaCenter = dockCenter->dockAreaWidget();
+
+	// Left	Center
+	areaCenterLeft = addDockWidget(LeftDockWidgetArea, inlinePalette, areaCenter);
+	addDockWidget(CenterDockWidgetArea, scrapbookPalette, areaCenterLeft);
+	addDockWidget(CenterDockWidgetArea, bookPalette, areaCenterLeft);
+	addDockWidget(CenterDockWidgetArea, symbolPalette, areaCenterLeft);
+
+
+	// Left
+	auto * areaLeft = addDockWidget(LeftDockWidgetArea, pagePalette, areaCenterLeft);
+	addDockWidget(CenterDockWidgetArea, outlinePalette, areaLeft);
+
+	// Left Bottom
+	auto * areaLeftBottom = addDockWidget(BottomDockWidgetArea, layerPalette, areaLeft);
+	addDockWidget(CenterDockWidgetArea, alignDistributePalette, areaLeftBottom);
+	addDockWidget(CenterDockWidgetArea, undoPalette, areaLeftBottom);
+
+	// Right Panel
+	auto * areaRight = addDockWidget(RightDockWidgetArea, propertiesPalette, areaCenter);
+	addDockWidget(CenterDockWidgetArea, contentPalette, areaRight);
+
+    // Top Panel
+//    auto * areaTop = addDockWidget(TopDockWidgetArea, dockToolProperties);
+//    areaTop->setAllowedAreas(NoDockWidgetArea);
+//    areaTop->setDockAreaFlag(CDockAreaWidget::HideSingleWidgetTitleBar, true);
+
+	// Resizing area height of left and bottom-left
+	auto splitterL = ads::internal::findParent<ads::CDockSplitter*>(areaLeft);
+	if (splitterL)
+	{
+		int heightL = splitterL->height();
+		splitterL->setSizes({heightL * 2/3, heightL * 1/3});
+	}
+
+	// Resizing area width of left, center-left, center and right
+	auto splitterCL = ads::internal::findParent<ads::CDockSplitter*>(areaCenter);
+	if (splitterCL)
+	{
+		int widthCL = splitterCL->width();
+		int panelWidth = 290;
+		splitterCL->setSizes({panelWidth, panelWidth, widthCL - 3 * panelWidth, panelWidth});
+	}
+
+	// hide panels that are not visible in default workspace
+	inlinePalette->toggleView(false);
+	scrapbookPalette->toggleView(false);
+	bookPalette->toggleView(false);
+	symbolPalette->toggleView(false);
+
+	// active palettes
+	areaLeft->setCurrentDockWidget(pagePalette);
+	areaRight->setCurrentDockWidget(propertiesPalette);
+	areaLeftBottom->setCurrentDockWidget(alignDistributePalette);
+
+	// add perspective for a later usage, like reset workspace to default.
+	this->addPerspective("Default");
+
+	// try to load custom layout from preferences
+	if(!m_palettePrefs->get("ads_dockstate").isEmpty())
+		loadWorkspaceFromFile();
+
+}
+
+void DockManager::setTheme(QString theme)
+{
+	setStyleSheet(theme);
+}
+
+void DockManager::removeAllDockWidgets()
+{
+	QMap<QString, CDockWidget*> map = dockWidgetsMap();
+	foreach( QString key, map.keys() )
+	{
+		removeDockWidget(map.value(key));
+	}
+}
+
+CDockAreaWidget* DockManager::addDockFromPlugin(CDockWidget *dock, bool closed)
+{
+	CDockAreaWidget* a = addDockWidget(RightDockWidgetArea, dock, dockCenter->dockAreaWidget());
+	dock->toggleView(!closed);
+	return a;
+}
+
+void DockManager::loadWorkspaceFromFile()
+{
+	if(m_palettePrefs)
+	{
+		QByteArray ba = QByteArray::fromHex(m_palettePrefs->get("ads_dockstate").toLatin1());
+		this->restoreState(ba);
+	}
+}
+
+void DockManager::saveWorkspaceToFile()
+{
+	if(m_palettePrefs)
+	{
+		QByteArray data = this->saveState();
+		QString s = data.toHex();
+		m_palettePrefs->set("ads_dockstate", s);
+	}
+}
+
Index: scribus/manager/dock_manager.h
===================================================================
--- scribus/manager/dock_manager.h	(nicht existent)
+++ scribus/manager/dock_manager.h	(Arbeitskopie)
@@ -0,0 +1,81 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+#ifndef DOCK_MANAGER_H
+#define DOCK_MANAGER_H
+
+#include "prefscontext.h"
+#include "scribusapi.h"
+#include "third_party/Qt-Advanced-Docking-System/src/DockManager.h"
+
+using namespace ads;
+
+class ScribusMainWindow;
+class PagePalette;
+class OutlinePalette;
+class PropertiesPalette;
+class ContentPalette;
+class LayerPalette;
+class AlignDistributePalette;
+class InlinePalette;
+class Biblio;
+class BookPalette;
+class UndoPalette;
+class SymbolPalette;
+class DockCentralWidget;
+
+class SCRIBUS_API DockManager : public CDockManager
+{
+    Q_OBJECT
+
+public:
+	DockManager(QWidget *parent);
+
+	void setCentralWidget(QWidget * widget);
+	void setupDocks();
+	void loadDefaultWorkspace();
+	void setTheme(QString theme);
+	void removeAllDockWidgets();
+	CDockAreaWidget* addDockFromPlugin(CDockWidget * dock, bool closed = true);
+
+
+	PagePalette *pagePalette {nullptr};
+	OutlinePalette * outlinePalette {nullptr};
+	PropertiesPalette * propertiesPalette {nullptr};
+	ContentPalette * contentPalette {nullptr};
+	LayerPalette * layerPalette {nullptr};
+	AlignDistributePalette * alignDistributePalette {nullptr};
+	InlinePalette * inlinePalette {nullptr};
+	Biblio * scrapbookPalette {nullptr};
+	BookPalette * bookPalette {nullptr};
+	UndoPalette * undoPalette {nullptr};
+	SymbolPalette * symbolPalette {nullptr};
+
+public slots:
+	void loadWorkspaceFromFile();
+	void saveWorkspaceToFile();
+
+private:
+	DockCentralWidget * dockCenter {nullptr};
+	PrefsContext* m_palettePrefs {nullptr};
+
+	CDockAreaWidget * areaCenterLeft {nullptr};
+
+};
+
+#endif // DOCK_MANAGER_H
Index: scribus/plugins/shapes/shapepalette.cpp
===================================================================
--- scribus/plugins/shapes/shapepalette.cpp	(Revision 25546)
+++ scribus/plugins/shapes/shapepalette.cpp	(Arbeitskopie)
@@ -21,6 +21,7 @@
  *                                                                         *
  ***************************************************************************/
 #include "iconmanager.h"
+#include "manager/dock_manager.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"
 #include "scmimedata.h"
@@ -31,6 +32,7 @@
 #include "scribusXml.h"
 #include "selection.h"
 #include "shapepalette.h"
+#include "third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.h"
 #include "ui/scmessagebox.h"
 #include "util.h"
 #include "util_math.h"
@@ -278,7 +280,7 @@
 	}
 }
 
-ShapePalette::ShapePalette( QWidget* parent) : ScDockPalette(parent, "Shap", Qt::WindowFlags())
+ShapePalette::ShapePalette(QWidget *parent) : DockPanelBase("Shap", parent)
 {
 	setMinimumSize( QSize( 220, 240 ) );
 	setObjectName(QString::fromLocal8Bit("Shap"));
@@ -560,7 +562,7 @@
 
 void ShapePalette::setMainWindow(ScribusMainWindow *mw)
 {
-	m_scMW = mw;
+	m_scMW = mw;	
 	for (int a = 0; a < Frame3->count(); a++)
 	{
 		ShapeViewWidget = (ShapeView*)Frame3->widget(a);
@@ -593,7 +595,7 @@
 		languageChange();
 	}
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void ShapePalette::iconSetChange()
Index: scribus/plugins/shapes/shapepalette.h
===================================================================
--- scribus/plugins/shapes/shapepalette.h	(Revision 25546)
+++ scribus/plugins/shapes/shapepalette.h	(Arbeitskopie)
@@ -40,7 +40,8 @@
 
 
 #include "pluginapi.h"
-#include "ui/scdockpalette.h"
+//#include "ui/scdockpalette.h"
+#include "ui/docks/dock_panelbase.h"
 #include "ui/sclistwidgetdelegate.h"
 #include "fpointarray.h"
 
@@ -85,12 +86,12 @@
 	ScListWidgetDelegate* delegate;
 };
 
-class PLUGIN_API ShapePalette : public ScDockPalette
+class PLUGIN_API ShapePalette : public DockPanelBase
 {
 	Q_OBJECT
 
 public:
-	ShapePalette(QWidget* parent);
+	ShapePalette(QWidget *parent);
 	~ShapePalette() {};
 
 	void writeToPrefs();
Index: scribus/plugins/shapes/shapeplugin.cpp
===================================================================
--- scribus/plugins/shapes/shapeplugin.cpp	(Revision 25546)
+++ scribus/plugins/shapes/shapeplugin.cpp	(Arbeitskopie)
@@ -69,15 +69,18 @@
 	if (!sc_palette)
 		return;
 
-	sc_palette->setMainWindow(mw);
+	sc_palette->setMainWindow(mw);	
 	languageChange();
 	m_actions.insert("shapeShowPalette", new ScrAction(QObject::tr("Custom Shapes"), QKeySequence(), this));
 	m_actions["shapeShowPalette"]->setToggleAction(true);
 	m_actions["shapeShowPalette"]->setChecked(false);
-	connect(m_actions["shapeShowPalette"], SIGNAL(toggled(bool)), sc_palette, SLOT(setPaletteShown(bool)));
-	connect(sc_palette, SIGNAL(paletteShown(bool)), m_actions["shapeShowPalette"], SLOT(setChecked(bool)));
+	connect(m_actions["shapeShowPalette"], SIGNAL(toggled(bool)), sc_palette, SLOT(toggleView(bool)));
+	connect(sc_palette, SIGNAL(viewToggled(bool)), m_actions["shapeShowPalette"], SLOT(setChecked(bool)));
 	mw->scrMenuMgr->addMenuItemStringAfter("shapeShowPalette", "toolsInline", "Windows");
 	mw->scrMenuMgr->addMenuItemStringsToMenuBar("Windows", m_actions);
+
+	// For some reason we can't call addDockWidget(...) directly. If we do so Scribus crashes.
+	mw->dockManager->addDockFromPlugin(sc_palette);
 }
 
 QString ShapePlugin::fullTrName() const
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(Revision 25546)
+++ scribus/scribus.cpp	(Arbeitskopie)
@@ -240,6 +240,7 @@
 #include "util.h"
 #include "util_file.h"
 #include "util_formats.h"
+#include "third_party/Qt-Advanced-Docking-System/src/IconProvider.h"
 
 #ifdef HAVE_SVNVERSION
 	#include "svnversion.h"
@@ -259,6 +260,7 @@
 #include "sclimits.h"
 
 using namespace std;
+using namespace ads;
 
 bool previewDinUse;
 bool printDinUse;
@@ -273,11 +275,13 @@
 ScribusMainWindow::ScribusMainWindow() :
 	m_prefsManager(PrefsManager::instance())
 {
+
 #ifdef Q_OS_MACOS
 	//commenting this out until this is resolved :https://bugreports.qt.io/browse/QTBUG-44565
 	//ScQApp->setAttribute(Qt::AA_DontShowIconsInMenus);
 	//noIcon = IconManager::instance().loadPixmap("noicon.png");
 #endif
+
 }
 
 /*
@@ -285,6 +289,32 @@
  */
 int ScribusMainWindow::initScMW(bool primaryMainWindow)
 {
+	// Documentation: https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/blob/master/doc/user-guide.md
+	CDockManager::setConfigFlag(CDockManager::AlwaysShowTabs, false);
+	CDockManager::setConfigFlag(CDockManager::FloatingContainerHasWidgetIcon, true);
+	CDockManager::setConfigFlag(CDockManager::FloatingContainerHasWidgetTitle, true);
+	CDockManager::setConfigFlag(CDockManager::HideSingleCentralWidgetTitleBar, false);
+	CDockManager::setConfigFlag(CDockManager::OpaqueSplitterResize, true);
+	CDockManager::setConfigFlag(CDockManager::TabCloseButtonIsToolButton, true);
+	CDockManager::setConfigFlag(CDockManager::AllTabsHaveCloseButton, false);
+	CDockManager::setConfigFlag(CDockManager::DockAreaDynamicTabsMenuButtonVisibility, true);
+	CDockManager::setConfigFlag(CDockManager::DockAreaHasCloseButton, false);
+	CDockManager::setConfigFlag(CDockManager::DockAreaHasUndockButton, false);
+	CDockManager::setConfigFlag(CDockManager::DockAreaHideDisabledButtons, true);
+	CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true);
+
+	// Documentation: https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/blob/master/doc/user-guide.md#auto-hide-configuration-flags
+//	CDockManager::setAutoHideConfigFlags(CDockManager::DefaultAutoHideConfig);
+//	CDockManager::setAutoHideConfigFlag(CDockManager::AutoHideShowOnMouseOver, true);
+//	CDockManager::setAutoHideConfigFlag(CDockManager::AutoHideCloseButtonCollapsesDock, true);
+//	CDockManager::setAutoHideConfigFlag(CDockManager::AutoHideButtonTogglesArea, true);
+
+//	IconManager &iconmanager = IconManager::instance();
+//	CDockManager::iconProvider().registerCustomIcon(TabCloseIcon, iconmanager.loadPixmap("close"));
+//	CDockManager::iconProvider().registerCustomIcon(DockAreaCloseIcon, iconmanager.loadPixmap("close"));
+//	CDockManager::iconProvider().registerCustomIcon(DockAreaMenuIcon, iconmanager.loadPixmap("menu-down"));
+//	CDockManager::iconProvider().registerCustomIcon(DockAreaUndockIcon, iconmanager.loadPixmap("dock-float"));
+
 	int retVal=0;
 	//qsrand(1234);
 	QByteArray stylesheet;
@@ -323,6 +353,7 @@
 	appModeHelper = new AppModeHelper();
 	appModeHelper->setup(actionManager, &scrActions, &scrRecentFileActions, &scrWindowsActions, &scrScrapActions, &scrLayersActions, &scrRecentPasteActions);
 	scrMenuMgr = new ScMWMenuManager(menuBar(), actionManager);
+	dockManager = new DockManager(this/*, QString(stylesheet)*/); // style sheet should be enabled when theme manager is implemented to handle color palettes in css file.
 	m_formatsManager = FormatsManager::instance();
 	m_objectSpecificUndo = false;
 
@@ -338,7 +369,6 @@
 	QApplication::processEvents();
 
 	actionManager->init(this);
-
 	initMdiArea();
 	initMenuBar();
 	createMenuBar();
@@ -346,12 +376,10 @@
 	ScCore->pluginManager->setupPluginActions(this);
 	ScCore->pluginManager->enableOnlyStartupPluginActions(this);
 	ScCore->pluginManager->languageChange();
-
 	if (primaryMainWindow)
 		ScCore->setSplashStatus( tr("Applying User Shortcuts") );
 	m_prefsManager.applyLoadedShortCuts();
 	initKeyboardShortcuts();
-
 	resize(800, 600);
 	connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(newActWin(QMdiSubWindow*)));
 	//Connect windows cascade and tile actions to the workspace after its created. Only depends on mdiArea created.
@@ -359,7 +387,6 @@
 	connect( scrActions["windowsTile"], SIGNAL(triggered()) , mdiArea, SLOT(tileSubWindows()) );
 	initPalettes();
 
-
 	viewToolBar->previewQualitySwitcher->setCurrentIndex(m_prefsManager.appPrefs.itemToolPrefs.imageLowResType);
 	if (primaryMainWindow)
 		ScCore->setSplashStatus( tr("Initializing Story Editor") );
@@ -366,7 +393,6 @@
 	storyEditor = new StoryEditor(this);
 
 	DocDir = m_prefsManager.documentDir();
-
 	if (primaryMainWindow)
 		ScCore->setSplashStatus( tr("Initializing Languages") );
 	LanguageManager::instance();
@@ -378,7 +404,6 @@
 	if (primaryMainWindow)
 		ScCore->setSplashStatus( tr("Reading Scrapbook") );
 	initScrapbook();
-
 	scrActions["helpTooltips"]->setChecked(m_prefsManager.appPrefs.displayPrefs.showToolTips);
 	scrActions["showMouseCoordinates"]->setChecked(m_prefsManager.appPrefs.displayPrefs.showMouseCoordinates);
 	scrActions["stickyTools"]->setChecked(m_prefsManager.appPrefs.uiPrefs.stickyTools);
@@ -646,51 +671,75 @@
 {
 	//CB TODO hide the publicly available members of some palettes
 	// these must be filtered too as they take control of the palettes events
-	outlinePalette = new OutlinePalette(this);
+
+	dockManager->setupDocks();
+
+	// Outliner
+	outlinePalette = dockManager->outlinePalette;
 	outlinePalette->setMainWindow(this);
-	connect( scrActions["toolsOutline"], SIGNAL(toggled(bool)) , outlinePalette, SLOT(setPaletteShown(bool)));
-	connect( outlinePalette, SIGNAL(paletteShown(bool)), scrActions["toolsOutline"], SLOT(setChecked(bool)));
+	connect( scrActions["toolsOutline"], SIGNAL(toggled(bool)) , outlinePalette, SLOT(toggleView(bool)));
+	connect( outlinePalette, SIGNAL(viewToggled(bool)), scrActions["toolsOutline"], SLOT(setChecked(bool)));
 
-	propertiesPalette = new PropertiesPalette(this);
+	// Frame Properties
+	propertiesPalette = dockManager->propertiesPalette;
 	propertiesPalette->setMainWindow(this);
-	connect( scrActions["toolsProperties"], SIGNAL(toggled(bool)) , propertiesPalette, SLOT(setPaletteShown(bool)));
-	connect( propertiesPalette, SIGNAL(paletteShown(bool)), scrActions["toolsProperties"], SLOT(setChecked(bool)));
+	connect( scrActions["toolsProperties"], SIGNAL(toggled(bool)) , propertiesPalette, SLOT(toggleView(bool)));
+	connect( propertiesPalette, SIGNAL(viewToggled(bool)), scrActions["toolsProperties"], SLOT(setChecked(bool)));
 	emit UpdateRequest(reqDefFontListUpdate);
 	propertiesPalette->installEventFilter(this);
 
-	contentPalette = new ContentPalette(this);
+	// Content Properties
+	contentPalette = dockManager->contentPalette;
 	contentPalette->setMainWindow(this);
-	connect( scrActions["toolsContent"], &QAction::toggled, contentPalette, &ContentPalette::setPaletteShown);
-	connect( contentPalette, &ContentPalette::paletteShown, scrActions["toolsContent"], &QAction::setChecked);
+	connect( scrActions["toolsContent"], SIGNAL(toggled(bool)), contentPalette, SLOT(toggleView(bool)));
+	connect( contentPalette, SIGNAL(viewToggled(bool)), scrActions["toolsContent"], SLOT(setChecked(bool)));
 	contentPalette->installEventFilter(this);
 
+	// Nodes
 	nodePalette = new NodePalette(this);
 	nodePalette->installEventFilter(this);
-	layerPalette = new LayerPalette(this);
+
+	// Guides
 	guidePalette = new GuideManager(this);
+
+	// Character Selection
 	charPalette = new CharSelect(this);
-	connect( scrActions["toolsLayers"], SIGNAL(toggled(bool)) , layerPalette, SLOT(setPaletteShown(bool)));
-	connect( layerPalette, SIGNAL(paletteShown(bool)), scrActions["toolsLayers"], SLOT(setChecked(bool)));
+
+	// Layer
+	layerPalette = dockManager->layerPalette;
+	connect( scrActions["toolsLayers"], SIGNAL(toggled(bool)) , layerPalette, SLOT(toggleView(bool)));
+	connect( layerPalette, SIGNAL(viewToggled(bool)), scrActions["toolsLayers"], SLOT(setChecked(bool)));
 	layerPalette->installEventFilter(this);
-	scrapbookPalette = new Biblio(this);
-	connect( scrActions["toolsScrapbook"], SIGNAL(toggled(bool)) , scrapbookPalette, SLOT(setPaletteShown(bool)));
-	connect( scrapbookPalette, SIGNAL(paletteShown(bool)), scrActions["toolsScrapbook"], SLOT(setChecked(bool)));
+
+	// Scrapbook
+	scrapbookPalette = dockManager->scrapbookPalette;
+	connect( scrActions["toolsScrapbook"], SIGNAL(toggled(bool)) , scrapbookPalette, SLOT(toggleView(bool)));
+	connect( scrapbookPalette, SIGNAL(viewToggled(bool)), scrActions["toolsScrapbook"], SLOT(setChecked(bool)));
 	connect( scrapbookPalette, SIGNAL(pasteToActualPage(QString)), this, SLOT(pasteFromScrapbook(QString)));
 	connect( scrapbookPalette, SIGNAL(scrapbookListChanged()), this, SLOT(rebuildScrapbookMenu()));
 	scrapbookPalette->installEventFilter(this);
-	pagePalette = new PagePalette(this);
-	connect( scrActions["toolsPages"], SIGNAL(toggled(bool)) , pagePalette, SLOT(setPaletteShown(bool)) );
-	connect( pagePalette, SIGNAL(paletteShown(bool)), scrActions["toolsPages"], SLOT(setChecked(bool)));
+
+	// Pages
+	pagePalette = dockManager->pagePalette;
+	pagePalette->setMainWindow(this);
+	connect( scrActions["toolsPages"], SIGNAL(toggled(bool)) , pagePalette, SLOT(toggleView(bool)) );
+	connect( pagePalette, SIGNAL(viewToggled(bool)), scrActions["toolsPages"], SLOT(setChecked(bool)));
 	pagePalette->installEventFilter(this);
-	bookmarkPalette = new BookPalette(this);
-	connect( scrActions["toolsBookmarks"], SIGNAL(toggled(bool)) , bookmarkPalette, SLOT(setPaletteShown(bool)) );
-	connect( bookmarkPalette, SIGNAL(paletteShown(bool)), scrActions["toolsBookmarks"], SLOT(setChecked(bool)));
+
+	// Bookmark
+	bookmarkPalette = dockManager->bookPalette;
+	connect( scrActions["toolsBookmarks"], SIGNAL(toggled(bool)) , bookmarkPalette, SLOT(toggleView(bool)) );
+	connect( bookmarkPalette, SIGNAL(viewToggled(bool)), scrActions["toolsBookmarks"], SLOT(setChecked(bool)));
 	bookmarkPalette->installEventFilter(this);
+
+	// Downloads
 	downloadsPalette = new DownloadsPalette(this);
 	connect( scrActions["toolsDownloads"], SIGNAL(toggled(bool)) , downloadsPalette, SLOT(setPaletteShown(bool)) );
 	connect( downloadsPalette, SIGNAL(paletteShown(bool)), scrActions["toolsDownloads"], SLOT(setChecked(bool)));
 	downloadsPalette->installEventFilter(this);
 	connect( scrActions["toolsMeasurements"], SIGNAL(toggledData(bool,int)) , this, SLOT(setAppModeByToggle(bool,int)) );
+
+	// Preflight
 	docCheckerPalette = new CheckDocument(this, false);
 	connect( scrActions["toolsPreflightVerifier"], SIGNAL(toggled(bool)) , docCheckerPalette, SLOT(setPaletteShown(bool)) );
 	connect( scrActions["toolsPreflightVerifier"], SIGNAL(toggled(bool)) , this, SLOT(docCheckToggle(bool)) );
@@ -699,36 +748,38 @@
 	docCheckerPalette->installEventFilter(this);
 	docCheckerPalette->hide();
 
-	alignDistributePalette = new AlignDistributePalette(this, "AlignDistributePalette");
-	connect( scrActions["toolsAlignDistribute"], SIGNAL(toggled(bool)) , alignDistributePalette, SLOT(setPaletteShown(bool)) );
-	connect( alignDistributePalette, SIGNAL(paletteShown(bool)), scrActions["toolsAlignDistribute"], SLOT(setChecked(bool)));
+	// Align & Distribute
+	alignDistributePalette = dockManager->alignDistributePalette;
+	connect( scrActions["toolsAlignDistribute"], SIGNAL(toggled(bool)) , alignDistributePalette, SLOT(toggleView(bool)) );
+	connect( alignDistributePalette, SIGNAL(viewToggled(bool)), scrActions["toolsAlignDistribute"], SLOT(setChecked(bool)));
 	connect( alignDistributePalette, SIGNAL(documentChanged()), this, SLOT(slotDocCh()));
 	alignDistributePalette->installEventFilter(this);
 
-	symbolPalette = new SymbolPalette(this);
+	// Symbols
+	symbolPalette = dockManager->symbolPalette;
 	symbolPalette->setMainWindow(this);
-	connect(scrActions["toolsSymbols"], SIGNAL(toggled(bool)), symbolPalette, SLOT(setPaletteShown(bool)));
-	connect(symbolPalette, SIGNAL(paletteShown(bool)), scrActions["toolsSymbols"], SLOT(setChecked(bool)));
+	connect(scrActions["toolsSymbols"], SIGNAL(toggled(bool)), symbolPalette, SLOT(toggleView(bool)) );
+	connect(symbolPalette, SIGNAL(viewToggled(bool)), scrActions["toolsSymbols"], SLOT(setChecked(bool)));
 	connect(symbolPalette, SIGNAL(startEdit(QString)), this, SLOT(editSymbolStart(QString)));
 	connect(symbolPalette, SIGNAL(endEdit()), this, SLOT(editSymbolEnd()));
 	connect(symbolPalette, SIGNAL(objectDropped()), this, SLOT(PutToPatterns()));
 	symbolPalette->installEventFilter(this);
-	symbolPalette->hide();
 
-	inlinePalette = new InlinePalette(this);
+	// Inline Elements
+	inlinePalette = dockManager->inlinePalette;
 	inlinePalette->setMainWindow(this);
-	connect(scrActions["toolsInline"], SIGNAL(toggled(bool)), inlinePalette, SLOT(setPaletteShown(bool)));
-	connect(inlinePalette, SIGNAL(paletteShown(bool)), scrActions["toolsInline"], SLOT(setChecked(bool)));
+	connect(scrActions["toolsInline"], SIGNAL(toggled(bool)), inlinePalette, SLOT(toggleView(bool)) );
+	connect(inlinePalette, SIGNAL(viewToggled(bool)), scrActions["toolsInline"], SLOT(setChecked(bool)));
 	connect(inlinePalette, SIGNAL(startEdit(int)), this, SLOT(editInlineStart(int)));
 	connect(inlinePalette, SIGNAL(endEdit()), this, SLOT(editInlineEnd()));
 	connect(inlinePalette, SIGNAL(objectDropped(QString)), this, SLOT(PutToInline(QString)));
 	inlinePalette->installEventFilter(this);
-	inlinePalette->hide();
 
-	undoPalette = new UndoPalette(this, "undoPalette");
+	// Undo
+	undoPalette = dockManager->undoPalette;
 	undoPalette->installEventFilter(this);
 	m_undoManager->registerGui(undoPalette);
-	connect(undoPalette, SIGNAL(paletteShown(bool)), this, SLOT(setUndoPalette(bool)));
+	connect(undoPalette, SIGNAL(viewToggled(bool)), this, SLOT(setUndoPalette(bool)));
 	connect(undoPalette, SIGNAL(objectMode(bool)), this, SLOT(setUndoMode(bool)));
 
 	// initializing style manager here too even it's not strictly a palette
@@ -749,6 +800,8 @@
 	connect( marksManager, SIGNAL(paletteShown(bool)), scrActions["editMarks"], SLOT(setChecked(bool)));
 	marksManager->installEventFilter(this);
 	// initializing notes styles manager
+
+	// Note Styles
 	nsEditor = new NotesStylesEditor(this, "notesStylesEditor");
 	connect( scrActions["editNotesStyles"], SIGNAL(toggled(bool)), nsEditor, SLOT(setPaletteShown(bool)) );
 	connect( nsEditor, SIGNAL(paletteShown(bool)), scrActions["editNotesStyles"], SLOT(setChecked(bool)));
@@ -775,6 +828,9 @@
 	// char palette
 	connect(scrActions["insertGlyph"], SIGNAL(toggled(bool)), charPalette, SLOT(setPaletteShown(bool)));
 	connect(charPalette, SIGNAL(paletteShown(bool)), scrActions["insertGlyph"], SLOT(setChecked(bool)));
+
+	dockManager->loadDefaultWorkspace();
+
 }
 
 
@@ -831,7 +887,8 @@
 	}
 	else
 		mdiArea->setViewMode(QMdiArea::SubWindowView);
-	setCentralWidget(mdiArea);
+	//setCentralWidget(mdiArea);
+	dockManager->setCentralWidget(mdiArea);
 }
 
 void ScribusMainWindow::initMenuBar()
@@ -1782,6 +1839,9 @@
 		return;
 	}
 
+	// Save GUI state
+	dockManager->saveWorkspaceToFile();
+
 	disconnect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(newActWin(QMdiSubWindow*)));
 
 	QList<QMdiSubWindow *> windows = mdiArea->subWindowList();
@@ -1830,22 +1890,13 @@
 			m_prefsManager.appPrefs.uiPrefs.tabbedPalettes.append(currentTab);
 	}
 
-	propertiesPalette->hide();
-	contentPalette->hide();
-	outlinePalette->hide();
-	scrapbookPalette->hide();
-	bookmarkPalette->hide();
-	downloadsPalette->hide();
-	layerPalette->hide();
-	pagePalette->hide();
-	docCheckerPalette->hide();
-	undoPalette->hide();
-	alignDistributePalette->hide();
-	guidePalette->hide();
-	charPalette->hide();
-	symbolPalette->hide();
-	inlinePalette->hide();
+	// We need to remove all docks from the DockManager to prevent a memory leak
+	// in case a plugin has added a dock in the DockManager and is simply deleted
+	// on cleanup before it is removed from the DockManager.
+	// Removed Docks are not deleted directly.
+	dockManager->removeAllDockWidgets();
 
+
 	// Clean up plugins, THEN save prefs to disk
 	ScCore->pluginManager->cleanupPlugins();
 	if (!m_prefsManager.appPrefs.scrapbookPrefs.persistentScrapbook)
@@ -5445,7 +5504,7 @@
 
 void ScribusMainWindow::setUndoPalette(bool visible)
 {
-	undoPalette->setPaletteShown(visible);
+	undoPalette->toggleView(visible);
 	scrActions["toolsActionHistory"]->setChecked(visible);
 }
 
Index: scribus/scribus.h
===================================================================
--- scribus/scribus.h	(Revision 25546)
+++ scribus/scribus.h	(Arbeitskopie)
@@ -56,6 +56,7 @@
 // application specific includes
 #include "scribusapi.h"
 #include "scribusdoc.h"
+#include "manager/dock_manager.h"
 #include "styleoptions.h"
 #include "ui/customfdialog.h"
 #include "ui/scmessagebox.h"
@@ -69,6 +70,7 @@
 class CharSelect;
 class CheckDocument;
 class ColorCombo;
+class DockManager;
 class DownloadsPalette;
 class EditToolBar;
 class FileToolBar;
@@ -218,6 +220,7 @@
 	/** \brief private doc for managing default patterns. */
 	ScribusDoc* m_doc {nullptr};
 
+	DockManager * dockManager {nullptr};
 
 	QProgressBar* mainWindowProgressBar {nullptr};
 	ScrSpinBox* zoomSpinBox {nullptr}; //zoom spinbox at bottom of view
Index: scribus/scribusindigomainwindow.cpp
===================================================================
--- scribus/scribusindigomainwindow.cpp	(Revision 25546)
+++ scribus/scribusindigomainwindow.cpp	(Arbeitskopie)
@@ -11,6 +11,9 @@
 #include "third_party/Qt-Advanced-Docking-System/src/DockManager.h"
 #include "third_party/Qt-Advanced-Docking-System/src/IconProvider.h"
 
+#include "iconmanager.h"
+#include "manager/dock_manager.h"
+
 ScribusIndigoMainWindow::ScribusIndigoMainWindow(QWidget *parent)
 	: QMainWindow{parent}
 	{
@@ -29,14 +32,14 @@
 //	ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHasUndockButton, false);
 //	ads::CDockManager::setConfigFlag(ads::CDockManager::DockAreaHideDisabledButtons, true);
 
-	//		ads::CDockManager::iconProvider().registerCustomIcon(ads::TabCloseIcon,
-	//IconManager::instance().icon("close"));
-	//		ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaCloseIcon,
-	//IconManager::instance().icon("close"));
-	//		ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaMenuIcon,
-	//IconManager::instance().icon("menu-down"));
-	//		ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaUndockIcon,
-	//IconManager::instance().icon("dock-float"));
+////	ads::CDockManager::iconProvider().registerCustomIcon(ads::TabCloseIcon, IconManager::instance().loadIcon("close"));
+////	ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaCloseIcon, IconManager::instance().loadIcon("close"));
+////	ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaMenuIcon, IconManager::instance().loadIcon("menu-down"));
+////	ads::CDockManager::iconProvider().registerCustomIcon(ads::DockAreaUndockIcon, IconManager::instance().loadIcon("dock-float"));
+
+//	dockManager = new DockManager(this);
+
+
 	}
 
 
Index: scribus/scribusindigomainwindow.h
===================================================================
--- scribus/scribusindigomainwindow.h	(Revision 25546)
+++ scribus/scribusindigomainwindow.h	(Arbeitskopie)
@@ -5,6 +5,8 @@
 
 #include "scribusapi.h"
 
+//class DockManager;
+
 class SCRIBUS_API ScribusIndigoMainWindow : public QMainWindow
 	{
 		Q_OBJECT
@@ -16,9 +18,9 @@
 	signals:
 	private:
 
+	//DockManager *dockManager;
 
 
-
 	};
 
 #endif // SCRIBUSINDIGOMAINWINDOW_H
Index: scribus/third_party/Qt-Advanced-Docking-System/CMakeLists.txt
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/CMakeLists.txt	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/CMakeLists.txt	(Arbeitskopie)
@@ -1,5 +1,5 @@
 ###<< Scribus
-set(ADS_VERSION "4.0.3")
+set(ADS_VERSION "4.0.4")
 ###>> Scribus
 cmake_minimum_required(VERSION 3.5)
 
Index: scribus/third_party/Qt-Advanced-Docking-System/README.md
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/README.md	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/README.md	(Arbeitskopie)
@@ -119,6 +119,8 @@
   - [RDE – Robox Development Environment](#rde--robox-development-environment)
   - [ResInsight](#resinsight)
   - [ADTF 3](#adtf-3)
+  - [DREAM.3D NX](#dream3d-nx)
+  - [LabPlot](#labplot)
 - [Alternative Docking System Implementations](#alternative-docking-system-implementations)
   - [KDDockWidgets](#kddockwidgets)
   - [QtitanDocking](#qtitandocking)
@@ -254,7 +256,7 @@
 
 - [mborgerson](https://github.com/mborgerson)
 
-For more information about the PySide6 bindings read [this](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/298) issue.
+Please file PySide6-QtAds-specific issues on its [pyside6_qtads](https://github.com/mborgerson/pyside6_qtads) fork for tracking. For more information about the PySide6 bindings read [this](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/298) issue.
 
 ### PyQt5
 
@@ -318,7 +320,9 @@
 ## Build
 
 The Linux build requires private header files. Make sure that they are installed.
-The library uses SVG icons, so ensure that Qt SVG support is installed.
+The library uses SVG icons, so ensure that Qt SVG support is installed. The demo
+application creates a `QQuickWidget` for testing, so ensure that the required
+libraries are installed.
 
 ### Qt5 on Ubuntu 18.04 or 20.04
 
@@ -329,13 +333,13 @@
 ### Qt5 on Ubuntu 22.04
 
 ```bash
-sudo apt install qtbase5-dev qtbase5-private-dev qtbase5-dev-tools libqt5svg5
+sudo apt install qtbase5-dev qtbase5-private-dev qtbase5-dev-tools libqt5svg5 libqt5qml5 qtdeclarative5-dev
 ```
 
 ### Qt6 on Ubuntu 22.04
 
 ```bash
-sudo apt install qt6-base-dev qt6-base-private-dev qt6-tools-dev libqt6svg6
+sudo apt install qt6-default qt6-base-dev qt6-base-private-dev qt6-tools-dev libqt6svg6 qt6-qtdeclarative
 ```
 
 Open the `ads.pro` file with QtCreator and start the build, that's it.
@@ -593,6 +597,26 @@
 
 ![ADTF](doc/showcase_adtf.png)
 
+### [DREAM.3D NX](https://github.com/BlueQuartzSoftware/DREAM3D)
+
+DREAM.3D *(Digital Representation Environment for Analysis of Materials in 3D)* is an open source, cross-platform and modular, software suite that allows users to prepare, reconstruct, quantify, instantiate, and mesh, multidimensional, multimodal microstructural data, as well as many other applications.
+
+[BlueQuartz Software](http://www.bluequartz.net/) is currently completely rewriting the DREAM.3D application. For the upcoming version **[DREAM3D NX](http://www.dream3d.io/)** they improved the UI by using the Advanced Docking System. An [early version](http://www.dream3d.io/) of **DREAM3D NX** with ADS is already available to any user who would like to take the brand new version out for a spin.
+
+![DREAM.3D NX](doc/showcase_dream3d_nx.png)
+
+[read more...](http://dream3d.bluequartz.net/)
+
+### [LabPlot](https://labplot.kde.org/)
+
+KDE LabPlot is the ultimate free, open source and cross-platform tool for scientists, engineers, and students who need to analyze and visualize data. With its intuitive interface and powerful features, you can create stunning plots and diagrams with ease. Whether you're working with CSV, FITS, or HDF5 data, KDE LabPlot makes it simple to import and analyze your data.
+
+The LabPlot project recently switched to the Qt Advanced Docking System for their user interface. This switch represents a significant improvement to the LabPlot software, allowing users to create and manage complex data visualization layouts with ease.
+
+![LabPlot](doc/showcase_labplot.png)
+
+[read more...](https://labplot.kde.org/)
+
 ## Alternative Docking System Implementations
 
 If this Qt Advanced Docking System does not fit to your needs you may consider some of the alternative docking system solutions for Qt.
@@ -599,7 +623,7 @@
 
 ### KDDockWidgets
 
-This is an advanced docking framework for Qt from [KDAB](https://www.kdab.com/). The interesting thing is, that they separated GUI code from logic, so they can easily provide a QtQuick backend in the future. 
+This is an advanced docking framework for Qt from [KDAB](https://www.kdab.com/). The interesting thing is, that they separated GUI code from logic, so they can easily provide a QtQuick backend in the future.
 
 - [Blog post about KDDockWidgets](https://www.kdab.com/kddockwidgets/)
 - [GitHub project](https://github.com/KDAB/KDDockWidgets)
Index: scribus/third_party/Qt-Advanced-Docking-System/doc/user-guide.md
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/doc/user-guide.md	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/doc/user-guide.md	(Arbeitskopie)
@@ -39,6 +39,7 @@
   - [`AutoHideButtonCheckable`](#autohidebuttoncheckable)
   - [`AutoHideSideBarsIconOnly`](#autohidesidebarsicononly)
   - [`AutoHideShowOnMouseOver`](#autohideshowonmouseover)
+  - [`AutoHideCloseButtonCollapsesDock`](#autohideclosebuttoncollapsesdock)
 - [DockWidget Feature Flags](#dockwidget-feature-flags)
   - [`DockWidgetClosable`](#dockwidgetclosable)
   - [`DockWidgetMovable`](#dockwidgetmovable)
@@ -589,6 +590,21 @@
 mouse outside of the Auto-Hide widget. Showing and hiding my mouse click still
 works if this feature is enabled.
 
+### `AutoHideCloseButtonCollapsesDock`
+
+Some users don't understand the distinction between closing an auto hide dock and
+collapsing an auto hide dock. This may lead to situations where they press the
+close button (losing the side tab widget) instead of simply clicking outside
+the auto hide dock (collapsing the dock). 
+
+![AutoHideCloseButtonCollapsesDock false](cfg_flag_AutoHideCloseButtonCollapsesDock_false.gif)
+
+If `AutoHideCloseButtonCollapsesDock` option is active, the
+close button in an auto hide widget collapses the auto hide widget instead of
+closing it.
+
+![AutoHideCloseButtonCollapsesDock true](cfg_flag_AutoHideCloseButtonCollapsesDock_true.gif)
+
 ## DockWidget Feature Flags
 
 ### `DockWidgetClosable`
Index: scribus/third_party/Qt-Advanced-Docking-System/pyproject.toml
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/pyproject.toml	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/pyproject.toml	(Arbeitskopie)
@@ -71,5 +71,5 @@
 	"src/PushButton.cpp",
 	"src/ResizeHandle.cpp",
 	"src/ads_globals.cpp",
-	"src/linux/FloatingWidgetTitleBar.h; platform_system == 'Linux'",
+	"src/linux/FloatingWidgetTitleBar.cpp; platform_system == 'Linux'",
 ]
Index: scribus/third_party/Qt-Advanced-Docking-System/sip/AutoHideSideBar.sip
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/sip/AutoHideSideBar.sip	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/sip/AutoHideSideBar.sip	(Arbeitskopie)
@@ -28,6 +28,8 @@
 	Qt::Orientation orientation() const;
 	ads::CAutoHideTab* tabAt(int index) const;
 	int tabCount() const;
+    int visibleTabCount() const;
+    bool hasVisibleTabs() const;
 	ads::SideBarLocation sideBarLocation() const;
 	virtual QSize minimumSizeHint() const;
 	virtual QSize sizeHint() const;
Index: scribus/third_party/Qt-Advanced-Docking-System/sip/DockFocusController.sip
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/sip/DockFocusController.sip	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/sip/DockFocusController.sip	(Arbeitskopie)
@@ -23,6 +23,7 @@
     ads::CDockWidget* focusedDockWidget() const;
     void setDockWidgetTabFocused(ads::CDockWidgetTab* Tab);
     void clearDockWidgetFocus(ads::CDockWidget* dockWidget);
+    void setDockWidgetTabPressed(bool Value);
 
 public slots:
 	void setDockWidgetFocused(ads::CDockWidget* focusedNow);
Index: scribus/third_party/Qt-Advanced-Docking-System/sip/DockManager.sip
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/sip/DockManager.sip	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/sip/DockManager.sip	(Arbeitskopie)
@@ -188,6 +188,7 @@
 		AutoHideSideBarsIconOnly,
 		AutoHideShowOnMouseOver,
 		DefaultAutoHideConfig,
+        AutoHideCloseButtonCollapsesDock,
 	};
     typedef QFlags<ads::CDockManager::eAutoHideFlag> AutoHideFlags;
 
@@ -237,6 +238,7 @@
 	QMenu* viewMenu() const;
 	void setViewMenuInsertionOrder(ads::CDockManager::eViewMenuInsertionOrder Order);
 	bool isRestoringState() const;
+    bool isLeavingMinimizedState() const;
 	static int startDragDistance();
     ads::CDockWidget* focusedDockWidget() const;
     QList<int> splitterSizes(ads::CDockAreaWidget *ContainedArea) const;
@@ -245,6 +247,7 @@
 	static QString floatingContainersTitle();
 
 public slots:
+    void endLeavingMinimizedState();
 	void openPerspective(const QString& PerspectiveName);
     void setDockWidgetFocused(ads::CDockWidget* DockWidget);
 
Index: scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidget.sip
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidget.sip	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidget.sip	(Arbeitskopie)
@@ -60,7 +60,9 @@
     enum eMinimumSizeHintMode
     {
     	MinimumSizeHintFromDockWidget,
-    	MinimumSizeHintFromContent
+    	MinimumSizeHintFromContent,
+        MinimumSizeHintFromDockWidgetMinimumSize,
+    	MinimumSizeHintFromContentMinimumSize,
     };
 
 	enum eToggleViewActionMode
@@ -94,6 +96,7 @@
 	QAction* toggleViewAction() const;
 	void setToggleViewActionMode(ads::CDockWidget::eToggleViewActionMode Mode);
 	void setMinimumSizeHintMode(ads::CDockWidget::eMinimumSizeHintMode Mode);
+    ads::CDockWidget::eMinimumSizeHintMode minimumSizeHintMode() const;
     bool isCentralWidget() const;
 	void setIcon(const QIcon& Icon);
 	QIcon icon() const;
Index: scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidgetTab.sip
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidgetTab.sip	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/sip/DockWidgetTab.sip	(Arbeitskopie)
@@ -37,6 +37,7 @@
     void updateStyle();
     QSize iconSize() const;
     void setIconSize(const QSize& Size);
+    bool mousePressed() const;
 
 public slots:
 	virtual void setVisible(bool visible);
Index: scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.cpp	(Arbeitskopie)
@@ -127,27 +127,6 @@
 		}
 		break;
 
-	case QEvent::Resize:
-		if (_this->tabCount())
-		{
-			auto ev = static_cast<QResizeEvent*>(e);
-			auto Tab = _this->tabAt(0);
-			int Size = isHorizontal() ? ev->size().height() : ev->size().width();
-			int TabSize = isHorizontal() ? Tab->size().height() : Tab->size().width();
-			// If the size of the side bar is less than the size of the first tab
-			// then there are no visible tabs in this side bar. This check will
-			// fail if someone will force a very big border via CSS!!
-			if (Size < TabSize)
-			{
-				_this->hide();
-			}
-		}
-		else
-		{
-			_this->hide();
-		}
-		break;
-
 	default:
 		break;
 	}
@@ -288,20 +267,33 @@
 //============================================================================
 bool CAutoHideSideBar::eventFilter(QObject *watched, QEvent *event)
 {
-	if (event->type() != QEvent::ShowToParent)
+	auto Tab = qobject_cast<CAutoHideTab*>(watched);
+	if (!Tab)
 	{
 		return false;
 	}
 
-	// As soon as on tab is shown, we need to show the side tab bar
-	auto Tab = qobject_cast<CAutoHideTab*>(watched);
-	if (Tab)
+	switch (event->type())
 	{
-		show();
+	case QEvent::ShowToParent:
+		 show();
+	     break;
+
+	case QEvent::HideToParent:
+		 if (!hasVisibleTabs())
+		 {
+			 hide();
+		 }
+		 break;
+
+	default:
+		break;
 	}
+
 	return false;
 }
 
+
 //============================================================================
 Qt::Orientation CAutoHideSideBar::orientation() const
 {
@@ -324,6 +316,39 @@
 
 
 //============================================================================
+int CAutoHideSideBar::visibleTabCount() const
+{
+	int count = 0;
+	auto ParentWidget = parentWidget();
+	for (auto i = 0; i < tabCount(); i++)
+	{
+		if (tabAt(i)->isVisibleTo(ParentWidget))
+		{
+			count++;
+		}
+	}
+
+	return count;
+}
+
+
+//============================================================================
+bool CAutoHideSideBar::hasVisibleTabs() const
+{
+	auto ParentWidget = parentWidget();
+	for (auto i = 0; i < tabCount(); i++)
+	{
+		if (tabAt(i)->isVisibleTo(ParentWidget))
+		{
+			return true;
+		}
+	}
+
+	return false;
+}
+
+
+//============================================================================
 SideBarLocation CAutoHideSideBar::sideBarLocation() const
 {
 	return d->SideTabArea;
Index: scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.h	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/AutoHideSideBar.h	(Arbeitskopie)
@@ -135,6 +135,19 @@
 	int tabCount() const;
 
 	/**
+	 * Returns the number of visible tabs to its parent widget.
+	 */
+	int visibleTabCount() const;
+
+	/**
+	 * Returns true, if the sidebar contains visible tabs to its parent widget.
+	 * The function returns as soon as it finds the first visible tab.
+	 * That means, if you just want to find out if there are visible tabs
+	 * then this function is quicker than visibleTabCount()
+	 */
+	bool hasVisibleTabs() const;
+
+	/**
 	 * Getter for side tab bar area property
 	 */
 	SideBarLocation sideBarLocation() const;
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTabBar.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTabBar.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTabBar.cpp	(Arbeitskopie)
@@ -36,6 +36,7 @@
 #include <QBoxLayout>
 #include <QApplication>
 #include <QtGlobal>
+#include <QTimer>
 
 #include "FloatingDockContainer.h"
 #include "DockAreaWidget.h"
@@ -107,7 +108,12 @@
 		{
 			TabWidget->show();
 			TabWidget->setActiveTab(true);
-			_this->ensureWidgetVisible(TabWidget);
+			// Sometimes the synchronous calculation of the rectangular area fails
+			// Therefore we use QTimer::singleShot here to execute the call
+			// within the event loop - see #520
+			QTimer::singleShot(0, [&, TabWidget]{
+			    _this->ensureWidgetVisible(TabWidget);
+			});
 		}
 		else
 		{
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTitleBar.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTitleBar.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaTitleBar.cpp	(Arbeitskopie)
@@ -415,8 +415,13 @@
 void CDockAreaTitleBar::onCloseButtonClicked()
 {
     ADS_PRINT("CDockAreaTitleBar::onCloseButtonClicked");
-	if (d->testConfigFlag(CDockManager::DockAreaCloseButtonClosesTab))
+	if (CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideCloseButtonCollapsesDock) &&
+		d->DockArea->autoHideDockContainer())
 	{
+		d->DockArea->autoHideDockContainer()->collapseView(true);
+	}
+	else if (d->testConfigFlag(CDockManager::DockAreaCloseButtonClosesTab))
+	{
 		d->TabBar->closeTab(d->TabBar->currentIndex());
 	}
 	else
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.cpp	(Arbeitskopie)
@@ -140,6 +140,7 @@
 			{
 				LayoutItem->widget()->setParent(nullptr);
 			}
+			delete LayoutItem;
 			m_CurrentWidget = nullptr;
 			m_CurrentIndex = -1;
 		}
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.cpp	(Arbeitskopie)
@@ -27,7 +27,7 @@
 #include "DockManager.h"
 #include "DockAreaTitleBar.h"
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include "linux/FloatingWidgetTitleBar.h"
 #endif
 
@@ -44,11 +44,12 @@
 	QPointer<CDockWidget> FocusedDockWidget = nullptr;
 	QPointer<CDockAreaWidget> FocusedArea = nullptr;
 	QPointer<CDockWidget> OldFocusedDockWidget = nullptr;
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
      QPointer<CFloatingDockContainer> FloatingWidget = nullptr;
 #endif
 	CDockManager* DockManager;
     bool ForceFocusChangedSignal = false;
+    bool TabPressed = false;
 
 	/**
 	 * Private data constructor
@@ -84,7 +85,7 @@
 
 
 //===========================================================================
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 static void updateFloatingWidgetFocusStyle(CFloatingDockContainer* FloatingWidget, bool Focused)
 {
 	if (FloatingWidget->hasNativeTitleBar())
@@ -168,7 +169,7 @@
     }
 
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	// This code is required for styling the floating widget titlebar for linux
 	// depending on the current focus state
 	if (FloatingWidget != NewFloatingWidget)
@@ -267,7 +268,9 @@
 {
     Q_UNUSED(focusedOld);
 
-	if (d->DockManager->isRestoringState())
+    // Ignore focus changes if we are restoring state, or if user clicked
+    // a tab wich in turn caused the focus change
+	if (d->DockManager->isRestoringState() || d->TabPressed)
 	{
 		return;
 	}
@@ -285,7 +288,7 @@
 		DockWidget = internal::findParent<CDockWidget*>(focusedNow);
 	}
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     if (!DockWidget)
 	{
 		return;
@@ -418,6 +421,12 @@
 	return d->FocusedDockWidget.data();
 }
 
+
+//==========================================================================
+void CDockFocusController::setDockWidgetTabPressed(bool Value)
+{
+	d->TabPressed = Value;
+}
 } // namespace ads
 
 //---------------------------------------------------------------------------
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.h	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockFocusController.h	(Arbeitskopie)
@@ -80,6 +80,12 @@
 	 */
 	void clearDockWidgetFocus(CDockWidget* dockWidget);
 
+	/**
+	 * Notifies the dock focus controller, that a the mouse is pressed or
+	 * released
+	 */
+	void setDockWidgetTabPressed(bool Value);
+
 public Q_SLOTS:
 	/**
 	 * Request a focus change to the given dock widget
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.cpp	(Arbeitskopie)
@@ -47,6 +47,7 @@
 #include <QMenu>
 #include <QApplication>
 #include <QWindow>
+#include <QWindowStateChangeEvent>
 
 #include "FloatingDockContainer.h"
 #include "DockOverlay.h"
@@ -59,7 +60,7 @@
 #include "DockFocusController.h"
 #include "DockSplitter.h"
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include "linux/FloatingWidgetTitleBar.h"
 #endif
 
@@ -116,6 +117,7 @@
 	QVector<CFloatingDockContainer*> UninitializedFloatingWidgets;
 	CDockFocusController* FocusController = nullptr;
     CDockWidget* CentralWidget = nullptr;
+    bool IsLeavingMinimized = false;
 
 	/**
 	 * Private data constructor
@@ -192,7 +194,7 @@
 	QString FileName = ":ads/stylesheets/";
 	FileName += CDockManager::testConfigFlag(CDockManager::FocusHighlighting)
 		? "focus_highlighting" : "default";
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     FileName += "_linux";
 #endif
     FileName += ".css";
@@ -510,9 +512,10 @@
 		d->FocusController = new CDockFocusController(this);
 	}
 
-#ifdef Q_OS_LINUX
+
 	window()->installEventFilter(this);
 
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     connect(qApp, &QApplication::focusWindowChanged, [](QWindow* focusWindow)
     {
         // bring modal dialogs to foreground to ensure that they are in front of any
@@ -552,7 +555,7 @@
 }
 
 //============================================================================
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 bool CDockManager::eventFilter(QObject *obj, QEvent *e)
 {
 	// Emulate Qt:Tool behaviour.
@@ -629,9 +632,40 @@
 	}
 	return Super::eventFilter(obj, e);
 }
+#else
+//============================================================================
+bool CDockManager::eventFilter(QObject *obj, QEvent *e)
+{
+	if (e->type() == QEvent::WindowStateChange)
+	{
+		QWindowStateChangeEvent* ev = static_cast<QWindowStateChangeEvent*>(e);
+		if (ev->oldState().testFlag(Qt::WindowMinimized))
+		{
+			d->IsLeavingMinimized = true;
+			QMetaObject::invokeMethod(this, "endLeavingMinimizedState", Qt::QueuedConnection);
+		}
+	}
+	return Super::eventFilter(obj, e);
+}
 #endif
 
+
 //============================================================================
+void CDockManager::endLeavingMinimizedState()
+{
+	d->IsLeavingMinimized = false;
+	this->activateWindow();
+}
+
+
+//============================================================================
+bool CDockManager::isLeavingMinimizedState() const
+{
+	return d->IsLeavingMinimized;
+}
+
+
+//============================================================================
 void CDockManager::registerFloatingWidget(CFloatingDockContainer* FloatingWidget)
 {
 	d->FloatingWidgets.append(FloatingWidget);
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.h	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockManager.h	(Arbeitskopie)
@@ -88,7 +88,13 @@
 	friend class CAutoHideDockContainer;
 	friend CAutoHideSideBar;
 
+public Q_SLOTS:
+	/**
+	 * Ends the isRestoringFromMinimizedState
+	 */
+	void endLeavingMinimizedState();
 
+
 protected:
 	/**
 	 * Registers the given floating widget in the internal list of
@@ -239,6 +245,7 @@
 		AutoHideButtonCheckable = 0x08, //!< If the flag is set, the auto hide button will be checked and unchecked depending on the auto hide state. Mainly for styling purposes.
 		AutoHideSideBarsIconOnly = 0x10,///< show only icons in auto hide side tab - if a tab has no icon, then the text will be shown
 		AutoHideShowOnMouseOver = 0x20, ///< show the auto hide window on mouse over tab and hide it if mouse leaves auto hide container
+		AutoHideCloseButtonCollapsesDock = 0x40, ///< Close button of an auto hide container collapses the dock instead of hiding it completely
 
 		DefaultAutoHideConfig = AutoHideFeatureEnabled
 			                  | DockAreaHasAutoHideButton ///< the default configuration for left and right side bars
@@ -540,6 +547,15 @@
 	bool isRestoringState() const;
 
 	/**
+	 * This function returns true, if the DockManager window is restoring from
+	 * minimized state.
+	 * The DockManager is in this state starting from the QWindowStateChangeEvent
+	 * that signals the state change from minimized to normal until
+	 * endLeavingMinimizedState() function is called.
+	 */
+	bool isLeavingMinimizedState() const;
+
+	/**
 	 * The distance the user needs to move the mouse with the left button
 	 * hold down before a dock widget start floating
 	 */
@@ -560,9 +576,7 @@
 		widget->setFocus(Qt::OtherFocusReason);
 	}
 
-#ifdef Q_OS_LINUX
 	bool eventFilter(QObject *obj, QEvent *e) override;
-#endif
 
 	/**
 	 * Returns the dock widget that has focus style in the ui or a nullptr if
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockOverlay.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockOverlay.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockOverlay.cpp	(Arbeitskopie)
@@ -139,7 +139,7 @@
      */
     qreal dropIndicatiorWidth(QLabel* l) const
     {
-    #ifdef Q_OS_LINUX
+    #if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
         Q_UNUSED(l)
         return 40;
     #else
@@ -333,7 +333,7 @@
 {
 	d->Mode = Mode;
 	d->Cross = new CDockOverlayCross(this);
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint);
 #else
 	setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);
@@ -595,7 +595,7 @@
 	d(new DockOverlayCrossPrivate(this))
 {
 	d->DockOverlay = overlay;
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint);
 #else
 	setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.cpp	(Arbeitskopie)
@@ -623,6 +623,13 @@
 
 
 //============================================================================
+CDockWidget::eMinimumSizeHintMode CDockWidget::minimumSizeHintMode() const
+{
+	return d->MinimumSizeHintMode;
+}
+
+
+//============================================================================
 bool CDockWidget::isCentralWidget() const
 {
 	return dockManager()->centralWidget() == this;
@@ -643,14 +650,20 @@
 	// If the dock widget state is different, then we really need to toggle
 	// the state. If we are in the right state, then we simply make this
 	// dock widget the current dock widget
+	auto AutoHideContainer = autoHideDockContainer();
 	if (d->Closed != !Open)
 	{
 		toggleViewInternal(Open);
 	}
-	else if (Open && d->DockArea)
+	else if (Open && d->DockArea && !AutoHideContainer)
 	{
 		raise();
 	}
+
+	if (Open && AutoHideContainer)
+	{
+		AutoHideContainer->collapseView(false);
+	}
 }
 
 
@@ -984,14 +997,20 @@
 //============================================================================
 QSize CDockWidget::minimumSizeHint() const
 {
-	if (d->MinimumSizeHintMode == CDockWidget::MinimumSizeHintFromDockWidget || !d->Widget)
+	if (!d->Widget)
 	{
 		return QSize(60, 40);
 	}
-	else
+
+	switch (d->MinimumSizeHintMode)
 	{
-		return d->Widget->minimumSizeHint();
+		case MinimumSizeHintFromDockWidget: return QSize(60, 40);
+    	case MinimumSizeHintFromContent: return d->Widget->minimumSizeHint();
+    	case MinimumSizeHintFromDockWidgetMinimumSize: return minimumSize();
+    	case MinimumSizeHintFromContentMinimumSize: return d->Widget->minimumSize();
 	}
+
+	return d->Widget->minimumSizeHint();
 }
 
 
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.h	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockWidget.h	(Arbeitskopie)
@@ -208,12 +208,17 @@
      * reimplements minimumSizeHint() function to return a very small minimum
      * size hint. If you would like to adhere the minimumSizeHint() from the
      * content widget, then set the minimumSizeHintMode() to
-     * MinimumSizeHintFromContent.
+     * MinimumSizeHintFromContent. If you would like to use the minimumSize()
+     * value of the content widget or the dock widget, then you can use the
+     * MinimumSizeHintFromDockWidgetMinimumSize or
+     * MinimumSizeHintFromContentMinimumSize modes.
      */
     enum eMinimumSizeHintMode
     {
     	MinimumSizeHintFromDockWidget,
-    	MinimumSizeHintFromContent
+    	MinimumSizeHintFromContent,
+    	MinimumSizeHintFromDockWidgetMinimumSize,
+    	MinimumSizeHintFromContentMinimumSize,
     };
 
 
@@ -412,6 +417,11 @@
     void setMinimumSizeHintMode(eMinimumSizeHintMode Mode);
 
     /**
+     * Get the minimum size hint mode configured by setMinimumSizeHintMode
+     */
+    eMinimumSizeHintMode minimumSizeHintMode() const;
+
+    /**
      * Returns true if the dock widget is set as central widget of it's dock manager
      */
     bool isCentralWidget() const;
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.cpp	(Arbeitskopie)
@@ -79,6 +79,7 @@
 	QSpacerItem* IconTextSpacer;
 	QPoint TabDragStartPosition;
 	QSize IconSize;
+	bool MousePressed = false;
 
 	/**
 	 * Private data constructor
@@ -372,10 +373,12 @@
 	if (ev->button() == Qt::LeftButton)
 	{
 		ev->accept();
+		d->MousePressed = true;
         d->saveDragStartMousePosition(internal::globalPositionOf(ev));
         d->DragState = DraggingMousePressed;
         if (CDockManager::testConfigFlag(CDockManager::FocusHighlighting))
         {
+        	d->focusController()->setDockWidgetTabPressed(true);
         	d->focusController()->setDockWidgetTabFocused(this);
         }
         Q_EMIT clicked();
@@ -391,6 +394,7 @@
 {
 	if (ev->button() == Qt::LeftButton)
 	{
+		d->MousePressed = false;
 		auto CurrentDragState = d->DragState;
 		d->GlobalDragStartMousePosition = QPoint();
 		d->DragStartMousePosition = QPoint();
@@ -412,7 +416,12 @@
 			 d->FloatingWidget->finishDragging();
 			 break;
 
-		default:; // do nothing
+		default:
+			if (CDockManager::testConfigFlag(CDockManager::FocusHighlighting))
+			{
+				d->focusController()->setDockWidgetTabPressed(false);
+			}
+			break; // do nothing
 		}
 	} 
 	else if (ev->button() == Qt::MiddleButton)
@@ -802,6 +811,7 @@
 	d->IconSize = Size;
 	d->updateIcon();
 }
+
 } // namespace ads
 //---------------------------------------------------------------------------
 // EOF DockWidgetTab.cpp
Index: scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.h	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/DockWidgetTab.h	(Arbeitskopie)
@@ -178,6 +178,12 @@
 	 */
 	void setIconSize(const QSize& Size);
 
+	/**
+	 * Returns true, if the tab has been clicked and the mouse is currently
+	 * pressed.
+	 */
+	bool mousePressed() const;
+
 public Q_SLOTS:
 	virtual void setVisible(bool visible) override;
 
Index: scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.cpp	(Arbeitskopie)
@@ -52,7 +52,7 @@
 #pragma comment(lib, "User32.lib")
 #endif
 #endif
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include "linux/FloatingWidgetTitleBar.h"
 #include <xcb/xcb.h>
 #endif
@@ -374,10 +374,11 @@
 	QPoint DragStartPos;
 	bool Hiding = false;
 	bool AutoHideChildren = true;
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     QWidget* MouseEventHandler = nullptr;
     CFloatingWidgetTitleBar* TitleBar = nullptr;
 	bool IsResizing = false;
+    bool MousePressed = false;
 #endif
 
 	/**
@@ -424,7 +425,7 @@
 
 	void setWindowTitle(const QString &Text)
 	{
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 		if (TitleBar)
 		{
 			TitleBar->setTitle(Text);
@@ -540,7 +541,7 @@
 		return;
 	}
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	// Prevent display of drop overlays and docking as long as a model dialog
 	// is active
     if (qApp->activeModalWidget())
@@ -641,7 +642,7 @@
 	connect(d->DockContainer, SIGNAL(dockAreasRemoved()), this,
 	    SLOT(onDockAreasAddedOrRemoved()));
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	QDockWidget::setWidget(d->DockContainer);
 	QDockWidget::setFloating(true);
 	QDockWidget::setFeatures(QDockWidget::DockWidgetClosable
@@ -763,18 +764,43 @@
 void CFloatingDockContainer::changeEvent(QEvent *event)
 {
 	Super::changeEvent(event);
-	if ((event->type() == QEvent::ActivationChange) && isActiveWindow())
+	switch (event->type())
 	{
-		ADS_PRINT("FloatingWidget::changeEvent QEvent::ActivationChange ");
-		d->zOrderIndex = ++zOrderCounter;
+	case QEvent::ActivationChange:
+		if (isActiveWindow())
+		{
+			ADS_PRINT("FloatingWidget::changeEvent QEvent::ActivationChange ");
+			d->zOrderIndex = ++zOrderCounter;
 
-#ifdef Q_OS_LINUX
-		if (d->DraggingState == DraggingFloatingWidget)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
+			if (d->DraggingState == DraggingFloatingWidget)
+			{
+				d->titleMouseReleaseEvent();
+				d->DraggingState = DraggingInactive;
+			}
+#endif
+		}
+		break;
+
+	case QEvent::WindowStateChange:
+	    // If the DockManager window is restored from minimized on Windows
+		// then the FloatingWidgets are not properly restored to maximized but
+		// to normal state.
+		// We simply check here, if the FloatingWidget was maximized before
+		// and if the DockManager is just leaving the minimized state. In this
+		// case, we restore the maximized state of this floating widget
+		if (d->DockManager->isLeavingMinimizedState())
 		{
-			d->titleMouseReleaseEvent();
-			d->DraggingState = DraggingInactive;
+			QWindowStateChangeEvent* ev = static_cast<QWindowStateChangeEvent*>(event);
+			if (ev->oldState().testFlag(Qt::WindowMaximized))
+			{
+				this->showMaximized();
+			}
 		}
-#endif
+		break;
+
+	default:
+		break; // do nothing
 	}
 }
 
@@ -920,7 +946,7 @@
 void CFloatingDockContainer::showEvent(QShowEvent *event)
 {
 	Super::showEvent(event);
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     if (CDockManager::testConfigFlag(CDockManager::FocusHighlighting))
     {
         this->window()->activateWindow();
@@ -933,7 +959,7 @@
 void CFloatingDockContainer::startFloating(const QPoint &DragStartMousePos,
     const QSize &Size, eDragState DragState, QWidget *MouseEventHandler)
 {
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     if (!isMaximized())
     {
 		resize(Size);
@@ -985,7 +1011,7 @@
 		// the main window as the active window for some reason. This fixes
 		// that by resetting the active window to the floating widget after
 		// updating the overlays.
-		QApplication::setActiveWindow(this);
+		activateWindow();
 #endif
 		break;
 	default:
@@ -1070,7 +1096,7 @@
 		return false;
 	}
 	onDockAreasAddedOrRemoved();
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	if(d->TitleBar)
 	{
 		d->TitleBar->setMaximizedIcon(windowState() == Qt::WindowMaximized);
@@ -1108,6 +1134,11 @@
 	d->AutoHideChildren = false;
 	hide();
 	deleteLater();
+	if (d->DockManager)
+	{
+		d->DockManager->removeFloatingWidget(this);
+		d->DockManager->removeDockContainer(this->dockContainer());
+	}
 }
 
 //============================================================================
@@ -1114,7 +1145,7 @@
 void CFloatingDockContainer::finishDragging()
 {
 	ADS_PRINT("CFloatingDockContainer::finishDragging");
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	setWindowOpacity(1);
 	activateWindow();
 	if (d->MouseEventHandler)
@@ -1218,7 +1249,7 @@
 		// the main window as the active window for some reason. This fixes
 		// that by resetting the active window to the floating widget after
 		// updating the overlays.
-		QApplication::setActiveWindow(this);
+		activateWindow();
 		break;
 	default:
 		break;
@@ -1229,7 +1260,7 @@
 #endif
 
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 //============================================================================
 void CFloatingDockContainer::onMaximizeRequest()
 {
@@ -1298,12 +1329,12 @@
 	Super::resizeEvent(event);
 }
 
-static bool s_mousePressed = false;
+
 //============================================================================
 void CFloatingDockContainer::moveEvent(QMoveEvent *event)
 {
 	Super::moveEvent(event);
-	if (!d->IsResizing && event->spontaneous() && s_mousePressed)
+    if (!d->IsResizing && event->spontaneous() && d->MousePressed)
 	{
         d->setState(DraggingFloatingWidget);
 		d->updateDropOverlays(QCursor::pos());
@@ -1319,10 +1350,10 @@
 	switch (e->type())
 	{
 	case QEvent::WindowActivate:
-		s_mousePressed = false;
+        d->MousePressed = false;
 		break;
 	case QEvent::WindowDeactivate:
-		s_mousePressed = true;
+        d->MousePressed = true;
 		break;
 	default:
 		break;
Index: scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.h	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDockContainer.h	(Arbeitskopie)
@@ -33,7 +33,7 @@
 
 #include <QRubberBand>
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include <QDockWidget>
 #define tFloatingWidgetBase QDockWidget
 #else
@@ -182,11 +182,9 @@
 
 #ifdef Q_OS_MACOS
 	virtual bool event(QEvent *e) override;
+    virtual void moveEvent(QMoveEvent *event) override;
+#elif defined(Q_OS_UNIX)
 	virtual void moveEvent(QMoveEvent *event) override;
-#endif
-
-#ifdef Q_OS_LINUX
-	virtual void moveEvent(QMoveEvent *event) override;
 	virtual void resizeEvent(QResizeEvent *event) override;
 	virtual bool event(QEvent *e) override;
 #endif
@@ -264,7 +262,7 @@
 	 */
 	void hideAndDeleteLater();
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     /**
 	 * This is a function that responds to FloatingWidgetTitleBar::maximizeRequest()
 	 * Maximize or normalize the container size.
@@ -300,7 +298,6 @@
 	 */
 	bool hasNativeTitleBar();
 #endif
-
 }; // class FloatingDockContainer
 }
  // namespace ads
Index: scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDragPreview.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDragPreview.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/FloatingDragPreview.cpp	(Arbeitskopie)
@@ -262,7 +262,7 @@
 		setAttribute(Qt::WA_TranslucentBackground);
 	}
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
     auto Flags = windowFlags();
     Flags |= Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint;
     setWindowFlags(Flags);
Index: scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.cpp
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.cpp	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.cpp	(Arbeitskopie)
@@ -38,7 +38,7 @@
 #include "IconProvider.h"
 #include "ads_globals.h"
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include <QSettings>
 #include <QFile>
 #include <QApplication>
@@ -52,7 +52,7 @@
 {
 const int FloatingWidgetDragStartEvent = QEvent::registerEventType();
 const int DockedWidgetDragStartEvent = QEvent::registerEventType();
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 static QString _window_manager;
 static QHash<QString, xcb_atom_t> _xcb_atom_cache;
 
@@ -371,7 +371,7 @@
 		return;
 	}
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 	Button->setIcon(Button->style()->standardIcon(StandarPixmap));
 #else
 	// The standard icons does not look good on high DPI screens so we create
Index: scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.h
===================================================================
--- scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.h	(Revision 25546)
+++ scribus/third_party/Qt-Advanced-Docking-System/src/ads_globals.h	(Arbeitskopie)
@@ -40,7 +40,7 @@
 
 #include <iostream>
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 #include <xcb/xcb.h>
 #endif
 
@@ -156,7 +156,7 @@
 extern const int FloatingWidgetDragStartEvent;
 extern const int DockedWidgetDragStartEvent;
 
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
 // Utils to directly communicate with the X server
 /**
  * Get atom from cache or request it from the XServer.
Index: scribus/ui/aligndistribute.cpp
===================================================================
--- scribus/ui/aligndistribute.cpp	(Revision 25546)
+++ scribus/ui/aligndistribute.cpp	(Arbeitskopie)
@@ -47,14 +47,24 @@
 
 //TODO Distribute with 
 
-AlignDistributePalette::AlignDistributePalette( QWidget* parent, const char* name) : ScDockPalette(parent, name, Qt::WindowFlags())
+AlignDistribute::AlignDistribute(QWidget* parent) : QWidget(parent)
 {
 	setupUi(this);
+}
+
+
+// =============================
+
+
+AlignDistributePalette::AlignDistributePalette(QWidget* parent) : DockPanelBase("AlignDistributePalette", parent)
+{
 	setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
-	setObjectName(name);
+	setObjectName("AlignDistributePalette");
 
+	ad = new AlignDistribute(this);
+	setWidget(ad);
 	//set up scrspinboxes
-	distributeDistSpinBox->setValues(-10000.0, 10000.0, 2, 0.0);
+	ad->distributeDistSpinBox->setValues(-10000.0, 10000.0, 2, 0.0);
 
 	resize( QSize(100, 100).expandedTo(minimumSizeHint()) );
 	languageChange();
@@ -72,113 +82,113 @@
 		languageChange();
 		return;
 	}
-	ScDockPalette::changeEvent(e);
+	DockPanelBase::changeEvent(e);
 }
 
 void AlignDistributePalette::languageChange()
 {
-	retranslateUi(this);
+	ad->retranslateUi(this);
 
-	int alignComboValue=alignRelativeToCombo->currentIndex();
-	alignRelativeToCombo->clear();
-	alignRelativeToCombo->addItem( tr( "First Selected" ) );
-	alignRelativeToCombo->addItem( tr( "Last Selected" ) );
-	alignRelativeToCombo->addItem( tr( "Page" ) );
-	alignRelativeToCombo->addItem( tr( "Margins" ) );
-	alignRelativeToCombo->addItem( tr( "Guide" ) );		
-	alignRelativeToCombo->addItem( tr( "Selection" ) );
-	alignRelativeToCombo->setCurrentIndex(alignComboValue);
-	alignRelativeToCombo->setToolTip( tr( "<qt>Align relative to the:<ul><li>First selected item</li><li>Second Selected Item</li><li>The current page</li><li>The margins of the current page</li><li>A Guide</li><li>The selection</ul></qt>" ) );
+	int alignComboValue = ad->alignRelativeToCombo->currentIndex();
+	ad->alignRelativeToCombo->clear();
+	ad->alignRelativeToCombo->addItem( tr( "First Selected" ) );
+	ad->alignRelativeToCombo->addItem( tr( "Last Selected" ) );
+	ad->alignRelativeToCombo->addItem( tr( "Page" ) );
+	ad->alignRelativeToCombo->addItem( tr( "Margins" ) );
+	ad->alignRelativeToCombo->addItem( tr( "Guide" ) );
+	ad->alignRelativeToCombo->addItem( tr( "Selection" ) );
+	ad->alignRelativeToCombo->setCurrentIndex(alignComboValue);
+	ad->alignRelativeToCombo->setToolTip( tr( "<qt>Align relative to the:<ul><li>First selected item</li><li>Second Selected Item</li><li>The current page</li><li>The margins of the current page</li><li>A Guide</li><li>The selection</ul></qt>" ) );
 	alignToChanged(alignComboValue);
 
-	int alignMethodValue=alignMoveOrResizeCombo->currentIndex();
-	alignMoveOrResizeCombo->clear();
-	alignMoveOrResizeCombo->addItem( tr("Move") );
-	alignMoveOrResizeCombo->addItem( tr("Resize") );
-	alignMoveOrResizeCombo->setToolTip( tr( "<qt>When aligning one side of an item do one of the following:<ul><li>Always move the other side too (preserve existing width and height)</li><li>Keep the other side fixed (resize the item instead of moving it) whenever possible</li></ul></qt>" ));
+	int alignMethodValue = ad->alignMoveOrResizeCombo->currentIndex();
+	ad->alignMoveOrResizeCombo->clear();
+	ad->alignMoveOrResizeCombo->addItem( tr("Move") );
+	ad->alignMoveOrResizeCombo->addItem( tr("Resize") );
+	ad->alignMoveOrResizeCombo->setToolTip( tr( "<qt>When aligning one side of an item do one of the following:<ul><li>Always move the other side too (preserve existing width and height)</li><li>Keep the other side fixed (resize the item instead of moving it) whenever possible</li></ul></qt>" ));
 	alignMethodChanged(alignMethodValue);
 
-	alignGuideLineEdit->setToolTip( tr( "The location of the selected guide to align to" ) );
-	alignLeftOutToolButton->setToolTip( tr( "Align right sides of items to left side of anchor" ) );
-	alignRightOutToolButton->setToolTip( tr( "Align left sides of items to right side of anchor" ) );
-	alignBottomInToolButton->setToolTip( tr( "Align bottoms" ) );
-	alignRightInToolButton->setToolTip( tr( "Align right sides" ) );
-	alignBottomOutToolButton->setToolTip( tr( "Align tops of items to bottom of anchor" ) );
-	alignCenterHorToolButton->setToolTip( tr( "Center on vertical axis" ) );
-	alignLeftInToolButton->setToolTip( tr( "Align left sides" ) );
-	alignCenterVerToolButton->setToolTip( tr( "Center on horizontal axis" ) );
-	alignTopOutToolButton->setToolTip( tr( "Align bottoms of items to top of anchor" ) );
-	alignTopInToolButton->setToolTip( tr( "Align tops" ) );
-		
-	distributeDistHToolButton->setToolTip( tr( "Make horizontal gaps between items equal" ) );
-	distributeDistValueHToolButton->setToolTip( tr( "Make horizontal gaps between items equal to the value specified" ) );
-	
-	distributeRightToolButton->setToolTip( tr( "Distribute right sides equidistantly" ) );
-	distributeBottomToolButton->setToolTip( tr( "Distribute bottoms equidistantly" ) );
-	distributeCenterHToolButton->setToolTip( tr( "Distribute centers equidistantly horizontally" ) );
-	distributeDistVToolButton->setToolTip( tr( "Make vertical gaps between items equal" ) );
-	distributeDistValueVToolButton->setToolTip( tr( "Make vertical gaps between items equal to the value specified" ) );
-	distributeLeftToolButton->setToolTip( tr( "Distribute left sides equidistantly" ) );
-	distributeCenterVToolButton->setToolTip( tr( "Distribute centers equidistantly vertically" ) );
-	distributeTopToolButton->setToolTip( tr( "Distribute tops equidistantly" ) );
-	distributeAcrossPageToolButton->setToolTip( tr( "Make horizontal gaps between items and sides of page equal" ) );
-	distributeDownPageToolButton->setToolTip( tr( "Make vertical gaps between items and the top and bottom of page equal" ) );
-	distributeAcrossMarginsToolButton->setToolTip( tr( "Make horizontal gaps between items and sides of page margins equal" ) );
-	distributeDownMarginsToolButton->setToolTip( tr( "Make vertical gaps between items and the top and bottom of page margins equal" ) );
+	ad->alignGuideLineEdit->setToolTip( tr( "The location of the selected guide to align to" ) );
+	ad->alignLeftOutToolButton->setToolTip( tr( "Align right sides of items to left side of anchor" ) );
+	ad->alignRightOutToolButton->setToolTip( tr( "Align left sides of items to right side of anchor" ) );
+	ad->alignBottomInToolButton->setToolTip( tr( "Align bottoms" ) );
+	ad->alignRightInToolButton->setToolTip( tr( "Align right sides" ) );
+	ad->alignBottomOutToolButton->setToolTip( tr( "Align tops of items to bottom of anchor" ) );
+	ad->alignCenterHorToolButton->setToolTip( tr( "Center on vertical axis" ) );
+	ad->alignLeftInToolButton->setToolTip( tr( "Align left sides" ) );
+	ad->alignCenterVerToolButton->setToolTip( tr( "Center on horizontal axis" ) );
+	ad->alignTopOutToolButton->setToolTip( tr( "Align bottoms of items to top of anchor" ) );
+	ad->alignTopInToolButton->setToolTip( tr( "Align tops" ) );
 
-	distributeDistSpinBox->setToolTip( tr( "Distribute the items with the distance specified" ) );
-	reverseDistributionCheckBox->setToolTip( tr("When distributing by a set distance, reverse the direction of the distribution of items") );
-	
+	ad->distributeDistHToolButton->setToolTip( tr( "Make horizontal gaps between items equal" ) );
+	ad->distributeDistValueHToolButton->setToolTip( tr( "Make horizontal gaps between items equal to the value specified" ) );
+
+	ad->distributeRightToolButton->setToolTip( tr( "Distribute right sides equidistantly" ) );
+	ad->distributeBottomToolButton->setToolTip( tr( "Distribute bottoms equidistantly" ) );
+	ad->distributeCenterHToolButton->setToolTip( tr( "Distribute centers equidistantly horizontally" ) );
+	ad->distributeDistVToolButton->setToolTip( tr( "Make vertical gaps between items equal" ) );
+	ad->distributeDistValueVToolButton->setToolTip( tr( "Make vertical gaps between items equal to the value specified" ) );
+	ad->distributeLeftToolButton->setToolTip( tr( "Distribute left sides equidistantly" ) );
+	ad->distributeCenterVToolButton->setToolTip( tr( "Distribute centers equidistantly vertically" ) );
+	ad->distributeTopToolButton->setToolTip( tr( "Distribute tops equidistantly" ) );
+	ad->distributeAcrossPageToolButton->setToolTip( tr( "Make horizontal gaps between items and sides of page equal" ) );
+	ad->distributeDownPageToolButton->setToolTip( tr( "Make vertical gaps between items and the top and bottom of page equal" ) );
+	ad->distributeAcrossMarginsToolButton->setToolTip( tr( "Make horizontal gaps between items and sides of page margins equal" ) );
+	ad->distributeDownMarginsToolButton->setToolTip( tr( "Make vertical gaps between items and the top and bottom of page margins equal" ) );
+
+	ad->distributeDistSpinBox->setToolTip( tr( "Distribute the items with the distance specified" ) );
+	ad->reverseDistributionCheckBox->setToolTip( tr("When distributing by a set distance, reverse the direction of the distribution of items") );
+
 	guideInfoTextNone = tr("None Selected");
 
-	swapLeftToolButton->setToolTip( tr( "Swap items to the left" ) );
-	swapRightToolButton->setToolTip( tr( "Swap items to the right" ) );
+	ad->swapLeftToolButton->setToolTip( tr( "Swap items to the left" ) );
+	ad->swapRightToolButton->setToolTip( tr( "Swap items to the right" ) );
 }
 
 void AlignDistributePalette::init()
 {
 	undoManager = UndoManager::instance();
-	
+
 	iconSetChange();
 
-	connect(alignLeftOutToolButton, SIGNAL(clicked()), this, SLOT(alignLeftOut()));
-	connect(alignRightOutToolButton, SIGNAL(clicked()), this, SLOT(alignRightOut()));
-	connect(alignBottomInToolButton, SIGNAL(clicked()), this, SLOT(alignBottomIn()));
-	connect(alignRightInToolButton, SIGNAL(clicked()), this, SLOT(alignRightIn()));
-	connect(alignBottomOutToolButton, SIGNAL(clicked()), this, SLOT(alignBottomOut()));
-	connect(alignCenterHorToolButton, SIGNAL(clicked()), this, SLOT(alignCenterHor()));
-	connect(alignLeftInToolButton, SIGNAL(clicked()), this, SLOT(alignLeftIn()));
-	connect(alignCenterVerToolButton, SIGNAL(clicked()), this, SLOT(alignCenterVer()));
-	connect(alignTopOutToolButton, SIGNAL(clicked()), this, SLOT(alignTopOut()));
-	connect(alignTopInToolButton, SIGNAL(clicked()), this, SLOT(alignTopIn()));
-	connect(distributeDistHToolButton, SIGNAL(clicked()), this, SLOT(distributeDistH()));
-	connect(distributeDistValueHToolButton, SIGNAL(clicked()), this, SLOT(distributeDistValH()));
-	connect(distributeRightToolButton, SIGNAL(clicked()), this, SLOT(distributeRight()));
-	connect(distributeBottomToolButton, SIGNAL(clicked()), this, SLOT(distributeBottom()));
-	connect(distributeCenterHToolButton, SIGNAL(clicked()), this, SLOT(distributeCenterH()));
-	connect(distributeDistVToolButton, SIGNAL(clicked()), this, SLOT(distributeDistV()));
-	connect(distributeDistValueVToolButton, SIGNAL(clicked()), this, SLOT(distributeDistValV()));
-	connect(distributeLeftToolButton, SIGNAL(clicked()), this, SLOT(distributeLeft()));
-	connect(distributeCenterVToolButton, SIGNAL(clicked()), this, SLOT(distributeCenterV()));
-	connect(distributeTopToolButton, SIGNAL(clicked()), this, SLOT(distributeTop()));
-	connect(distributeAcrossPageToolButton, SIGNAL(clicked()), this, SLOT(distributeDistAcrossPage()));
-	connect(distributeDownPageToolButton, SIGNAL(clicked()), this, SLOT(distributeDistDownPage()));
-	connect(distributeAcrossMarginsToolButton, SIGNAL(clicked()), this, SLOT(distributeDistAcrossMargins()));
-	connect(distributeDownMarginsToolButton, SIGNAL(clicked()), this, SLOT(distributeDistDownMargins()));
-	connect(swapLeftToolButton, SIGNAL(clicked()), this, SLOT(swapLeft()));
-	connect(swapRightToolButton, SIGNAL(clicked()), this, SLOT(swapRight()));
-	
-	alignRelativeToCombo->setCurrentIndex(0);
+	connect(ad->alignLeftOutToolButton, SIGNAL(clicked()), this, SLOT(alignLeftOut()));
+	connect(ad->alignRightOutToolButton, SIGNAL(clicked()), this, SLOT(alignRightOut()));
+	connect(ad->alignBottomInToolButton, SIGNAL(clicked()), this, SLOT(alignBottomIn()));
+	connect(ad->alignRightInToolButton, SIGNAL(clicked()), this, SLOT(alignRightIn()));
+	connect(ad->alignBottomOutToolButton, SIGNAL(clicked()), this, SLOT(alignBottomOut()));
+	connect(ad->alignCenterHorToolButton, SIGNAL(clicked()), this, SLOT(alignCenterHor()));
+	connect(ad->alignLeftInToolButton, SIGNAL(clicked()), this, SLOT(alignLeftIn()));
+	connect(ad->alignCenterVerToolButton, SIGNAL(clicked()), this, SLOT(alignCenterVer()));
+	connect(ad->alignTopOutToolButton, SIGNAL(clicked()), this, SLOT(alignTopOut()));
+	connect(ad->alignTopInToolButton, SIGNAL(clicked()), this, SLOT(alignTopIn()));
+	connect(ad->distributeDistHToolButton, SIGNAL(clicked()), this, SLOT(distributeDistH()));
+	connect(ad->distributeDistValueHToolButton, SIGNAL(clicked()), this, SLOT(distributeDistValH()));
+	connect(ad->distributeRightToolButton, SIGNAL(clicked()), this, SLOT(distributeRight()));
+	connect(ad->distributeBottomToolButton, SIGNAL(clicked()), this, SLOT(distributeBottom()));
+	connect(ad->distributeCenterHToolButton, SIGNAL(clicked()), this, SLOT(distributeCenterH()));
+	connect(ad->distributeDistVToolButton, SIGNAL(clicked()), this, SLOT(distributeDistV()));
+	connect(ad->distributeDistValueVToolButton, SIGNAL(clicked()), this, SLOT(distributeDistValV()));
+	connect(ad->distributeLeftToolButton, SIGNAL(clicked()), this, SLOT(distributeLeft()));
+	connect(ad->distributeCenterVToolButton, SIGNAL(clicked()), this, SLOT(distributeCenterV()));
+	connect(ad->distributeTopToolButton, SIGNAL(clicked()), this, SLOT(distributeTop()));
+	connect(ad->distributeAcrossPageToolButton, SIGNAL(clicked()), this, SLOT(distributeDistAcrossPage()));
+	connect(ad->distributeDownPageToolButton, SIGNAL(clicked()), this, SLOT(distributeDistDownPage()));
+	connect(ad->distributeAcrossMarginsToolButton, SIGNAL(clicked()), this, SLOT(distributeDistAcrossMargins()));
+	connect(ad->distributeDownMarginsToolButton, SIGNAL(clicked()), this, SLOT(distributeDistDownMargins()));
+	connect(ad->swapLeftToolButton, SIGNAL(clicked()), this, SLOT(swapLeft()));
+	connect(ad->swapRightToolButton, SIGNAL(clicked()), this, SLOT(swapRight()));
+
+	ad->alignRelativeToCombo->setCurrentIndex(0);
 	alignToChanged(0);
 	alignMethodChanged(0);
-	connect(alignRelativeToCombo, SIGNAL(activated(int)), this, SLOT(alignToChanged(int)));
-	connect(alignMoveOrResizeCombo, SIGNAL(activated(int)), this, SLOT(alignMethodChanged(int)));
-	
+	connect(ad->alignRelativeToCombo, SIGNAL(activated(int)), this, SLOT(alignToChanged(int)));
+	connect(ad->alignMoveOrResizeCombo, SIGNAL(activated(int)), this, SLOT(alignMethodChanged(int)));
+
 	unitRatio = 1.0;
 	guideDirection = -1;
-	
+
 	guideInfoText = guideInfoTextNone;
-	alignGuideLineEdit->setText(guideInfoTextNone);
+	ad->alignGuideLineEdit->setText(guideInfoTextNone);
 }
 
 void AlignDistributePalette::iconSetChange()
@@ -185,37 +195,37 @@
 {
 	IconManager& im = IconManager::instance();
 
-	alignLeftOutToolButton->setIcon(im.loadIcon("22/align-horizontal-left-out.png"));
-	alignLeftInToolButton->setIcon(im.loadIcon("22/align-horizontal-left.png"));
-	alignCenterHorToolButton->setIcon(im.loadIcon("22/align-horizontal-center.png"));
-	alignRightInToolButton->setIcon(im.loadIcon("22/align-horizontal-right.png"));
-	alignRightOutToolButton->setIcon(im.loadIcon("22/align-horizontal-right-out.png"));
+	ad->alignLeftOutToolButton->setIcon(im.loadIcon("22/align-horizontal-left-out.png"));
+	ad->alignLeftInToolButton->setIcon(im.loadIcon("22/align-horizontal-left.png"));
+	ad->alignCenterHorToolButton->setIcon(im.loadIcon("22/align-horizontal-center.png"));
+	ad->alignRightInToolButton->setIcon(im.loadIcon("22/align-horizontal-right.png"));
+	ad->alignRightOutToolButton->setIcon(im.loadIcon("22/align-horizontal-right-out.png"));
 
-	alignTopOutToolButton->setIcon(im.loadIcon("22/align-vertical-top-out.png"));
-	alignTopInToolButton->setIcon(im.loadIcon("22/align-vertical-top.png"));
-	alignCenterVerToolButton->setIcon(im.loadIcon("22/align-vertical-center.png"));
-	alignBottomInToolButton->setIcon(im.loadIcon("22/align-vertical-bottom.png"));
-	alignBottomOutToolButton->setIcon(im.loadIcon("22/align-vertical-bottom-out.png"));
+	ad->alignTopOutToolButton->setIcon(im.loadIcon("22/align-vertical-top-out.png"));
+	ad->alignTopInToolButton->setIcon(im.loadIcon("22/align-vertical-top.png"));
+	ad->alignCenterVerToolButton->setIcon(im.loadIcon("22/align-vertical-center.png"));
+	ad->alignBottomInToolButton->setIcon(im.loadIcon("22/align-vertical-bottom.png"));
+	ad->alignBottomOutToolButton->setIcon(im.loadIcon("22/align-vertical-bottom-out.png"));
 
-	distributeLeftToolButton->setIcon(im.loadIcon("22/distribute-horizontal-left.png"));
-	distributeCenterHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-center.png"));
-	distributeRightToolButton->setIcon(im.loadIcon("22/distribute-horizontal-right.png"));
-	distributeDistHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-equal.png"));
+	ad->distributeLeftToolButton->setIcon(im.loadIcon("22/distribute-horizontal-left.png"));
+	ad->distributeCenterHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-center.png"));
+	ad->distributeRightToolButton->setIcon(im.loadIcon("22/distribute-horizontal-right.png"));
+	ad->distributeDistHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-equal.png"));
 
-	distributeBottomToolButton->setIcon(im.loadIcon("22/distribute-vertical-bottom.png"));
-	distributeCenterVToolButton->setIcon(im.loadIcon("22/distribute-vertical-center.png"));
-	distributeTopToolButton->setIcon(im.loadIcon("22/distribute-vertical-top.png"));
-	distributeDistVToolButton->setIcon(im.loadIcon("22/distribute-vertical-equal.png"));
+	ad->distributeBottomToolButton->setIcon(im.loadIcon("22/distribute-vertical-bottom.png"));
+	ad->distributeCenterVToolButton->setIcon(im.loadIcon("22/distribute-vertical-center.png"));
+	ad->distributeTopToolButton->setIcon(im.loadIcon("22/distribute-vertical-top.png"));
+	ad->distributeDistVToolButton->setIcon(im.loadIcon("22/distribute-vertical-equal.png"));
 
-	distributeAcrossPageToolButton->setIcon(im.loadIcon("22/distribute-horizontal-page.png"));
-	distributeDownPageToolButton->setIcon(im.loadIcon("22/distribute-vertical-page.png"));
-	distributeAcrossMarginsToolButton->setIcon(im.loadIcon("22/distribute-horizontal-margin.png"));
-	distributeDownMarginsToolButton->setIcon(im.loadIcon("22/distribute-vertical-margin.png"));
-	distributeDistValueHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-x.png"));
-	distributeDistValueVToolButton->setIcon(im.loadIcon("22/distribute-vertical-y.png"));
+	ad->distributeAcrossPageToolButton->setIcon(im.loadIcon("22/distribute-horizontal-page.png"));
+	ad->distributeDownPageToolButton->setIcon(im.loadIcon("22/distribute-vertical-page.png"));
+	ad->distributeAcrossMarginsToolButton->setIcon(im.loadIcon("22/distribute-horizontal-margin.png"));
+	ad->distributeDownMarginsToolButton->setIcon(im.loadIcon("22/distribute-vertical-margin.png"));
+	ad->distributeDistValueHToolButton->setIcon(im.loadIcon("22/distribute-horizontal-x.png"));
+	ad->distributeDistValueVToolButton->setIcon(im.loadIcon("22/distribute-vertical-y.png"));
 
-	swapLeftToolButton->setIcon(im.loadIcon("22/swap-left.png"));
-	swapRightToolButton->setIcon(im.loadIcon("22/swap-right.png"));
+	ad->swapLeftToolButton->setIcon(im.loadIcon("22/swap-left.png"));
+	ad->swapRightToolButton->setIcon(im.loadIcon("22/swap-right.png"));
 }
 
 void AlignDistributePalette::unitChange()
@@ -223,7 +233,7 @@
 	if (currDoc == nullptr)
 		return;
 	unitRatio = unitGetRatioFromIndex(currDoc->unitIndex());
-	distributeDistSpinBox->setNewUnit(currDoc->unitIndex());
+	ad->distributeDistSpinBox->setNewUnit(currDoc->unitIndex());
 	enableGuideButtons();
 }
 
@@ -320,12 +330,12 @@
 void AlignDistributePalette::distributeDistH(bool usingDistance)
 {
 	if (currDoc != nullptr)
-		currDoc->itemSelection_DistributeDistH(usingDistance, distributeDistSpinBox->value(), reverseDistributionCheckBox->isChecked());
+		currDoc->itemSelection_DistributeDistH(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionCheckBox->isChecked());
 }
 
 void AlignDistributePalette::distributeDistValH()
 {
-	distributeDistSpinBox->interpretText();
+	ad->distributeDistSpinBox->interpretText();
 	if (currDoc != nullptr)
 		distributeDistH(true);
 }
@@ -375,12 +385,12 @@
 void AlignDistributePalette::distributeDistV(bool usingDistance)
 {
 	if (currDoc != nullptr)
-		currDoc->itemSelection_DistributeDistV(usingDistance, distributeDistSpinBox->value(), reverseDistributionCheckBox->isChecked());
+		currDoc->itemSelection_DistributeDistV(usingDistance, ad->distributeDistSpinBox->value(), ad->reverseDistributionCheckBox->isChecked());
 }
 
 void AlignDistributePalette::distributeDistValV()
 {
-	distributeDistSpinBox->interpretText();
+	ad->distributeDistSpinBox->interpretText();
 	if (currDoc != nullptr)
 		distributeDistV(true);
 }
@@ -421,7 +431,7 @@
 void AlignDistributePalette::localeChange()
 {
 	const QLocale& l(LocaleManager::instance().userPreferredLocale());
-	distributeDistSpinBox->setLocale(l);
+	ad->distributeDistSpinBox->setLocale(l);
 }
 
 void AlignDistributePalette::enableGuideButtons()
@@ -458,18 +468,19 @@
 	bool setterO = true;
 	if (currAlignTo == ScribusDoc::alignGuide)
 		setterO = false;
-		
-	alignLeftInToolButton->setEnabled(setterV);
-	alignLeftOutToolButton->setEnabled(setterO);
-	alignRightInToolButton->setEnabled(setterV);
-	alignRightOutToolButton->setEnabled(setterO);
-	alignCenterHorToolButton->setEnabled(setterV);
 
-	alignTopInToolButton->setEnabled(setterH);
-	alignTopOutToolButton->setEnabled(setterO);
-	alignBottomInToolButton->setEnabled(setterH);
-	alignBottomOutToolButton->setEnabled(setterO);
-	alignCenterVerToolButton->setEnabled(setterH);
-	
-	alignGuideLineEdit->setText(guideInfoText);
+	ad->alignLeftInToolButton->setEnabled(setterV);
+	ad->alignLeftOutToolButton->setEnabled(setterO);
+	ad->alignRightInToolButton->setEnabled(setterV);
+	ad->alignRightOutToolButton->setEnabled(setterO);
+	ad->alignCenterHorToolButton->setEnabled(setterV);
+
+	ad->alignTopInToolButton->setEnabled(setterH);
+	ad->alignTopOutToolButton->setEnabled(setterO);
+	ad->alignBottomInToolButton->setEnabled(setterH);
+	ad->alignBottomOutToolButton->setEnabled(setterO);
+	ad->alignCenterVerToolButton->setEnabled(setterH);
+
+	ad->alignGuideLineEdit->setText(guideInfoText);
 }
+
Index: scribus/ui/aligndistribute.h
===================================================================
--- scribus/ui/aligndistribute.h	(Revision 25546)
+++ scribus/ui/aligndistribute.h	(Arbeitskopie)
@@ -35,6 +35,7 @@
 #include "scribusapi.h"
 #include "scribusdoc.h"
 #include "ui/scdockpalette.h"
+#include "docks/dock_panelbase.h"
 
 class QComboBox;
 class QLabel;
@@ -48,15 +49,25 @@
 
 struct AlignObjs;
 
+class SCRIBUS_API AlignDistribute : public QWidget, Ui::AlignDistribute
+{
+	friend class AlignDistributePalette;
 
+public:
+	AlignDistribute( QWidget* parent = nullptr);
+	~AlignDistribute() = default;
+};
+
+
+
 /*! \brief Align/Distribute palette.
 */
-class SCRIBUS_API AlignDistributePalette : public ScDockPalette, Ui::AlignDistribute
+class SCRIBUS_API AlignDistributePalette : public DockPanelBase
 {
 	Q_OBJECT
 
 public:
-	AlignDistributePalette( QWidget* parent = nullptr, const char* name = 0);
+	AlignDistributePalette( QWidget* parent = nullptr);
 	~AlignDistributePalette() = default;
 
 	virtual void setDoc( ScribusDoc* newDoc );
@@ -68,6 +79,7 @@
 
 protected:
 	ScribusView *currView { nullptr };
+	AlignDistribute * ad {nullptr};
 
 	void changeEvent(QEvent *e) override;
 	
Index: scribus/ui/aligndistribute.ui
===================================================================
--- scribus/ui/aligndistribute.ui	(Revision 25546)
+++ scribus/ui/aligndistribute.ui	(Arbeitskopie)
@@ -1,1061 +1,1059 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>AlignDistribute</class>
- <widget class="ScDockPalette" name="AlignDistribute">
+ <widget class="QWidget" name="AlignDistribute">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>269</width>
-    <height>308</height>
+    <width>247</width>
+    <height>277</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Align and Distribute</string>
   </property>
-  <widget class="QWidget" name="dockWidgetContents">
-   <layout class="QVBoxLayout" name="verticalLayout_3">
-    <property name="leftMargin">
-     <number>3</number>
-    </property>
-    <property name="topMargin">
-     <number>3</number>
-    </property>
-    <property name="rightMargin">
-     <number>3</number>
-    </property>
-    <property name="bottomMargin">
-     <number>3</number>
-    </property>
-    <item>
-     <widget class="QTabWidget" name="tabWidget">
-      <property name="currentIndex">
-       <number>0</number>
-      </property>
-      <widget class="QWidget" name="tabAlign">
-       <attribute name="title">
-        <string>Align</string>
-       </attribute>
-       <layout class="QVBoxLayout">
-        <property name="spacing">
-         <number>3</number>
-        </property>
-        <property name="leftMargin">
-         <number>6</number>
-        </property>
-        <property name="topMargin">
-         <number>6</number>
-        </property>
-        <property name="rightMargin">
-         <number>6</number>
-        </property>
-        <property name="bottomMargin">
-         <number>6</number>
-        </property>
-        <item>
-         <layout class="QHBoxLayout" name="_2">
-          <property name="spacing">
-           <number>3</number>
-          </property>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <layout class="QGridLayout" name="_3">
-            <item row="1" column="0">
-             <widget class="QLabel" name="alignGuideLabel">
-              <property name="text">
-               <string>&amp;Selected Guide:</string>
-              </property>
-              <property name="wordWrap">
-               <bool>false</bool>
-              </property>
-              <property name="buddy">
-               <cstring>alignGuideLineEdit</cstring>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="0">
-             <widget class="QLabel" name="alignRelativeToLabel">
-              <property name="text">
-               <string>&amp;Relative To:</string>
-              </property>
-              <property name="wordWrap">
-               <bool>false</bool>
-              </property>
-              <property name="buddy">
-               <cstring>alignRelativeToCombo</cstring>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="1">
-             <widget class="QLineEdit" name="alignGuideLineEdit"/>
-            </item>
-            <item row="0" column="1">
-             <widget class="QComboBox" name="alignRelativeToCombo"/>
-            </item>
-            <item row="2" column="0">
-             <widget class="QLabel" name="alignMoveOrResizeLabel">
-              <property name="text">
-               <string>&amp;Align Sides By:</string>
-              </property>
-              <property name="wordWrap">
-               <bool>false</bool>
-              </property>
-              <property name="buddy">
-               <cstring>alignMoveOrResizeCombo</cstring>
-              </property>
-             </widget>
-            </item>
-            <item row="2" column="1">
-             <widget class="QComboBox" name="alignMoveOrResizeCombo"/>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <layout class="QHBoxLayout" name="_4">
-          <property name="spacing">
-           <number>3</number>
-          </property>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <layout class="QGridLayout" name="_5">
-            <item row="1" column="3">
-             <widget class="QToolButton" name="alignBottomInToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="1">
-             <widget class="QToolButton" name="alignTopInToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="1">
-             <widget class="QToolButton" name="alignLeftInToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="3">
-             <widget class="QToolButton" name="alignRightInToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="4">
-             <widget class="QToolButton" name="alignBottomOutToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="0">
-             <widget class="QToolButton" name="alignTopOutToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="2">
-             <widget class="QToolButton" name="alignCenterVerToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="0">
-             <widget class="QToolButton" name="alignLeftOutToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="4">
-             <widget class="QToolButton" name="alignRightOutToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="2">
-             <widget class="QToolButton" name="alignCenterHorToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <spacer>
-          <property name="orientation">
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Expanding</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>20</width>
-            <height>0</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="tabDistribute">
-       <attribute name="title">
-        <string>Distribute</string>
-       </attribute>
-       <layout class="QVBoxLayout" name="verticalLayout_2">
-        <property name="spacing">
-         <number>3</number>
-        </property>
-        <property name="leftMargin">
-         <number>6</number>
-        </property>
-        <property name="topMargin">
-         <number>6</number>
-        </property>
-        <property name="rightMargin">
-         <number>6</number>
-        </property>
-        <property name="bottomMargin">
-         <number>6</number>
-        </property>
-        <item>
-         <layout class="QHBoxLayout" name="_6">
-          <property name="spacing">
-           <number>3</number>
-          </property>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>63</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <layout class="QGridLayout" name="_7">
-            <item row="0" column="3">
-             <widget class="QToolButton" name="distributeDistHToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="2">
-             <widget class="QToolButton" name="distributeTopToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="1">
-             <widget class="QToolButton" name="distributeCenterVToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="2">
-             <widget class="QToolButton" name="distributeRightToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="2" column="2">
-             <widget class="QToolButton" name="distributeAcrossMarginsToolButton">
-              <property name="enabled">
-               <bool>true</bool>
-              </property>
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="0">
-             <widget class="QToolButton" name="distributeLeftToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="2" column="0">
-             <widget class="QToolButton" name="distributeAcrossPageToolButton">
-              <property name="enabled">
-               <bool>true</bool>
-              </property>
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="3" column="1">
-             <widget class="QToolButton" name="distributeDistValueHToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="2" column="3">
-             <widget class="QToolButton" name="distributeDownMarginsToolButton">
-              <property name="enabled">
-               <bool>true</bool>
-              </property>
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="1">
-             <widget class="QToolButton" name="distributeCenterHToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="2" column="1">
-             <widget class="QToolButton" name="distributeDownPageToolButton">
-              <property name="enabled">
-               <bool>true</bool>
-              </property>
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="3" column="2">
-             <widget class="QToolButton" name="distributeDistValueVToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="3">
-             <widget class="QToolButton" name="distributeDistVToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="0">
-             <widget class="QToolButton" name="distributeBottomToolButton">
-              <property name="minimumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>24</width>
-                <height>24</height>
-               </size>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>62</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <layout class="QHBoxLayout" name="_8">
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <layout class="QHBoxLayout" name="_9">
-            <property name="spacing">
-             <number>3</number>
-            </property>
-            <item>
-             <widget class="QLabel" name="distributeDistLabel">
-              <property name="text">
-               <string>&amp;Distance:</string>
-              </property>
-              <property name="wordWrap">
-               <bool>false</bool>
-              </property>
-              <property name="indent">
-               <number>-1</number>
-              </property>
-              <property name="buddy">
-               <cstring>distributeDistSpinBox</cstring>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="ScrSpinBox" name="distributeDistSpinBox">
-              <property name="minimumSize">
-               <size>
-                <width>50</width>
-                <height>24</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <spacer>
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <layout class="QHBoxLayout" name="horizontalLayout_2">
-          <property name="spacing">
-           <number>3</number>
-          </property>
-          <item>
-           <spacer name="spacer">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <widget class="QCheckBox" name="reverseDistributionCheckBox">
-            <property name="text">
-             <string>Reverse Distribution</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <spacer name="spacer_2">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Expanding</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <spacer>
-          <property name="orientation">
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Expanding</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>20</width>
-            <height>0</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="tabSwap">
-       <attribute name="title">
-        <string>Swap</string>
-       </attribute>
-       <layout class="QVBoxLayout" name="verticalLayout">
-        <property name="spacing">
-         <number>3</number>
-        </property>
-        <property name="leftMargin">
-         <number>6</number>
-        </property>
-        <property name="topMargin">
-         <number>6</number>
-        </property>
-        <property name="rightMargin">
-         <number>6</number>
-        </property>
-        <property name="bottomMargin">
-         <number>6</number>
-        </property>
-        <item>
-         <layout class="QHBoxLayout" name="horizontalLayout">
-          <property name="spacing">
-           <number>3</number>
-          </property>
-          <item>
-           <spacer name="horizontalSpacer">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <widget class="QToolButton" name="swapLeftToolButton">
-            <property name="minimumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="iconSize">
-             <size>
-              <width>22</width>
-              <height>22</height>
-             </size>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QToolButton" name="swapRightToolButton">
-            <property name="minimumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="iconSize">
-             <size>
-              <width>22</width>
-              <height>22</height>
-             </size>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <spacer name="horizontalSpacer_2">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <spacer name="verticalSpacer">
-          <property name="orientation">
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>20</width>
-            <height>0</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </widget>
+  <layout class="QVBoxLayout" name="verticalLayout_3">
+   <property name="leftMargin">
+    <number>3</number>
+   </property>
+   <property name="topMargin">
+    <number>3</number>
+   </property>
+   <property name="rightMargin">
+    <number>3</number>
+   </property>
+   <property name="bottomMargin">
+    <number>3</number>
+   </property>
+   <item>
+    <widget class="QTabWidget" name="tabWidget">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="tabAlign">
+      <attribute name="title">
+       <string>Align</string>
+      </attribute>
+      <layout class="QVBoxLayout">
+       <property name="spacing">
+        <number>3</number>
+       </property>
+       <property name="leftMargin">
+        <number>6</number>
+       </property>
+       <property name="topMargin">
+        <number>6</number>
+       </property>
+       <property name="rightMargin">
+        <number>6</number>
+       </property>
+       <property name="bottomMargin">
+        <number>6</number>
+       </property>
+       <item>
+        <layout class="QHBoxLayout" name="_2">
+         <property name="spacing">
+          <number>3</number>
+         </property>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <layout class="QGridLayout" name="_3">
+           <item row="1" column="0">
+            <widget class="QLabel" name="alignGuideLabel">
+             <property name="text">
+              <string>&amp;Selected Guide:</string>
+             </property>
+             <property name="wordWrap">
+              <bool>false</bool>
+             </property>
+             <property name="buddy">
+              <cstring>alignGuideLineEdit</cstring>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="0">
+            <widget class="QLabel" name="alignRelativeToLabel">
+             <property name="text">
+              <string>&amp;Relative To:</string>
+             </property>
+             <property name="wordWrap">
+              <bool>false</bool>
+             </property>
+             <property name="buddy">
+              <cstring>alignRelativeToCombo</cstring>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="1">
+            <widget class="QLineEdit" name="alignGuideLineEdit"/>
+           </item>
+           <item row="0" column="1">
+            <widget class="QComboBox" name="alignRelativeToCombo"/>
+           </item>
+           <item row="2" column="0">
+            <widget class="QLabel" name="alignMoveOrResizeLabel">
+             <property name="text">
+              <string>&amp;Align Sides By:</string>
+             </property>
+             <property name="wordWrap">
+              <bool>false</bool>
+             </property>
+             <property name="buddy">
+              <cstring>alignMoveOrResizeCombo</cstring>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="1">
+            <widget class="QComboBox" name="alignMoveOrResizeCombo"/>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="_4">
+         <property name="spacing">
+          <number>3</number>
+         </property>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <layout class="QGridLayout" name="_5">
+           <item row="1" column="3">
+            <widget class="QToolButton" name="alignBottomInToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="1">
+            <widget class="QToolButton" name="alignTopInToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="1">
+            <widget class="QToolButton" name="alignLeftInToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="3">
+            <widget class="QToolButton" name="alignRightInToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="4">
+            <widget class="QToolButton" name="alignBottomOutToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="0">
+            <widget class="QToolButton" name="alignTopOutToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="2">
+            <widget class="QToolButton" name="alignCenterVerToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="0">
+            <widget class="QToolButton" name="alignLeftOutToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="4">
+            <widget class="QToolButton" name="alignRightOutToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="2">
+            <widget class="QToolButton" name="alignCenterHorToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer>
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Expanding</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
      </widget>
-    </item>
-   </layout>
-  </widget>
+     <widget class="QWidget" name="tabDistribute">
+      <attribute name="title">
+       <string>Distribute</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <property name="spacing">
+        <number>3</number>
+       </property>
+       <property name="leftMargin">
+        <number>6</number>
+       </property>
+       <property name="topMargin">
+        <number>6</number>
+       </property>
+       <property name="rightMargin">
+        <number>6</number>
+       </property>
+       <property name="bottomMargin">
+        <number>6</number>
+       </property>
+       <item>
+        <layout class="QHBoxLayout" name="_6">
+         <property name="spacing">
+          <number>3</number>
+         </property>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>63</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <layout class="QGridLayout" name="_7">
+           <item row="0" column="3">
+            <widget class="QToolButton" name="distributeDistHToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="2">
+            <widget class="QToolButton" name="distributeTopToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="1">
+            <widget class="QToolButton" name="distributeCenterVToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="2">
+            <widget class="QToolButton" name="distributeRightToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="2">
+            <widget class="QToolButton" name="distributeAcrossMarginsToolButton">
+             <property name="enabled">
+              <bool>true</bool>
+             </property>
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="0">
+            <widget class="QToolButton" name="distributeLeftToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="0">
+            <widget class="QToolButton" name="distributeAcrossPageToolButton">
+             <property name="enabled">
+              <bool>true</bool>
+             </property>
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="3" column="1">
+            <widget class="QToolButton" name="distributeDistValueHToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="3">
+            <widget class="QToolButton" name="distributeDownMarginsToolButton">
+             <property name="enabled">
+              <bool>true</bool>
+             </property>
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="0" column="1">
+            <widget class="QToolButton" name="distributeCenterHToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="1">
+            <widget class="QToolButton" name="distributeDownPageToolButton">
+             <property name="enabled">
+              <bool>true</bool>
+             </property>
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="3" column="2">
+            <widget class="QToolButton" name="distributeDistValueVToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="3">
+            <widget class="QToolButton" name="distributeDistVToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="0">
+            <widget class="QToolButton" name="distributeBottomToolButton">
+             <property name="minimumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>24</width>
+               <height>24</height>
+              </size>
+             </property>
+             <property name="iconSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>62</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="_8">
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="_9">
+           <property name="spacing">
+            <number>3</number>
+           </property>
+           <item>
+            <widget class="QLabel" name="distributeDistLabel">
+             <property name="text">
+              <string>&amp;Distance:</string>
+             </property>
+             <property name="wordWrap">
+              <bool>false</bool>
+             </property>
+             <property name="indent">
+              <number>-1</number>
+             </property>
+             <property name="buddy">
+              <cstring>distributeDistSpinBox</cstring>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="ScrSpinBox" name="distributeDistSpinBox">
+             <property name="minimumSize">
+              <size>
+               <width>50</width>
+               <height>24</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_2">
+         <property name="spacing">
+          <number>3</number>
+         </property>
+         <item>
+          <spacer name="spacer">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QCheckBox" name="reverseDistributionCheckBox">
+           <property name="text">
+            <string>Reverse Distribution</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="spacer_2">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType">
+            <enum>QSizePolicy::Expanding</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer>
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Expanding</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tabSwap">
+      <attribute name="title">
+       <string>Swap</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <property name="spacing">
+        <number>3</number>
+       </property>
+       <property name="leftMargin">
+        <number>6</number>
+       </property>
+       <property name="topMargin">
+        <number>6</number>
+       </property>
+       <property name="rightMargin">
+        <number>6</number>
+       </property>
+       <property name="bottomMargin">
+        <number>6</number>
+       </property>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout">
+         <property name="spacing">
+          <number>3</number>
+         </property>
+         <item>
+          <spacer name="horizontalSpacer">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QToolButton" name="swapLeftToolButton">
+           <property name="minimumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="iconSize">
+            <size>
+             <width>22</width>
+             <height>22</height>
+            </size>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QToolButton" name="swapRightToolButton">
+           <property name="minimumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="iconSize">
+            <size>
+             <width>22</width>
+             <height>22</height>
+            </size>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_2">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer name="verticalSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>0</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
  </widget>
  <customwidgets>
   <customwidget>
@@ -1063,12 +1061,6 @@
    <extends>QDoubleSpinBox</extends>
    <header>ui/scrspinbox.h</header>
   </customwidget>
-  <customwidget>
-   <class>ScDockPalette</class>
-   <extends>QDockWidget</extends>
-   <header>ui/scdockpalette.h</header>
-   <container>1</container>
-  </customwidget>
  </customwidgets>
  <tabstops>
   <tabstop>alignRelativeToCombo</tabstop>
@@ -1106,7 +1098,6 @@
  </tabstops>
  <includes>
   <include location="local">ui/scrspinbox.h</include>
-  <include location="local">ui/scdockpalette.h</include>
  </includes>
  <resources/>
  <connections/>
Index: scribus/ui/bookmarkpalette.cpp
===================================================================
--- scribus/ui/bookmarkpalette.cpp	(Revision 25546)
+++ scribus/ui/bookmarkpalette.cpp	(Arbeitskopie)
@@ -25,7 +25,7 @@
 
 #include "bookmarkpalette.h"
 
-BookPalette::BookPalette(QWidget* parent) : ScDockPalette( parent, "Books" )
+BookPalette::BookPalette(QWidget* parent) : DockPanelBase( "Books", parent )
 {
 	setObjectName(QString::fromLocal8Bit("Books"));
 	setContentsMargins(3, 3, 3, 3);
@@ -41,7 +41,7 @@
 	if (e->type() == QEvent::LanguageChange)
 		languageChange();
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void BookPalette::languageChange()
Index: scribus/ui/bookmarkpalette.h
===================================================================
--- scribus/ui/bookmarkpalette.h	(Revision 25546)
+++ scribus/ui/bookmarkpalette.h	(Arbeitskopie)
@@ -29,7 +29,8 @@
 class QEvent;
 
 #include "scribusapi.h"
-#include "scdockpalette.h"
+//#include "scdockpalette.h"
+#include "ui/docks/dock_panelbase.h"
 #include "bookmwin.h"
 /**
   *@author Franz Schmid
@@ -36,7 +37,7 @@
   */
 
 /*! \brief A Bookmark Palette */
-class SCRIBUS_API BookPalette : public ScDockPalette
+class SCRIBUS_API BookPalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/contentpalette.cpp
===================================================================
--- scribus/ui/contentpalette.cpp	(Revision 25546)
+++ scribus/ui/contentpalette.cpp	(Arbeitskopie)
@@ -25,8 +25,8 @@
 #include "styles/paragraphstyle.h"
 #include "styles/charstyle.h"
 
-ContentPalette::ContentPalette(QWidget* parent) :
-	ScDockPalette(parent, "ContentPalette", Qt::WindowFlags())
+ContentPalette::ContentPalette(QWidget *parent) :
+	DockPanelBase("ContentPalette", parent)
 {
 	setObjectName(QString::fromLocal8Bit("ContentPalette"));
 
@@ -276,7 +276,7 @@
 		updatePanelTitle();
 	}
 	updateGeometry();
-	ScDockPalette::update();
+	DockPanelBase::update();
 }
 
 void ContentPalette::unitChange()
@@ -320,7 +320,7 @@
 		languageChange();
 		return;
 	}
-	ScDockPalette::changeEvent(e);
+	DockPanelBase::changeEvent(e);
 }
 
 void ContentPalette::updatePanelTitle()
Index: scribus/ui/contentpalette.h
===================================================================
--- scribus/ui/contentpalette.h	(Revision 25546)
+++ scribus/ui/contentpalette.h	(Arbeitskopie)
@@ -9,6 +9,7 @@
 
 #include "scribusapi.h"
 #include "scdockpalette.h"
+#include "docks/dock_panelbase.h"
 #include "scguardedptr.h"
 
 class QStackedWidget;
@@ -28,7 +29,7 @@
 class ParagraphStyle;
 class CharStyle;
 
-class SCRIBUS_API ContentPalette : public ScDockPalette
+class SCRIBUS_API ContentPalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/docks/dock_centralwidget.cpp
===================================================================
--- scribus/ui/docks/dock_centralwidget.cpp	(nicht existent)
+++ scribus/ui/docks/dock_centralwidget.cpp	(Arbeitskopie)
@@ -0,0 +1,29 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+#include "dock_centralwidget.h"
+
+DockCentralWidget::DockCentralWidget(QWidget *parent) : ads::CDockWidget(QString(), parent)
+{
+
+	setObjectName(QString::fromLocal8Bit("DockCentralWidget"));
+
+    setFeature(ads::CDockWidget::NoTab, true);
+    setFeature(ads::CDockWidget::DockWidgetFloatable, false);
+}
+
Index: scribus/ui/docks/dock_centralwidget.h
===================================================================
--- scribus/ui/docks/dock_centralwidget.h	(nicht existent)
+++ scribus/ui/docks/dock_centralwidget.h	(Arbeitskopie)
@@ -0,0 +1,35 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+
+#ifndef DOCK_CENTRALWIDGET_H
+#define DOCK_CENTRALWIDGET_H
+
+#include "third_party/Qt-Advanced-Docking-System/src/DockWidget.h"
+
+class DockCentralWidget : public ads::CDockWidget
+{
+    Q_OBJECT
+
+public:
+    explicit DockCentralWidget(QWidget *parent = nullptr);
+
+
+};
+
+#endif // DOCK_CENTRALWIDGET_H
Index: scribus/ui/docks/dock_panelbase.cpp
===================================================================
--- scribus/ui/docks/dock_panelbase.cpp	(nicht existent)
+++ scribus/ui/docks/dock_panelbase.cpp	(Arbeitskopie)
@@ -0,0 +1,92 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+
+#include "dock_panelbase.h"
+
+#include <QApplication>
+
+#include "iconmanager.h"
+#include "prefscontext.h"
+#include "prefsfile.h"
+#include "prefsmanager.h"
+
+DockPanelBase::DockPanelBase(const QString &title, QIcon icon, QWidget *parent)  : DockPanelBase(title, parent)
+{
+	this->setIcon(icon);
+}
+
+
+DockPanelBase::DockPanelBase(const QString &title, QWidget *parent) : CDockWidget(title, parent)
+{
+	if (PrefsManager::instance().appPrefs.uiPrefs.useSmallWidgets)
+	{
+		setStyleSheet("	QToolButton { margin: 1px; padding: 0px; font-size: 10px; } \
+						QToolButton:pressed { padding-top: 2px; padding-left: 2px } \
+						QPushButton { margin: 1px; padding: 0px; font-size: 10px; } \
+						QPushButton:pressed { padding-top: 2px; padding-left: 2px } \
+						QRadioButton, QComboBox, QLineEdit \
+							QListView, QLabel { margin:1px; padding: 0px; font-size: 10px; } \
+						QCheckBox, QSpinBox, QDoubleSpinBox \
+							{ margin:1px; padding: 0px; font-size: 10px; } \
+						QTabWidget, QTabBar, QTableView, QGroupBox, QTreeView \
+							{ font-size: 10px ; } \
+						QToolBox::tab { font-size: 10px; padding: 0px; margin: 0px; } \
+					");
+	}
+	m_originalParent = parent;
+//	setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+	setWindowIcon(IconManager::instance().loadPixmap("AppIcon.png"));
+	setPrefsContext(title);
+	setObjectName(title);
+	connect(&PrefsManager::instance(), SIGNAL(prefsChanged()), this, SLOT(setFontSize()));
+}
+
+void DockPanelBase::setWidget(QWidget *widget)
+{
+    ads::CDockWidget::setWidget(widget);
+
+}
+
+void DockPanelBase::setPrefsContext(const QString& context)
+{
+	if (m_prefsContextName.isEmpty())
+	{
+		m_prefsContextName=context;
+		if (!m_prefsContextName.isEmpty())
+		{
+			m_palettePrefs = PrefsManager::instance().prefsFile->getContext(m_prefsContextName);
+		}
+		else
+			m_palettePrefs = nullptr;
+	}
+}
+
+void DockPanelBase::startup()
+{
+	setFontSize();
+}
+
+void DockPanelBase::setFontSize()
+{
+	QFont newfont(font());
+	newfont.setPointSize(PrefsManager::instance().appPrefs.uiPrefs.paletteFontSize);
+	setFont(newfont);
+}
+
+
Index: scribus/ui/docks/dock_panelbase.h
===================================================================
--- scribus/ui/docks/dock_panelbase.h	(nicht existent)
+++ scribus/ui/docks/dock_panelbase.h	(Arbeitskopie)
@@ -0,0 +1,54 @@
+/***************************************************************************
+ *   Copyright (C) 2023 by Martin Reininger                                *
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+
+#ifndef DOCK_PANELBASE_H
+#define DOCK_PANELBASE_H
+
+#include "third_party/Qt-Advanced-Docking-System/src/DockWidget.h"
+#include "scribusapi.h"
+using namespace ads;
+
+class PrefsContext;
+
+class SCRIBUS_API DockPanelBase : public CDockWidget
+{
+	Q_OBJECT
+
+public:
+    DockPanelBase(const QString &title, QWidget *parent = 0);
+    DockPanelBase(const QString &title, QIcon icon, QWidget *parent = 0);
+
+    void setWidget(QWidget *widget);
+	void startup();
+
+public slots:
+	virtual void setFontSize();
+
+protected:
+	/** @brief Set the Preferences context to be used for storage of startup visibility and position and size */
+	virtual void setPrefsContext(const QString& context);
+
+	PrefsContext* m_palettePrefs {nullptr};
+	QString m_prefsContextName;
+	QWidget* m_originalParent {nullptr};
+	QWidget* m_tempParent {nullptr};
+
+};
+
+#endif // DOCK_PANELBASE_H
Index: scribus/ui/inlinepalette.cpp
===================================================================
--- scribus/ui/inlinepalette.cpp	(Revision 25546)
+++ scribus/ui/inlinepalette.cpp	(Arbeitskopie)
@@ -101,7 +101,7 @@
 	clearSelection();
 }
 
-InlinePalette::InlinePalette( QWidget* parent) : ScDockPalette(parent, "Inline", Qt::WindowFlags())
+InlinePalette::InlinePalette( QWidget* parent) : DockPanelBase("Inline", parent)
 {
 	setContentsMargins(3, 3, 3, 3);
 	setMinimumSize( QSize( 220, 240 ) );
@@ -282,7 +282,7 @@
 		languageChange();
 	}
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void InlinePalette::languageChange()
Index: scribus/ui/inlinepalette.h
===================================================================
--- scribus/ui/inlinepalette.h	(Revision 25546)
+++ scribus/ui/inlinepalette.h	(Arbeitskopie)
@@ -43,7 +43,7 @@
 
 
 #include "scribusapi.h"
-#include "scdockpalette.h"
+#include "ui/docks/dock_panelbase.h"
 #include "sclistwidgetdelegate.h"
 
 class SCRIBUS_API InlineView : public QListWidget
@@ -67,7 +67,7 @@
 	ScListWidgetDelegate* delegate { nullptr };
 };
 
-class SCRIBUS_API InlinePalette : public ScDockPalette
+class SCRIBUS_API InlinePalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/layers.cpp
===================================================================
--- scribus/ui/layers.cpp	(Revision 25546)
+++ scribus/ui/layers.cpp	(Arbeitskopie)
@@ -39,9 +39,10 @@
 #include "scribusdoc.h"
 #include "selection.h"
 #include "ui/scrspinbox.h"
+#include "docks/dock_panelbase.h"
 #include "undomanager.h"
 
-LayerPalette::LayerPalette(QWidget* parent) : ScDockPalette(parent, "Layers", Qt::WindowFlags())
+LayerPalette::LayerPalette(QWidget* parent) : DockPanelBase("Layers", parent)
 {
 	setObjectName(QString::fromLocal8Bit("Layers"));
 	setMinimumSize( QSize(220, 240) );
@@ -172,7 +173,7 @@
 
 void LayerPalette::installEventFilter(QObject *obj)
 {
-	ScDockPalette::installEventFilter(obj);
+	DockPanelBase::installEventFilter(obj);
 	Table->installEventFilter(obj);
 }
 
@@ -686,7 +689,7 @@
 	if (e->type() == QEvent::LanguageChange)
 		languageChange();
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void LayerPalette::iconSetChange()
Index: scribus/ui/layers.h
===================================================================
--- scribus/ui/layers.h	(Revision 25546)
+++ scribus/ui/layers.h	(Arbeitskopie)
@@ -10,7 +10,8 @@
 #include <QList>
 
 #include "scribusapi.h"
-#include "ui/scdockpalette.h"
+//#include "ui/scdockpalette.h"
+#include "ui/docks/dock_panelbase.h"
 #include "scribusstructs.h"
 
 class CheckBox;
@@ -27,7 +28,7 @@
 class ScrSpinBox;
 class ScribusDoc;
 
-class SCRIBUS_API LayerPalette : public ScDockPalette
+class SCRIBUS_API LayerPalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/outlinepalette.cpp
===================================================================
--- scribus/ui/outlinepalette.cpp	(Revision 25546)
+++ scribus/ui/outlinepalette.cpp	(Arbeitskopie)
@@ -431,7 +431,7 @@
 	return true;
 }
 
-OutlinePalette::OutlinePalette( QWidget* parent) : ScDockPalette(parent, "Tree", Qt::WindowFlags())
+OutlinePalette::OutlinePalette( QWidget* parent) : DockPanelBase("Tree", parent)
 {
 //	resize( 220, 240 );
 	setMinimumSize( QSize( 220, 240 ) );
@@ -506,9 +506,9 @@
 	clearPalette();
 }
 
-void OutlinePalette::setPaletteShown(bool visible)
+void OutlinePalette::toggleView(bool visible)
 {
-	ScDockPalette::setPaletteShown(visible);
+	DockPanelBase::toggleView(visible);
 	if (visible && (currDoc != nullptr))
 		BuildTree();
 }
@@ -1445,7 +1445,7 @@
 	if (e->type() == QEvent::LanguageChange)
 		languageChange();
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void OutlinePalette::iconSetChange()
Index: scribus/ui/outlinepalette.h
===================================================================
--- scribus/ui/outlinepalette.h	(Revision 25546)
+++ scribus/ui/outlinepalette.h	(Arbeitskopie)
@@ -18,6 +18,7 @@
 
 #include "scribusapi.h"
 #include "scdockpalette.h"
+#include "docks/dock_panelbase.h"
 
 class ScribusMainWindow;
 class ScribusDoc;
@@ -54,7 +55,7 @@
 	bool viewportEvent(QEvent *event) override;
 };
 
-class SCRIBUS_API OutlinePalette : public ScDockPalette
+class SCRIBUS_API OutlinePalette : public DockPanelBase
 {
 	Q_OBJECT
 
@@ -76,7 +77,7 @@
 	void iconSetChange();
 	void languageChange();
 	void slotShowSelect(int pageNr, PageItem *pageItem);
-	void setPaletteShown(bool) override;
+	void toggleView(bool);
 	void slotRightClick(QPoint point);
 	void setActiveLayer(int layerID);
 	void setLayerVisible(int layerID);
Index: scribus/ui/pagepalette.cpp
===================================================================
--- scribus/ui/pagepalette.cpp	(Revision 25546)
+++ scribus/ui/pagepalette.cpp	(Arbeitskopie)
@@ -21,9 +21,9 @@
 #include "scribusdoc.h"
 #include "scribusview.h"
 
-PagePalette::PagePalette(QWidget* parent) : ScDockPalette(parent, "PagePalette", Qt::WindowFlags())
+PagePalette::PagePalette(QWidget *parent) : DockPanelBase("PagePalette", parent)
 {
-	m_scMW = (ScribusMainWindow*) parent;
+	m_scMW = nullptr;//(ScribusMainWindow*) parent;
 	m_view = nullptr;
 
 	setObjectName(QString::fromLocal8Bit("PagePalette"));
@@ -31,16 +31,13 @@
 	QStackedWidget* stackedWidget = new QStackedWidget(this);
 	stackedWidget->setObjectName(QString::fromLocal8Bit("stackedWidget"));
 
-	PagePalette_Pages* pageWidget = new PagePalette_Pages(stackedWidget);
-	pageWidget->setObjectName(QString::fromLocal8Bit("PagePalette_Pages"));
-	stackedWidget->addWidget(pageWidget);
+	m_pageWidget = new PagePalette_Pages(stackedWidget);
+	m_pageWidget->setObjectName(QString::fromLocal8Bit("PagePalette_Pages"));
+	stackedWidget->addWidget(m_pageWidget);
 
 	setWidget(stackedWidget);
 
-	connect(pageWidget, SIGNAL(gotoMasterPage(QString)), m_scMW, SLOT(editMasterPagesStart(QString)));
-	
-	rebuild();
-	languageChange();
+
 }
 
 QWidget* PagePalette::currentWidget()
@@ -65,6 +62,16 @@
 	return nullptr;
 }
 
+void PagePalette::setMainWindow(ScribusMainWindow *scMW)
+{
+	m_scMW = scMW;
+
+	connect(m_pageWidget, SIGNAL(gotoMasterPage(QString)), m_scMW, SLOT(editMasterPagesStart(QString)));
+
+	rebuild();
+	languageChange();
+}
+
 QStackedWidget* PagePalette::stackedWidget() const
 {
 	QStackedWidget* sw = dynamic_cast<QStackedWidget*>(this->widget());
@@ -185,7 +200,7 @@
 	}
 	else
 	{
-		ScribusDoc* doc = m_view->m_doc;
+		//ScribusDoc* doc = m_view->m_doc;
 		PagePalette_MasterPages* mpWidget = this->masterpageWidget();
 		if (mpWidget->m_view != m_view)
 			mpWidget->setView(m_view, masterPage);
@@ -226,7 +241,7 @@
 		return;
 	}
 
-	ScDockPalette::changeEvent(e);
+	DockPanelBase::changeEvent(e);
 }
 
 void PagePalette::languageChange()
Index: scribus/ui/pagepalette.h
===================================================================
--- scribus/ui/pagepalette.h	(Revision 25546)
+++ scribus/ui/pagepalette.h	(Arbeitskopie)
@@ -23,19 +23,21 @@
 class TrashBin;
 
 #include "scribusapi.h"
-#include "scdockpalette.h"
+//#include "scdockpalette.h"
+#include "docks/dock_panelbase.h"
 
 class PagePalette_MasterPages;
 class PagePalette_Pages;
 class ScribusView;
 class ScribusMainWindow;
+class DockManager;
 
-class SCRIBUS_API PagePalette : public ScDockPalette
+class SCRIBUS_API PagePalette : public DockPanelBase
 {
 	Q_OBJECT
 
 public:
-	PagePalette(QWidget* parent);
+	PagePalette(QWidget *parent);
 	~PagePalette() {};
 	
 	QWidget* currentWidget();
@@ -44,9 +46,12 @@
 	PagePalette_MasterPages* masterpageWidget() const;
 	PagePalette_Pages* pageWidget() const;
 
+	void setMainWindow(ScribusMainWindow * scMW);
+
 protected:
 	ScribusView       *m_view;
 	ScribusMainWindow *m_scMW;
+	PagePalette_Pages* m_pageWidget {nullptr};
 
 	void changeEvent(QEvent *e) override;
 
Index: scribus/ui/propertiespalette.cpp
===================================================================
--- scribus/ui/propertiespalette.cpp	(Revision 25546)
+++ scribus/ui/propertiespalette.cpp	(Arbeitskopie)
@@ -46,7 +46,7 @@
 #include "util_math.h"
 
 
-PropertiesPalette::PropertiesPalette( QWidget* parent) : ScDockPalette(parent, "PropertiesPalette", Qt::WindowFlags())
+PropertiesPalette::PropertiesPalette(QWidget *parent) : DockPanelBase("PropertiesPalette", parent)
 {
 	undoManager = UndoManager::instance();
 
@@ -109,7 +109,7 @@
 			m_ScMW->view->RefreshGradient(m_item);
 		}
 	}
-	ScDockPalette::closeEvent(closeEvent);
+	DockPanelBase::closeEvent(closeEvent);
 }
 
 void PropertiesPalette::setMainWindow(ScribusMainWindow* mw)
@@ -735,7 +737,7 @@
 		languageChange();
 		return;
 	}
-	ScDockPalette::changeEvent(e);
+	DockPanelBase::changeEvent(e);
 }
 
 void PropertiesPalette::languageChange()
Index: scribus/ui/propertiespalette.h
===================================================================
--- scribus/ui/propertiespalette.h	(Revision 25546)
+++ scribus/ui/propertiespalette.h	(Arbeitskopie)
@@ -30,6 +30,7 @@
 #include "sctreewidget.h"
 #include "stylecombos.h"
 #include "units.h"
+#include "docks/dock_panelbase.h"
 
 class ColorCombo;
 class ColorPalette;
@@ -46,7 +47,7 @@
 class UndoManager;
 class TransparencyPalette;
 
-class SCRIBUS_API PropertiesPalette : public ScDockPalette
+class SCRIBUS_API PropertiesPalette : public DockPanelBase
 {
 	Q_OBJECT

Index: scribus/ui/propertiespalette_xyz.cpp
===================================================================
--- scribus/ui/propertiespalette_xyz.cpp	(Revision 25546)
+++ scribus/ui/propertiespalette_xyz.cpp	(Arbeitskopie)
@@ -1463,8 +1470,8 @@
 {
 	IconManager& im = IconManager::instance();
 
-	levelUp->setIcon(im.loadIcon("16/go-up.png"));
-	levelDown->setIcon(im.loadIcon("16/go-down.png"));
+	levelUp->setIcon(im.loadIcon("layer-move-up"));
+	levelDown->setIcon(im.loadIcon("layer-move-down"));
 	levelTop->setIcon(im.loadIcon("16/go-top.png"));
 	levelBottom->setIcon(im.loadIcon("16/go-bottom.png"));
 
Index: scribus/ui/scrapbookpalette.cpp
===================================================================
--- scribus/ui/scrapbookpalette.cpp	(Revision 25546)
+++ scribus/ui/scrapbookpalette.cpp	(Arbeitskopie)
@@ -715,7 +715,7 @@
 }
 
 /* This is the main Dialog-Class for the Scrapbook */
-Biblio::Biblio(QWidget* parent) : ScDockPalette(parent, "Sclib", Qt::WindowFlags())
+Biblio::Biblio(QWidget* parent) : DockPanelBase("Sclib", parent)
 {
 	setObjectName(QString::fromLocal8Bit("Sclib"));
 	setMinimumSize( QSize(220, 240) );
@@ -2003,7 +2003,7 @@
 	if (e->type() == QEvent::LanguageChange)
 		languageChange();
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void Biblio::iconSetChange()
Index: scribus/ui/scrapbookpalette.h
===================================================================
--- scribus/ui/scrapbookpalette.h	(Revision 25546)
+++ scribus/ui/scrapbookpalette.h	(Arbeitskopie)
@@ -15,8 +15,9 @@
 class QEvent;
 
 #include "scribusapi.h"
-#include "scdockpalette.h"
+//#include "scdockpalette.h"
 #include "scribusstructs.h"
+#include "ui/docks/dock_panelbase.h"
 
 class QHBoxLayout;
 class QToolButton;
@@ -67,7 +68,7 @@
 	void startDrag(Qt::DropActions supportedActions) override;
 };
 
-class SCRIBUS_API Biblio : public ScDockPalette
+class SCRIBUS_API Biblio : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/ui/symbolpalette.cpp
===================================================================
--- scribus/ui/symbolpalette.cpp	(Revision 25546)
+++ scribus/ui/symbolpalette.cpp	(Arbeitskopie)
@@ -150,7 +150,7 @@
 	clearSelection();
 }
 
-SymbolPalette::SymbolPalette( QWidget* parent) : ScDockPalette(parent, "Symb", Qt::WindowFlags())
+SymbolPalette::SymbolPalette( QWidget* parent) : DockPanelBase("Symb", parent)
 {
 	setContentsMargins(3, 3, 3, 3);
 	setMinimumSize( QSize( 220, 240 ) );
@@ -321,7 +321,7 @@
 		languageChange();
 	}
 	else
-		ScDockPalette::changeEvent(e);
+		DockPanelBase::changeEvent(e);
 }
 
 void SymbolPalette::languageChange()
Index: scribus/ui/symbolpalette.h
===================================================================
--- scribus/ui/symbolpalette.h	(Revision 25546)
+++ scribus/ui/symbolpalette.h	(Arbeitskopie)
@@ -41,8 +41,9 @@
 
 
 #include "scribusapi.h"
-#include "scdockpalette.h"
+//#include "scdockpalette.h"
 #include "sclistwidgetdelegate.h"
+#include "ui/docks/dock_panelbase.h"
 
 class SCRIBUS_API SymbolView : public QListWidget
 {
@@ -70,7 +71,7 @@
 	ScListWidgetDelegate* m_delegate { nullptr };
 };
 
-class SCRIBUS_API SymbolPalette : public ScDockPalette
+class SCRIBUS_API SymbolPalette : public DockPanelBase
 {
 	Q_OBJECT
 
Index: scribus/undogui.cpp
===================================================================
--- scribus/undogui.cpp	(Revision 25546)
+++ scribus/undogui.cpp	(Arbeitskopie)
@@ -38,7 +38,7 @@
 #include "undogui.h"
 
 
-UndoGui::UndoGui(QWidget* parent, const char* name, Qt::WindowFlags f) : ScDockPalette(parent, name, f)
+UndoGui::UndoGui(QWidget* parent, const char* name) : DockPanelBase(name, parent)
 {
 	languageChange();
 }
@@ -184,9 +184,9 @@
 
 /*** UndoPalette **************************************************************/
 
-UndoPalette::UndoPalette(QWidget* parent, const char* name) : UndoGui(parent, name)
+UndoPalette::UndoPalette(QWidget* parent) : UndoGui(parent, "undoPalette")
 {
-	setObjectName(QString::fromLocal8Bit(name));
+	setObjectName(QString::fromLocal8Bit("undoPalette"));
 	setMinimumSize( QSize(220, 240) );
 	setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
 
Index: scribus/undogui.h
===================================================================
--- scribus/undogui.h	(Revision 25546)
+++ scribus/undogui.h	(Arbeitskopie)
@@ -33,7 +33,8 @@
 #include "scribusapi.h"
 #include "undoobject.h"
 #include "undostate.h"
-#include "ui/scdockpalette.h"
+//#include "ui/scdockpalette.h"
+#include "ui/docks/dock_panelbase.h"
 
 class QEvent;
 class QMenu;
@@ -56,18 +57,18 @@
  * @author Riku Leino  tsoots@gmail.com
  * @date December 2004
  */
-class SCRIBUS_API UndoGui : public ScDockPalette
+class SCRIBUS_API UndoGui : public DockPanelBase
 {
 	Q_OBJECT
 
 public:
 	/**
-	 * @brief Creates a new UndoGui instance. 
+	 * @brief Creates a new UndoGui instance.
 	 * @param parent Parent object for UndoGui
 	 * @param name Name of the object
 	 * @param f widget flags
 	 */
-	UndoGui(QWidget* parent = nullptr, const char* name = "UndoGui", Qt::WindowFlags f = Qt::WindowFlags());
+	UndoGui(QWidget* parent = nullptr, const char* name = "UndoGui");
 
 	/** @brief Destroys the widget */
 	virtual ~UndoGui() {}
@@ -268,7 +269,7 @@
 	 * Creates a new UndoPalette instance. After creation of an UndoPalette it must
 	 * be registered to the UndoManager with UndoManager's registerGui() method.
 	 */
-	UndoPalette(QWidget* parent = nullptr, const char* name = 0);
+	UndoPalette(QWidget* parent = nullptr);
 
 	/** @brief Destroys the widget */
 	~UndoPalette() = default;
ads_2023-07-16_01.patch (201,122 bytes)   
action-chevron-down.svg (196 bytes)   
action-chevron-down.svg (196 bytes)   
action-chevron-up.svg (220 bytes)   
action-chevron-up.svg (220 bytes)   

cbradney

2023-07-16 21:36

administrator   ~0050275

Thanks Martin. Applies ok..

Are the ADS changes vs whats currently in SVN the changes native to ADS since the bump to their v4.04 or are they changes you introduced?

nitramr

2023-07-16 21:44

developer   ~0050276

The changes are native from original git repo. I think it based on this: commit. https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/commit/6e642ec423b1c44bc4f30a57c07cf492dcc08c79

cbradney

2023-07-17 22:01

administrator   ~0050277

Thats cool.. thanks. I hope we can keep the ADS directories in sync with upstream and not modify, if possible, so we can check them out and use all changes without conflicts. Cool

cbradney

2023-07-25 19:38

administrator   ~0050282

Committed in r25555

Issue History

Date Modified Username Field Change
2023-07-09 14:46 nitramr New Issue
2023-07-09 14:46 nitramr Status new => assigned
2023-07-09 14:46 nitramr Assigned To => nitramr
2023-07-09 14:46 nitramr File Added: Bildschirmfoto vom 2023-07-09 16-05-43.png
2023-07-09 16:09 nitramr Note Added: 0050271
2023-07-09 16:09 nitramr File Added: ads_23-07-09_01.patch
2023-07-09 21:19 cbradney Note Added: 0050272
2023-07-12 20:54 nitramr Note Added: 0050273
2023-07-12 20:54 nitramr File Added: ads_23-07-12_01.patch
2023-07-16 18:29 nitramr Note Added: 0050274
2023-07-16 18:29 nitramr File Added: ads_2023-07-16_01.patch
2023-07-16 18:29 nitramr File Added: action-chevron-down.svg
2023-07-16 18:29 nitramr File Added: action-chevron-up.svg
2023-07-16 21:36 cbradney Note Added: 0050275
2023-07-16 21:44 nitramr Note Added: 0050276
2023-07-17 22:01 cbradney Note Added: 0050277
2023-07-19 16:23 nitramr Description Updated
2023-07-24 17:16 nitramr Relationship added related to 0016898
2023-07-24 17:33 nitramr Relationship added related to 0016806
2023-07-25 19:37 cbradney Status assigned => resolved
2023-07-25 19:37 cbradney Resolution open => fixed
2023-07-25 19:37 cbradney Fixed in Version => 1.7.0.svn
2023-07-25 19:38 cbradney Note Added: 0050282
2023-09-11 20:34 cbradney Status resolved => closed