View Issue Details

IDProjectCategoryView StatusLast Update
0017432ScribusUser Interfacepublic2025-11-01 16:26
Reporterale Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version1.7.1.svn 
Summary0017432: Getting Qt-Advanced-Docking-System to work correctly with tiling window managers
Descriptionon my computer, with dwm, once a palette is made floating:

- it does not behave well
- the only way to dock it again is to remove the scribus settings.

i got to test scribus with sway in x11 mode and it's somehow ok, but also not really good.

one difference is that sway shows a title on top of the floating palette, dwm never add a title bar (but shows it when it's there, like in the older scribus palettes).

i have to do some further tests, but it seems that we need to find a way to add the title bar and to correctly the palette as floating.

my first tests with the ADS demo programs show the same issues as in scribus.
TagsNo tags attached.
PatchNo

Activities

nitramr

2025-10-31 20:45

developer   ~0053156

Last edited: 2025-10-31 20:46

I replaced the Qt-Advanced-Docking System with KDDockWidgets.

Steps
1. Download KDDockWidgets from https://github.com/KDAB/KDDockWidgets
2. Put the root folder into scribus -> third_party
3. Check if the root folders name is "KDDockWidgets"
4. Apply the fix below

If you want to test it under Wayland modify the main_nix.cpp in scribus folder

Remove the following code:
```
#if !defined(Q_OS_MACOS)
    qputenv("QT_QPA_PLATFORM", "xcb");
#endif

    if (QApplication::platformName() == "wayland")
    {
        QString errHdr = QObject::tr("Fatal Error");
        QString errMsg = QObject::tr("Scribus does not support the Wayland platform. Use XWayland to run Scribus on Wayland. Scribus will close now.");
        if (app.useGUI)
        {
            QMessageBox::critical(nullptr, errHdr, errMsg);
        }
        else
        {
            std::cout << errHdr.toStdString() << std::endl;
            std::cout << "-------------" << std::endl;
            std::cout << errMsg.toStdString() << std::endl;
        }
        return EXIT_FAILURE;
    }
```
kddock_2025-10-31_01.patch (47,965 bytes)   
Index: CMakeLists_Dependencies.cmake
===================================================================
--- CMakeLists_Dependencies.cmake	(Revision 27098)
+++ CMakeLists_Dependencies.cmake	(Arbeitskopie)
@@ -317,7 +317,3 @@
 	message("Harfbuzz subset library Found OK")
 	set (HAVE_HARFBUZZ_SUBSET ON)
 endif()
-
-#if(WANT_QTADS)
-  set(HAVE_QTADS ON)
-#endif()
Index: config.h.cmake
===================================================================
--- config.h.cmake	(Revision 27098)
+++ config.h.cmake	(Arbeitskopie)
@@ -14,7 +14,6 @@
 #cmakedefine BUILD_MAC_BUNDLE
 #cmakedefine DLL_USE_NATIVE_API 1
 #cmakedefine GMAGICK_FOUND 1
-#cmakedefine HAVE_QTADS 1
 #cmakedefine HAVE_BOOST 1
 #cmakedefine HAVE_CAIRO 1
 #cmakedefine HAVE_CUPS 1
Index: scribus/CMakeLists.txt
===================================================================
--- scribus/CMakeLists.txt	(Revision 27098)
+++ scribus/CMakeLists.txt	(Arbeitskopie)
@@ -59,11 +59,10 @@
 set_property(SOURCE third_party/fparser/file.hh PROPERTY SKIP_AUTOGEN ON)
 set_property(SOURCE third_party/fparser/fparser.hh PROPERTY SKIP_AUTOGEN ON)
 
-#if(WANT_QTADS)
-  MESSAGE(STATUS "Qt Advanced Docking System included")
-  link_directories(${CMAKE_CURRENT_BINARY_DIR}/third_party/Qt-Advanced-Docking-System)
-#endif()
 
+MESSAGE(STATUS "KDDock System included")
+link_directories(${CMAKE_CURRENT_BINARY_DIR}/third_party/KDDockWidgets)
+
 link_directories(
 	${CMAKE_CURRENT_BINARY_DIR}/third_party/wpg
 	${CMAKE_CURRENT_BINARY_DIR}/third_party/pgf
@@ -292,9 +291,7 @@
 	${SCRIBUS_RTF_LIB}
 )
 
-#if(WANT_QTADS)
-  target_link_libraries(${EXE_NAME} PUBLIC qt6advanceddocking)
-#endif()
+target_link_libraries(${EXE_NAME} PUBLIC KDAB::kddockwidgets)
 
 if(WITH_TESTS)
 	target_link_libraries(${EXE_NAME} PRIVATE
Index: scribus/manager/dock_manager.cpp
===================================================================
--- scribus/manager/dock_manager.cpp	(Revision 27098)
+++ scribus/manager/dock_manager.cpp	(Arbeitskopie)
@@ -26,12 +26,12 @@
 #include "dock_manager.h"
 
 #include <QMenu>
-#include "third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.h"
 #include "ui/docks/dock_centralwidget.h"
 
 #include "iconmanager.h"
 #include "prefsmanager.h"
 #include "scribusapp.h"
+#include "scribus.h"
 #include "ui/aligndistribute.h"
 #include "ui/bookmarkpalette.h"
 #include "ui/contentpalette.h"
@@ -44,7 +44,9 @@
 #include "ui/symbolpalette.h"
 #include "undogui.h"
 
+#include <kddockwidgets/LayoutSaver.h>
 
+
 /* ********************************************************************************* *
  *
  * Constructor + Setup
@@ -51,31 +53,29 @@
  *
  * ********************************************************************************* */
 
-DockManager::DockManager(QWidget *parent)
-	: CDockManager(parent)
+DockManager::DockManager(ScribusMainWindow *mainwindow)
+	: QObject(mainwindow)
 {
-	dockCenter = new DockCentralWidget();
-	auto *areaCenter = CDockManager::setCentralWidget(dockCenter);
-	areaCenter->setAllowedAreas(LeftDockWidgetArea | RightDockWidgetArea);
+	dockCenter = new DockCentralWidget();	
+	m_mainwindow = mainwindow;
+	m_mainwindow->setPersistentCentralWidget(dockCenter);
 
-	setStyleSheet(""); // reset style sheet to use custom icons
-
 	connect( ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange()) );
 }
 
 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);
+	pagePalette = new PagePalette();
+	contentPalette = new ContentPalette();
+	propertiesPalette = new PropertiesPalette();
+	outlinePalette = new OutlinePalette();
+	layerPalette = new LayerPalette();
+	inlinePalette = new InlinePalette();
 	alignDistributePalette = new AlignDistributePalette();
-	scrapbookPalette = new Biblio(this);
-	bookPalette = new BookPalette(this);
-	undoPalette = new UndoPalette(this);
-	symbolPalette = new SymbolPalette(this);
+	scrapbookPalette = new Biblio();
+	bookPalette = new BookPalette();
+	undoPalette = new UndoPalette();
+	symbolPalette = new SymbolPalette();
 
 	// Apply common configuration for each palette
 	configureDock(pagePalette);
@@ -111,38 +111,16 @@
 void DockManager::initWorkspaces()
 {
 	createDefaultWorkspace();
-//	restoreWorkspaceFromPrefs();
 }
 
-void DockManager::removeAllDockWidgets()
-{
-	QMap<QString, CDockWidget *> map = dockWidgetsMap();
-	foreach (QString key, map.keys())
-		removeDockWidget(map.value(key));
-}
 
-void DockManager::hideAllDocks()
-{
-	foreach (CDockWidget *dock, this->dockWidgets())
-	{
-		if(dock->isCentralWidget())
-			continue;
-		dock->closeDockWidget();
-	}
-
-	foreach (CFloatingDockContainer *dockContainer, this->floatingWidgets())
-	{
-		dockContainer->close();
-	}
-}
-
 void DockManager::toggleDocksVisibility()
 {
-	QString perspective = "_allpaletteshidden";
+	QString perspective = "e494294a-65b4-4ca5-a018-1fe741dbd1c3";
 
-	if(perspectiveNames().contains(perspective))
+	if(m_perspectives.contains(perspective))
 	{
-		openPerspective(perspective);
+		loadPerspective(perspective);
 		removePerspective(perspective);
 		m_dockTemporaryHidden = false;
 	}
@@ -149,11 +127,8 @@
 	else
 	{
 		addPerspective(perspective);
-		hideAllDocks();
+		emit hideAllDocks();
 		m_dockTemporaryHidden = true;
-
-//		qDebug() << Q_FUNC_INFO << this->dockWidgets();
-//		qDebug() << Q_FUNC_INFO << this->floatingWidgets();
 	}
 
 }
@@ -163,79 +138,57 @@
 	return m_dockTemporaryHidden;
 }
 
-CDockAreaWidget *DockManager::addDockFromPlugin(CDockWidget *dock, bool closed)
+DockPanelBase *DockManager::addDockFromPlugin(DockPanelBase *dock, bool closed)
 {
-	CDockAreaWidget *a = addDockWidget(RightDockWidgetArea, dock, dockCenter->dockAreaWidget());
-	dock->toggleView(!closed);	
-	updateIcon(dock);
 	configureDock(dock);
-	return a;
+
+	m_mainwindow->addDockWidget(dock, KDDockWidgets::Location_OnLeft);
+
+	if (closed)
+		dock->close();
+	else
+		dock->open();
+
+	return dock;
 }
 
 void DockManager::restoreWorkspaceFromPrefs()
 {
-	QByteArray ba = PrefsManager::instance().appPrefs.uiPrefs.adsDockState;
+	QByteArray ba = QByteArray::fromHex(PrefsManager::instance().appPrefs.uiPrefs.adsDockState);
 
 	if(ba.isEmpty())
 		return;
 
-	this->restoreState(ba);
+	KDDockWidgets::RestoreOptions options = KDDockWidgets::RestoreOption_None;
+
+	KDDockWidgets::LayoutSaver saver(options);
+	saver.restoreLayout(ba);
 }
 
 void DockManager::saveWorkspaceToPrefs()
 {
-	PrefsManager::instance().appPrefs.uiPrefs.adsDockState = this->saveState();
+	KDDockWidgets::LayoutSaver saver;
+	QByteArray data = saver.serializeLayout();
+
+	PrefsManager::instance().appPrefs.uiPrefs.adsDockState = data.toHex();
 }
 
 void DockManager::iconSetChange()
 {
-	// Update all icons of each docked CDockContainer
-	updateIcons(this->dockWidgets());
 
-	// Update all icons of each floating CFloatingDockContainer
-	foreach (CFloatingDockContainer *dockContainer, this->floatingWidgets())
-		updateIcons(dockContainer->dockWidgets());
 }
 
 void DockManager::restoreHiddenWorkspace()
 {
-	if (m_dockTemporaryHidden)
+	if (hasTemporaryHiddenDocks())
 		toggleDocksVisibility();
 }
 
-void DockManager::updateIcons(QList<CDockWidget *> dockWidgets)
+void DockManager::configureDock(DockPanelBase *dock)
 {
-	foreach (CDockWidget *dock, dockWidgets)
-		updateIcon(dock);
+	connect(this, &DockManager::hideAllDocks, dock, &DockPanelBase::close);
 }
 
-void DockManager::updateIcon(CDockWidget *dockWidget)
-{
-	IconManager &iconManager = IconManager::instance();
-
-	dockWidget->dockAreaWidget()->titleBarButton(ads::TitleBarButtonClose)->setIcon(iconManager.loadIcon("close", 12));
-	dockWidget->dockAreaWidget()->titleBarButton(ads::TitleBarButtonUndock)->setIcon(iconManager.loadIcon("dock-float", 16));
-	dockWidget->dockAreaWidget()->titleBarButton(ads::TitleBarButtonTabsMenu)->setIcon(iconManager.loadIcon("menu-down", 16));
-	dockWidget->dockAreaWidget()->titleBarButton(ads::TitleBarButtonAutoHide)->setIcon(iconManager.loadIcon("dock-auto-hide", 16));
-	dockWidget->dockAreaWidget()->titleBarButton(ads::TitleBarButtonMinimize)->setIcon(iconManager.loadIcon("dock-minimize", 16));
-
-	for (auto tabCloseButton : dockWidget->dockAreaWidget()->findChildren<QAbstractButton*>("tabCloseButton"))
-		tabCloseButton->setIcon(iconManager.loadIcon("close", 12));
-}
-
-void DockManager::configureDock(CDockWidget *dock)
-{
-	/*
-	* MinimumSizeHintFromContent
-	* MinimumSizeHintFromDockWidgetMinimumSize
-	* MinimumSizeHintFromContentMinimumSize
-	*/
-
-	dock->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidgetMinimumSize);
-	dock->setMinimumWidth(dock->widget()->minimumSizeHint().width());
-	connect( dock, &CDockWidget::viewToggled, this, &DockManager::restoreHiddenWorkspace);
-}
-
 void DockManager::createDefaultWorkspace()
 {
 	/************************************************************
@@ -257,56 +210,75 @@
 	 *
 	 *************************************************************/
 
-	auto *areaCenter = dockCenter->dockAreaWidget();
+	const QSize m_preferredSize(QSize(290, 0));
+	KDDockWidgets::InitialOption hiddenPalette(KDDockWidgets::InitialVisibilityOption::StartHidden, m_preferredSize);
+	KDDockWidgets::InitialOption visiblePalette(KDDockWidgets::InitialVisibilityOption::StartVisible, m_preferredSize);
+	KDDockWidgets::InitialOption passivePalette(KDDockWidgets::InitialVisibilityOption::PreserveCurrentTab, m_preferredSize);
 
 	// Left
-	auto *areaLeft = addDockWidget(LeftDockWidgetArea, pagePalette, areaCenter);
-	addDockWidgetTabToArea(outlinePalette, areaLeft);
+	m_mainwindow->addDockWidget(pagePalette, KDDockWidgets::Location_OnLeft, nullptr, visiblePalette);
+	pagePalette->addDockWidgetAsTab(outlinePalette, hiddenPalette);
 
-	// Left	Center
-	auto *areaCenterLeft = addDockWidget(LeftDockWidgetArea, inlinePalette, areaCenter);
-	addDockWidgetTabToArea(scrapbookPalette, areaCenterLeft);
-	addDockWidgetTabToArea(bookPalette, areaCenterLeft);
-	addDockWidgetTabToArea(symbolPalette, areaCenterLeft);
+	// Left Center
+	// Workaround: inline palette acts as a main container for the other palettes, we have to show it so that it is docked.
+	m_mainwindow->addDockWidget(inlinePalette, KDDockWidgets::Location_OnRight, pagePalette, visiblePalette);
+	inlinePalette->addDockWidgetAsTab(scrapbookPalette, hiddenPalette);
+	inlinePalette->addDockWidgetAsTab(bookPalette, hiddenPalette);
+	inlinePalette->addDockWidgetAsTab(symbolPalette, hiddenPalette);
 
 	// Left Bottom
-	auto *areaLeftBottom = addDockWidget(BottomDockWidgetArea, layerPalette, areaLeft);
-	addDockWidgetTabToArea(alignDistributePalette, areaLeftBottom);
-	addDockWidgetTabToArea(undoPalette, areaLeftBottom);
+	m_mainwindow->addDockWidget(alignDistributePalette, KDDockWidgets::Location_OnBottom, pagePalette, visiblePalette);
+	alignDistributePalette->addDockWidgetAsTab(layerPalette, hiddenPalette);
+	alignDistributePalette->addDockWidgetAsTab(undoPalette, hiddenPalette);
 
-	// Right Panel
-	auto *areaRight = addDockWidget(RightDockWidgetArea, propertiesPalette, areaCenter);
-	addDockWidget(CenterDockWidgetArea, contentPalette, areaRight);
+	// Right
+	m_mainwindow->addDockWidget(propertiesPalette, KDDockWidgets::Location_OnRight, nullptr, visiblePalette);
+	propertiesPalette->addDockWidgetAsTab(contentPalette, passivePalette);
 
-	// Top Panel
-	//    auto * areaTop = addDockWidget(TopDockWidgetArea, dockToolProperties);
-	//    areaTop->setAllowedAreas(NoDockWidgetArea);
-	//    areaTop->setDockAreaFlag(CDockAreaWidget::HideSingleWidgetTitleBar, true);
+	// Workaround: we have to hide inline palette manually.
+	inlinePalette->close();
 
-	// Resizing area height of left and bottom-left
-	int heightL = areaLeft->height();
-	setSplitterSizes(areaLeft, {heightL * 3 / 4, heightL * 1 / 4});
+	// Set active palettes
+	// alignDistributePalette->setAsCurrentTab();
+	// pagePalette->setAsCurrentTab();
+	// propertiesPalette->setAsCurrentTab();
 
-	// Resizing area width of left, center-left, center and right
-	int widthCL = areaCenter->width();
-	int panelWidth = 290;
-	setSplitterSizes(areaCenter, {panelWidth, panelWidth, widthCL - 3 * panelWidth, panelWidth});
+	// Save Scribus Default
+	addPerspective("Default");
 
+	restoreWorkspaceFromPrefs();
 
-	// hide panels that are not visible in default workspace
-	inlinePalette->closeDockWidget();
-	scrapbookPalette->closeDockWidget();
-	bookPalette->closeDockWidget();
-	symbolPalette->closeDockWidget();
-	layerPalette->closeDockWidget();
-	undoPalette->closeDockWidget();
-	outlinePalette->closeDockWidget();
+	// Save Users Preference
+	addPerspective("Current");
 
-	// 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");
+
+void DockManager::addPerspective(const QString name)
+{
+	if (m_perspectives.contains(name))
+			return;
+
+	KDDockWidgets::LayoutSaver saver;
+	m_perspectives.insert(name, saver.serializeLayout());
 }
+
+void DockManager::removePerspective(const QString name)
+{
+	if (m_perspectives.contains(name))
+		m_perspectives.remove(name);
+}
+
+void DockManager::loadPerspective(const QString name)
+{
+	KDDockWidgets::LayoutSaver saver;
+	saver.restoreLayout(perspectiveByName(name));
+}
+
+QByteArray DockManager::perspectiveByName(const QString name)
+{
+	if (!m_perspectives.contains(name))
+		return QByteArray();
+
+	return m_perspectives.value(name);
+}
Index: scribus/manager/dock_manager.h
===================================================================
--- scribus/manager/dock_manager.h	(Revision 27098)
+++ scribus/manager/dock_manager.h	(Arbeitskopie)
@@ -28,10 +28,9 @@
 
 #include "prefscontext.h"
 #include "scribusapi.h"
-#include "third_party/Qt-Advanced-Docking-System/src/DockManager.h"
+#include "ui/docks/dock_panelbase.h"
+#include <kddockwidgets/DockWidget.h>
 
-using namespace ads;
-
 class ScribusMainWindow;
 class PagePalette;
 class OutlinePalette;
@@ -46,36 +45,36 @@
 class SymbolPalette;
 class DockCentralWidget;
 
-class SCRIBUS_API DockManager : public CDockManager
+class SCRIBUS_API DockManager : public QObject
 {
 	Q_OBJECT
 
 public:
-	DockManager(QWidget *parent);
+	DockManager(ScribusMainWindow *mainwindow);
 
 	void setCentralWidget(QWidget *widget);
 	void setupDocks();
+
 	/**
 	 * @brief Creates all preconfigured workspaces as perspectives.
 	 */
 	void initWorkspaces();
+
 	/**
-	 * @brief Removes all dock widgets including docks added by plugins.
-	 */
-	void removeAllDockWidgets();
-	/**
-	 * @brief Hides all docked and floating dock containers.
-	 */
-	void hideAllDocks();
-	/**
 	 * @brief Toggles the temporary visibility of all docks.
 	 */
 	void toggleDocksVisibility();
+
+	void addPerspective(const QString name);
+	void removePerspective(const QString name);
+	void loadPerspective(const QString name);
+
 	/**
 	 * @brief Returns true if all docks are temporary hidden.
 	 * @return
 	 */
 	bool hasTemporaryHiddenDocks();
+
 	/**
 	 * @brief Adds a dock widget to dock manager. Useful for docks that are not initialized by dock manager, e.g. from plugins.
 	 * @param dock
@@ -82,7 +81,8 @@
 	 * @param closed
 	 * @return
 	 */
-	CDockAreaWidget *addDockFromPlugin(CDockWidget *dock, bool closed = true);
+	DockPanelBase *addDockFromPlugin(DockPanelBase *dock, bool closed = true);
+	QByteArray perspectiveByName(const QString name);
 
 	PagePalette *pagePalette {nullptr};
 	OutlinePalette *outlinePalette {nullptr};
@@ -114,23 +114,20 @@
 
 protected:
 	DockCentralWidget *dockCenter {nullptr};
+	ScribusMainWindow * m_mainwindow {nullptr};
 	bool m_dockTemporaryHidden {false};
-	QMap<CDockWidget *, bool> m_temporaryHiddenDocks;
+	QMap<QString, QByteArray> m_perspectives;
 
-	/**
-	 * @brief Refreshes all icons of a dock. Needed for icon set or GUI changes.
-	 * @param dockWidgets
-	 */
-	void updateIcons(QList<CDockWidget *> dockWidgets);
-	void updateIcon(CDockWidget * dockWidget);
+	void configureDock(DockPanelBase *dock);
 
-	void configureDock(CDockWidget *dock);
-
 	/**
 	 * @brief Creates a default workspace as perspective.
 	 */
 	void createDefaultWorkspace();
 
+signals:
+	void hideAllDocks();
+
 };
 
 #endif // DOCK_MANAGER_H
Index: scribus/plugins/shapes/shapepalette.cpp
===================================================================
--- scribus/plugins/shapes/shapepalette.cpp	(Revision 27098)
+++ scribus/plugins/shapes/shapepalette.cpp	(Arbeitskopie)
@@ -32,7 +32,6 @@
 #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"
@@ -280,7 +279,7 @@
 	}
 }
 
-ShapePalette::ShapePalette(QWidget *parent) : DockPanelBase("Shap", "panel-custom-shapes", parent)
+ShapePalette::ShapePalette() : DockPanelBase("Shap", "panel-custom-shapes")
 {
 	setMinimumSize( QSize( 220, 240 ) );
 	setObjectName(QString::fromLocal8Bit("Shap"));
Index: scribus/plugins/shapes/shapepalette.h
===================================================================
--- scribus/plugins/shapes/shapepalette.h	(Revision 27098)
+++ scribus/plugins/shapes/shapepalette.h	(Arbeitskopie)
@@ -91,7 +91,7 @@
 	Q_OBJECT
 
 public:
-	ShapePalette(QWidget *parent);
+	ShapePalette();
 	~ShapePalette() {};
 
 	void writeToPrefs();
Index: scribus/plugins/shapes/shapeplugin.cpp
===================================================================
--- scribus/plugins/shapes/shapeplugin.cpp	(Revision 27098)
+++ scribus/plugins/shapes/shapeplugin.cpp	(Arbeitskopie)
@@ -73,19 +73,10 @@
 	languageChange();
 	m_actions.insert("shapeShowPalette", new ScrAction(fullTrName(), QKeySequence(), this));
 
-	// Use this if menu action is checkable
-	// m_actions["shapeShowPalette"]->setToggleAction(true);
-	// m_actions["shapeShowPalette"]->setChecked(false);
-	// connect(m_actions["shapeShowPalette"], SIGNAL(toggled(bool)), sc_palette, SLOT(toggleView(bool)));
-	// connect(sc_palette, SIGNAL(viewToggled(bool)), m_actions["shapeShowPalette"], SLOT(setChecked(bool)));
+	sc_palette->setToggleViewAction(m_actions["shapeShowPalette"]);
 
-	// Use this if menu action is not checkable
-	connect(m_actions["shapeShowPalette"], SIGNAL(triggered()), sc_palette, SLOT(toggleView()));
-
 	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, false);
 
 }
@@ -112,7 +103,7 @@
 
 bool ShapePlugin::initPlugin()
 {
-	sc_palette = new ShapePalette(ScCore->primaryMainWindow());
+	sc_palette = new ShapePalette();
 	sc_palette->startup();
 	sc_palette->readFromPrefs();
 	return true;
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(Revision 27098)
+++ scribus/scribus.cpp	(Arbeitskopie)
@@ -247,8 +247,6 @@
 #include "util.h"
 #include "util_file.h"
 #include "util_formats.h"
-#include "third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.h"
-#include "third_party/Qt-Advanced-Docking-System/src/IconProvider.h"
 
 #ifdef HAVE_SVNVERSION
 	#include "svnversion.h"
@@ -268,7 +266,6 @@
 #include "sclimits.h"
 
 using namespace std;
-using namespace ads;
 
 bool previewDinUse;
 bool printDinUse;
@@ -275,6 +272,7 @@
 extern bool emergencyActivated;
 
 ScribusMainWindow::ScribusMainWindow() :
+	MainWindow("scribusmainwindow", KDDockWidgets::MainWindowOptions {KDDockWidgets::MainWindowOption_HasCentralWidget}, nullptr),
 	m_prefsManager(PrefsManager::instance()),
 	m_widgetManager(WidgetManager::instance())
 {
@@ -292,37 +290,6 @@
  */
 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);
-	CDockManager::setConfigFlag(CDockManager::DisableTabTextEliding, true);
-	CDockManager::setConfigFlag(CDockManager::ShowTabTextOnlyForActiveTab, !m_prefsManager.appPrefs.uiPrefs.showLabelsOfInactiveTabs);
-
-	// 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, false);
-//	CDockManager::setAutoHideConfigFlag(CDockManager::AutoHideCloseButtonCollapsesDock, true);
-//	CDockManager::setAutoHideConfigFlag(CDockManager::AutoHideButtonTogglesArea, true);
-	CDockManager::setAutoHideConfigFlag(CDockManager::DockAreaHasAutoHideButton, true);
-
-	IconManager &iconmanager = IconManager::instance();
-	CDockManager::iconProvider().registerCustomIcon(TabCloseIcon, iconmanager.loadIcon("close", 12));
-	CDockManager::iconProvider().registerCustomIcon(DockAreaCloseIcon, iconmanager.loadIcon("close", 12));
-	CDockManager::iconProvider().registerCustomIcon(DockAreaMenuIcon, iconmanager.loadIcon("menu-down", 16));
-	CDockManager::iconProvider().registerCustomIcon(DockAreaUndockIcon, iconmanager.loadIcon("dock-float", 16));
-	CDockManager::iconProvider().registerCustomIcon(AutoHideIcon, iconmanager.loadIcon("dock-auto-hide", 16));
-	CDockManager::iconProvider().registerCustomIcon(DockAreaMinimizeIcon, iconmanager.loadIcon("dock-minimize", 16));
-
 	int retVal=0;
 	//qsrand(1234);
 	QByteArray stylesheet;
@@ -607,7 +574,7 @@
 		stylesheet.replace("___tb_menu_arrow___", tba);
 	}
 
-	dockManager->setStyleSheet(stylesheet); // style sheet should be enabled when theme manager is implemented to handle color palettes in css file.
+//	dockManager->setStyleSheet(stylesheet); // style sheet should be enabled when theme manager is implemented to handle color palettes in css file.
 
 	layerMenu->setStyleSheet(stylesheet);
 	unitSwitcher->setStyleSheet(stylesheet);
@@ -1906,13 +1873,6 @@
 	// Save GUI state
 	dockManager->saveWorkspaceToPrefs();
 
-	// 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)
@@ -7609,7 +7569,7 @@
 {
 	if (!HaveDoc)
 		return;
-	m_pagePaletteWasClosed = pagePalette->isClosed();
+	m_pagePaletteWasClosed = pagePalette->isHidden();
 	QString mpName;
 	if (temp.isEmpty())
 		mpName = doc->currentPage()->masterPageName();
@@ -7642,12 +7602,12 @@
 	view->saveViewState();
 
 	pagePalette->startMasterPageMode(mpName);
-	if (pagePalette->isClosed())
+	if (pagePalette->isHidden())
 	{
-		auto* area = pagePalette->dockAreaWidget();
-		auto* dockWidget = area->currentDockWidget();
-		scrActions["toolsPages"]->setChecked(true);
-		area->setCurrentDockWidget(dockWidget);
+		// auto* area = pagePalette->dockAreaWidget();
+		// auto* dockWidget = area->currentDockWidget();
+		// scrActions["toolsPages"]->setChecked(true);
+		// area->setCurrentDockWidget(dockWidget);
 	}
 	appModeHelper->setMasterPageEditMode(true, doc);
 }
Index: scribus/scribus.h
===================================================================
--- scribus/scribus.h	(Revision 27098)
+++ scribus/scribus.h	(Arbeitskopie)
@@ -61,7 +61,11 @@
 #include "styleoptions.h"
 #include "ui/customfdialog.h"
 #include "ui/scmessagebox.h"
+//#include "third_party/KDDockWidgets/src/core/MainWindow.h"
 
+#include <kddockwidgets/MainWindow.h>
+#include <kddockwidgets/DockWidget.h>
+
 class ActionManager;
 class AlignDistributePalette;
 class AppModeHelper;
@@ -126,7 +130,7 @@
   * and statusbar. For the main view, an instance of class ScribusView is
   * created which creates your view.
   */
-class SCRIBUS_API ScribusMainWindow : public QMainWindow, public UndoObject
+class SCRIBUS_API ScribusMainWindow : public KDDockWidgets::QtWidgets::MainWindow, public UndoObject
 {
 	Q_OBJECT
 
Index: scribus/scribuscore.cpp
===================================================================
--- scribus/scribuscore.cpp	(Revision 27098)
+++ scribus/scribuscore.cpp	(Arbeitskopie)
@@ -51,6 +51,9 @@
 
 //extern ScribusQApp* ScQApp;
 
+//#include "third_party/KDDockWidgets/src/Config.h"
+#include <kddockwidgets/Config.h>
+
 ScribusCore::ScribusCore() : defaultEngine(ScColorMgmtEngineFactory::createDefaultEngine()),
 							m_iconManager(IconManager::instance()),
 							m_prefsManager(PrefsManager::instance())
@@ -94,6 +97,24 @@
 
 int ScribusCore::startGUI(bool showSplash, bool showFontInfo, bool showProfileInfo, const QString& newGuiLanguage)
 {
+
+	// Initialize GUI
+	KDDockWidgets::initFrontend(KDDockWidgets::FrontendType::QtWidgets);
+
+	// Custom Widget Factory
+	//KDDockWidgets::Config::self().setViewFactory(new CustomWidgetFactory());
+
+	// https://github.com/KDAB/KDDockWidgets/blob/2.0/src/Config.h
+	auto flags = KDDockWidgets::Config::self().flags();
+	// flags |= KDDockWidgets::Config::Flag_HideTitleBarWhenTabsVisible;
+	// flags |= KDDockWidgets::Config::Flag_ShowButtonsOnTabBarIfTitleBarHidden;
+	flags |= KDDockWidgets::Config::Flag_AllowSwitchingTabsViaMenu;
+	flags |= KDDockWidgets::Config::Flag_AutoHideSupport;
+	flags |= KDDockWidgets::Config::Flag_TabsHaveCloseButton;
+	flags |= KDDockWidgets::Config::Flag_AllowReorderTabs;
+	KDDockWidgets::Config::self().setFlags(flags);
+
+
 	auto* scribus = new ScribusMainWindow();
 	Q_CHECK_PTR(scribus);
 	if (!scribus)
@@ -135,8 +156,8 @@
 		{
 			if (PrefsManager::instance().appPrefs.uiPrefs.showStartupDialog && usingGUI())
 				scribus->startUpDialog();
-			else
-				scribus->setFocus();
+			// else
+			// 	scribus->setFocus();
 		}
 	}
 	else if (subsRet == QMessageBox::Help)
Index: scribus/third_party/CMakeLists.txt
===================================================================
--- scribus/third_party/CMakeLists.txt	(Revision 27098)
+++ scribus/third_party/CMakeLists.txt	(Arbeitskopie)
@@ -1,6 +1,4 @@
-#if(WANT_QTADS)
-add_subdirectory(Qt-Advanced-Docking-System)
-#endif()
+add_subdirectory(KDDockWidgets)
 
 if(HAVE_OSG)
   add_subdirectory(prc)
Index: scribus/ui/aligndistribute.cpp
===================================================================
--- scribus/ui/aligndistribute.cpp	(Revision 27098)
+++ scribus/ui/aligndistribute.cpp	(Arbeitskopie)
@@ -65,10 +65,9 @@
 // =============================
 
 
-AlignDistributePalette::AlignDistributePalette(QWidget* parent) : DockPanelBase("AlignDistributePalette", "panel-align-distribute", parent)
+AlignDistributePalette::AlignDistributePalette() : DockPanelBase("AlignDistributePalette", "panel-align-distribute")
 {
 	setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
-	setObjectName("AlignDistributePalette");
 
 	ad = new AlignDistribute(this);
 	setWidget(ad);
@@ -113,6 +112,7 @@
 void AlignDistributePalette::languageChange()
 {
 	ad->retranslateUi(this);
+	setWindowTitle( tr("Align and Distribute"));
 
 	referenceGuideTooltipTemplate = tr("Align relative to a guide%1");
 
Index: scribus/ui/aligndistribute.h
===================================================================
--- scribus/ui/aligndistribute.h	(Revision 27098)
+++ scribus/ui/aligndistribute.h	(Arbeitskopie)
@@ -67,7 +67,7 @@
 	Q_OBJECT
 
 public:
-	AlignDistributePalette( QWidget* parent = nullptr);
+	AlignDistributePalette();
 	~AlignDistributePalette() = default;
 
 	virtual void setDoc( ScribusDoc* newDoc );
Index: scribus/ui/bookmarkpalette.cpp
===================================================================
--- scribus/ui/bookmarkpalette.cpp	(Revision 27098)
+++ scribus/ui/bookmarkpalette.cpp	(Arbeitskopie)
@@ -25,7 +25,7 @@
 
 #include "bookmarkpalette.h"
 
-BookPalette::BookPalette(QWidget* parent) : DockPanelBase( "Books", "panel-bookmarks", parent )
+BookPalette::BookPalette() : DockPanelBase( "Books", "panel-bookmarks")
 {
 	setObjectName(QString::fromLocal8Bit("Books"));
 	setMinimumSize( QSize(220, 240) );
Index: scribus/ui/bookmarkpalette.h
===================================================================
--- scribus/ui/bookmarkpalette.h	(Revision 27098)
+++ scribus/ui/bookmarkpalette.h	(Arbeitskopie)
@@ -50,7 +50,7 @@
 	\param parent Parent Window
 	\retval None
 	*/
-	BookPalette(QWidget* parent);
+	BookPalette();
 	~BookPalette() {};
 	
 	BookmarkView	*BView;
Index: scribus/ui/contentpalette.cpp
===================================================================
--- scribus/ui/contentpalette.cpp	(Revision 27098)
+++ scribus/ui/contentpalette.cpp	(Arbeitskopie)
@@ -25,8 +25,7 @@
 #include "styles/paragraphstyle.h"
 #include "styles/charstyle.h"
 
-ContentPalette::ContentPalette(QWidget *parent) :
-	DockPanelBase("ContentPalette", "panel-content-properties", parent)
+ContentPalette::ContentPalette() : DockPanelBase("ContentPalette", "panel-content-properties")
 {
 	setObjectName(QString::fromLocal8Bit("ContentPalette"));
 
@@ -34,7 +33,7 @@
 	f.setPointSize(f.pointSize()-1);
 	setFont(f);
 
-	stackedWidget = new StackedContainer(this);
+	stackedWidget = new StackedContainer(this);
 
 	defaultPal = new ContentPalette_Default(this);
 	stackedWidget->addWidget(defaultPal);
@@ -276,7 +275,7 @@
 		updatePanelTitle();
 	}
 	updateGeometry();
-	DockPanelBase::update();
+	DockPanelBase::update();
 }
 
 void ContentPalette::unitChange()
@@ -319,7 +318,7 @@
 		languageChange();
 		return;
 	}
-	DockPanelBase::changeEvent(e);
+	DockPanelBase::changeEvent(e);
 }
 
 void ContentPalette::updatePanelTitle()
@@ -364,7 +363,7 @@
 
 void ContentPalette::update(const ParagraphStyle& style)
 {
-	textPal->updateParagraphStyle(style);
+	textPal->updateParagraphStyle(style);
 }
 
 void ContentPalette::update(const CharStyle& style)
@@ -378,7 +377,7 @@
 
 void ContentPalette::updateTextStyles()
 {
-	textPal->updateTextStyles();
+	textPal->updateTextStyles();
 }
 
 void ContentPalette::updateTextAlignment(int i)
Index: scribus/ui/contentpalette.h
===================================================================
--- scribus/ui/contentpalette.h	(Revision 27098)
+++ scribus/ui/contentpalette.h	(Arbeitskopie)
@@ -8,9 +8,9 @@
 #define CONTENTPALETTE_H
 
 #include "scribusapi.h"
-#include "docks/dock_panelbase.h"
+#include "docks/dock_panelbase.h"
 #include "scguardedptr.h"
-#include "widgets/stacked_container.h"
+#include "widgets/stacked_container.h"
 
 class QStackedWidget;
 
@@ -29,12 +29,12 @@
 class ParagraphStyle;
 class CharStyle;
 
-class SCRIBUS_API ContentPalette : public DockPanelBase
+class SCRIBUS_API ContentPalette : public DockPanelBase
 {
 	Q_OBJECT
 
 	public:
-		ContentPalette(QWidget* parent);
+		ContentPalette();
 		~ContentPalette() {}
 
 		void updateColorList();
@@ -75,7 +75,7 @@
 		double m_unitRatio {1.0};
 		int m_unitIndex {0};
 
-		StackedContainer* stackedWidget {nullptr};
+		StackedContainer* stackedWidget {nullptr};
 		ContentPalette_Default* defaultPal {nullptr};
 		PropertiesPalette_Group* groupPal {nullptr};
 		PropertiesPalette_Image* imagePal {nullptr};
Index: scribus/ui/docks/dock_centralwidget.cpp
===================================================================
--- scribus/ui/docks/dock_centralwidget.cpp	(Revision 27098)
+++ scribus/ui/docks/dock_centralwidget.cpp	(Arbeitskopie)
@@ -18,11 +18,17 @@
  ***************************************************************************/
 #include "dock_centralwidget.h"
 
-DockCentralWidget::DockCentralWidget(QWidget *parent)
-	: ads::CDockWidget(QString(), parent)
+DockCentralWidget::DockCentralWidget() : QWidget(nullptr)
 {
 	setObjectName(QString::fromLocal8Bit("DockCentralWidget"));
 
-	setFeature(ads::CDockWidget::NoTab, true);
-	setFeature(ads::CDockWidget::DockWidgetFloatable, false);
+	layoutWidget = new QHBoxLayout();
+	layoutWidget->setSpacing(0);
+	layoutWidget->setContentsMargins(0, 0, 0, 0);
+	setLayout(layoutWidget);
 }
+
+void DockCentralWidget::setWidget(QWidget *widget)
+{
+	layoutWidget->addWidget(widget);
+}
Index: scribus/ui/docks/dock_centralwidget.h
===================================================================
--- scribus/ui/docks/dock_centralwidget.h	(Revision 27098)
+++ scribus/ui/docks/dock_centralwidget.h	(Arbeitskopie)
@@ -20,14 +20,20 @@
 #ifndef DOCK_CENTRALWIDGET_H
 #define DOCK_CENTRALWIDGET_H
 
-#include "third_party/Qt-Advanced-Docking-System/src/DockWidget.h"
+#include <QWidget>
+#include <QHBoxLayout>
 
-class DockCentralWidget : public ads::CDockWidget
+class DockCentralWidget : public QWidget
 {
 	Q_OBJECT
 
 public:
-	explicit DockCentralWidget(QWidget *parent = nullptr);
+	explicit DockCentralWidget();
+	void setWidget(QWidget *widget);
+
+private:
+	QHBoxLayout *layoutWidget;
+
 };
 
 #endif // DOCK_CENTRALWIDGET_H
Index: scribus/ui/docks/dock_panelbase.cpp
===================================================================
--- scribus/ui/docks/dock_panelbase.cpp	(Revision 27098)
+++ scribus/ui/docks/dock_panelbase.cpp	(Arbeitskopie)
@@ -20,6 +20,8 @@
 #include "dock_panelbase.h"
 
 #include <QApplication>
+#include <QScrollArea>
+#include  <QScrollBar>
 
 #include "iconmanager.h"
 #include "prefscontext.h"
@@ -27,25 +29,15 @@
 #include "prefsmanager.h"
 #include "scribusapp.h"
 
-DockPanelBase::DockPanelBase(const QString &title, QString iconName, QWidget *parent)
-	: CDockWidget(title, parent)
+DockPanelBase::DockPanelBase(const QString &title, QString iconName, KDDockWidgets::DockWidgetOptions options)
+	: KDDockWidgets::QtWidgets::DockWidget(title, options)
 {
-	/*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_iconName = iconName;
+	m_scrollArea = new QScrollArea;
+	m_scrollArea->setFrameShape(QFrame::NoFrame);
+	m_scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+	m_scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+	KDDockWidgets::QtWidgets::DockWidget::setWidget(m_scrollArea);
 
 	iconSetChange();
 
@@ -55,8 +47,8 @@
 	connect(ScQApp, SIGNAL(iconSetChanged()), this, SLOT(iconSetChange()));
 }
 
-DockPanelBase::DockPanelBase(const QString &title, QWidget *parent)
-	: DockPanelBase(title, QString(), parent){}
+DockPanelBase::DockPanelBase(const QString &title, KDDockWidgets::DockWidgetOptions options)
+	: DockPanelBase(title, QString(), options){}
 
 void DockPanelBase::setPrefsContext(const QString &context)
 {
@@ -69,6 +61,27 @@
 		m_palettePrefs = nullptr;
 }
 
+void DockPanelBase::updateScrollAreaMinSize()
+{
+	if (!widget())
+		return;
+
+	int contentWidth = widget()->minimumSizeHint().width();
+	int frameWidth = m_scrollArea->frameWidth() * 2;
+	int scrollBarWidth = m_scrollArea->verticalScrollBar()->sizeHint().width();
+
+	m_scrollArea->setMinimumWidth(contentWidth + frameWidth + scrollBarWidth);
+}
+
+bool DockPanelBase::eventFilter(QObject *watched, QEvent *event)
+{
+	if (watched == widget() && event->type() == QEvent::Resize)
+		updateScrollAreaMinSize();
+
+	return QWidget::eventFilter(watched, event);
+
+}
+
 void DockPanelBase::startup()
 {
 	setFontSize();
@@ -97,3 +110,32 @@
 	}
 
 }
+
+void DockPanelBase::setToggleViewAction(ScrAction *action)
+{
+	action->setCheckable(true);
+
+	connect( action, &ScrAction::toggled, toggleAction(), &QAction::setChecked);
+	connect( toggleAction(), &QAction::toggled, action, &ScrAction::setChecked);
+}
+
+void DockPanelBase::setWindowTitle(const QString &title)
+{
+	KDDockWidgets::QtWidgets::DockWidget::setWindowTitle(title);
+	setTitle( title );
+}
+
+void DockPanelBase::setWidget(QWidget *widget)
+{
+//	widget->adjustSize();
+	widget->installEventFilter(this);
+	m_scrollArea->setWidget(widget);
+	m_scrollArea->setWidgetResizable(true);
+
+	updateScrollAreaMinSize();
+}
+
+QWidget *DockPanelBase::widget() const
+{
+	return m_scrollArea->widget();
+}
Index: scribus/ui/docks/dock_panelbase.h
===================================================================
--- scribus/ui/docks/dock_panelbase.h	(Revision 27098)
+++ scribus/ui/docks/dock_panelbase.h	(Arbeitskopie)
@@ -21,32 +21,41 @@
 #define DOCK_PANELBASE_H
 
 #include "scribusapi.h"
-#include "third_party/Qt-Advanced-Docking-System/src/DockWidget.h"
-using namespace ads;
+#include "scraction.h"
+#include <kddockwidgets/DockWidget.h>
+#include <QScrollArea>
 
 class PrefsContext;
 
-class SCRIBUS_API DockPanelBase : public CDockWidget
+class SCRIBUS_API DockPanelBase : public KDDockWidgets::QtWidgets::DockWidget
 {
 	Q_OBJECT
 
 public:
-	DockPanelBase(const QString &title, QWidget *parent = 0);
-	DockPanelBase(const QString &title, QString iconName, QWidget *parent = 0);
+	DockPanelBase(const QString &title, KDDockWidgets::DockWidgetOptions options = KDDockWidgets::DockWidgetOption_None);
+	DockPanelBase(const QString &title, QString iconName, KDDockWidgets::DockWidgetOptions options = KDDockWidgets::DockWidgetOption_None);
 
 	void startup();
+	void setWindowTitle(const QString& title) override;
+	void setWidget(QWidget *widget);
+	QWidget *widget() const;
 
 public slots:
 	virtual void setFontSize();
 	void iconSetChange();
+	void setToggleViewAction(ScrAction *action);
 
 protected:
 	/** @brief Set the Preferences context to be used for storage of startup visibility and position and size */
 	virtual void setPrefsContext(const QString &context);
+	void updateScrollAreaMinSize();
+	bool eventFilter(QObject *watched, QEvent *event) override;
 
 	PrefsContext *m_palettePrefs {nullptr};
 	QString m_prefsContextName;
 	QString m_iconName;
+	QScrollArea *m_scrollArea;
+
 };
 
 #endif // DOCK_PANELBASE_H
Index: scribus/ui/inlinepalette.cpp
===================================================================
--- scribus/ui/inlinepalette.cpp	(Revision 27098)
+++ scribus/ui/inlinepalette.cpp	(Arbeitskopie)
@@ -101,7 +101,7 @@
 	clearSelection();
 }
 
-InlinePalette::InlinePalette( QWidget* parent) : DockPanelBase("Inline", "panel-inline-items", parent)
+InlinePalette::InlinePalette() : DockPanelBase("Inline", "panel-inline-items")
 {
 	setContentsMargins(3, 3, 3, 3);
 	setMinimumSize( QSize( 220, 240 ) );
Index: scribus/ui/inlinepalette.h
===================================================================
--- scribus/ui/inlinepalette.h	(Revision 27098)
+++ scribus/ui/inlinepalette.h	(Arbeitskopie)
@@ -72,7 +72,7 @@
 	Q_OBJECT
 
 public:
-	InlinePalette(QWidget* parent);
+	InlinePalette();
 	~InlinePalette() {};
 
 	void setMainWindow(ScribusMainWindow *mw);
Index: scribus/ui/layers.cpp
===================================================================
--- scribus/ui/layers.cpp	(Revision 27098)
+++ scribus/ui/layers.cpp	(Arbeitskopie)
@@ -42,7 +42,7 @@
 #include "docks/dock_panelbase.h"
 #include "undomanager.h"
 
-LayerPalette::LayerPalette(QWidget* parent) : DockPanelBase("Layers", "panel-layers", parent)
+LayerPalette::LayerPalette() : DockPanelBase("Layers", "panel-layers")
 {
 	setObjectName(QString::fromLocal8Bit("Layers"));
 	setMinimumSize( QSize(220, 240) );
Index: scribus/ui/layers.h
===================================================================
--- scribus/ui/layers.h	(Revision 27098)
+++ scribus/ui/layers.h	(Arbeitskopie)
@@ -34,7 +34,7 @@
 	Q_OBJECT
 
 public:
-	LayerPalette(QWidget* parent);
+	LayerPalette();
 	~LayerPalette() {};
 
 	void installEventFilter(QObject *);
Index: scribus/ui/outlinepalette.cpp
===================================================================
--- scribus/ui/outlinepalette.cpp	(Revision 27098)
+++ scribus/ui/outlinepalette.cpp	(Arbeitskopie)
@@ -431,7 +431,7 @@
 	return true;
 }
 
-OutlinePalette::OutlinePalette( QWidget* parent) : DockPanelBase("Tree", "panel-outline", parent)
+OutlinePalette::OutlinePalette() : DockPanelBase("Tree", "panel-outline")
 {
 //	resize( 220, 240 );
 	setMinimumSize( QSize( 220, 240 ) );
@@ -481,9 +481,9 @@
 	connect(filterEdit, SIGNAL(textChanged(QString)), this, SLOT(filterTree(QString)));
 //	connect(filterShortcut, SIGNAL(activated()), filterEdit, SLOT(setFocus()));
 	connect(reportDisplay, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(slotDoubleClick(QTreeWidgetItem*,int)));
-	connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(rebuildTree()));
+	connect(this, SIGNAL(isOpenChanged(bool)), this, SLOT(rebuildTree(bool)));
+	connect(this, SIGNAL(isCurrentTabChanged(bool)), this, SLOT(rebuildTree(bool)));
 
-
 }
 
 void OutlinePalette::setMainWindow(ScribusMainWindow *mw)
@@ -509,16 +509,9 @@
 	clearPalette();
 }
 
-void OutlinePalette::toggleView(bool visible)
+void OutlinePalette::rebuildTree(bool isActive)
 {
-	DockPanelBase::toggleView(visible);
-	rebuildTree();
-}
-
-
-void OutlinePalette::rebuildTree()
-{
-	if (this->isVisible() && (currDoc != nullptr))
+	if (isActive)
 		BuildTree();
 }
 
Index: scribus/ui/outlinepalette.h
===================================================================
--- scribus/ui/outlinepalette.h	(Revision 27098)
+++ scribus/ui/outlinepalette.h	(Arbeitskopie)
@@ -60,7 +60,7 @@
 	Q_OBJECT
 
 public:
-	OutlinePalette( QWidget* parent );
+	OutlinePalette();
 	
 	void setMainWindow(ScribusMainWindow *mw);
 	void setDoc(ScribusDoc *);
@@ -77,7 +77,6 @@
 	void iconSetChange();
 	void languageChange();
 	void slotShowSelect(int pageNr, PageItem *pageItem);
-	void toggleView(bool);
 	void slotRightClick(QPoint point);
 	void setActiveLayer(int layerID);
 	void setLayerVisible(int layerID);
@@ -96,7 +95,7 @@
 	void slotMultiSelect();
 	void slotSelect(QTreeWidgetItem* ite, int col);
 	void slotDoubleClick(QTreeWidgetItem* ite, int col);
-	void rebuildTree();
+	void rebuildTree(bool);
 
 protected:
 	void changeEvent(QEvent *e) override;
Index: scribus/ui/pagepalette.cpp
===================================================================
--- scribus/ui/pagepalette.cpp	(Revision 27098)
+++ scribus/ui/pagepalette.cpp	(Arbeitskopie)
@@ -21,7 +21,7 @@
 #include "scribusdoc.h"
 #include "scribusview.h"
 
-PagePalette::PagePalette(QWidget *parent) : DockPanelBase("PagePalette", "panel-page", parent)
+PagePalette::PagePalette() : DockPanelBase("PagePalette", "panel-page")
 {
 	m_scMW = nullptr;//(ScribusMainWindow*) parent;
 	m_view = nullptr;
@@ -210,7 +210,7 @@
 	}
 
 	// Set focus to page palette or focus may be set to wrong document window
-	this->setFocus();
+	//this->setFocus();
 	stackedWidget->setCurrentIndex(1);
 	setWindowTitle( tr( "Manage Masterpages" ) );
 }
@@ -220,7 +220,7 @@
 	if (this->stackedWidget()->currentIndex() > 0)
 	{
 		// Set focus to page palette or focus may be set to wrong document window
-		this->setFocus();
+		//this->setFocus();
 		this->stackedWidget()->setCurrentIndex(0);
 	}
 
Index: scribus/ui/pagepalette.h
===================================================================
--- scribus/ui/pagepalette.h	(Revision 27098)
+++ scribus/ui/pagepalette.h	(Arbeitskopie)
@@ -37,7 +37,7 @@
 	Q_OBJECT
 
 public:
-	PagePalette(QWidget *parent);
+	PagePalette();
 	~PagePalette() {};
 	
 	QWidget* currentWidget();
Index: scribus/ui/propertiespalette.cpp
===================================================================
--- scribus/ui/propertiespalette.cpp	(Revision 27098)
+++ scribus/ui/propertiespalette.cpp	(Arbeitskopie)
@@ -45,7 +45,7 @@
 #include "selection.h"
 #include "undomanager.h"
 
-PropertiesPalette::PropertiesPalette(QWidget *parent) : DockPanelBase("PropertiesPalette", "panel-frame-properties", parent)
+PropertiesPalette::PropertiesPalette() : DockPanelBase("PropertiesPalette", "panel-frame-properties")
 {
 	undoManager = UndoManager::instance();
 
Index: scribus/ui/propertiespalette.h
===================================================================
--- scribus/ui/propertiespalette.h	(Revision 27098)
+++ scribus/ui/propertiespalette.h	(Arbeitskopie)
@@ -55,7 +55,7 @@
 	Q_OBJECT
 
 public:
-	PropertiesPalette(QWidget* parent);
+	PropertiesPalette();
 	~PropertiesPalette() {}
 
 	void endPatchAdd();
Index: scribus/ui/scrapbookpalette.cpp
===================================================================
--- scribus/ui/scrapbookpalette.cpp	(Revision 27098)
+++ scribus/ui/scrapbookpalette.cpp	(Arbeitskopie)
@@ -740,7 +740,7 @@
 }
 
 /* This is the main Dialog-Class for the Scrapbook */
-Biblio::Biblio(QWidget* parent) : DockPanelBase("Sclib", "panel-scrapbook", parent)
+Biblio::Biblio() : DockPanelBase("Sclib", "panel-scrapbook")
 {
 	setObjectName(QString::fromLocal8Bit("Sclib"));
 	setMinimumSize( QSize(220, 240) );
Index: scribus/ui/scrapbookpalette.h
===================================================================
--- scribus/ui/scrapbookpalette.h	(Revision 27098)
+++ scribus/ui/scrapbookpalette.h	(Arbeitskopie)
@@ -73,7 +73,7 @@
 	Q_OBJECT
 
 public:
-	Biblio( QWidget* parent);
+	Biblio();
 	~Biblio() {};
 	
 	void changeEvent(QEvent *e) override;
Index: scribus/ui/symbolpalette.cpp
===================================================================
--- scribus/ui/symbolpalette.cpp	(Revision 27098)
+++ scribus/ui/symbolpalette.cpp	(Arbeitskopie)
@@ -150,7 +150,7 @@
 	clearSelection();
 }
 
-SymbolPalette::SymbolPalette( QWidget* parent) : DockPanelBase("Symb", "panel-symbols", parent)
+SymbolPalette::SymbolPalette() : DockPanelBase("Symb", "panel-symbols")
 {
 	setContentsMargins(3, 3, 3, 3);
 	setMinimumSize( QSize( 220, 240 ) );
Index: scribus/ui/symbolpalette.h
===================================================================
--- scribus/ui/symbolpalette.h	(Revision 27098)
+++ scribus/ui/symbolpalette.h	(Arbeitskopie)
@@ -76,7 +76,7 @@
 	Q_OBJECT
 
 public:
-	SymbolPalette(QWidget* parent);
+	SymbolPalette();
 	~SymbolPalette() {};
 
 	void setMainWindow(ScribusMainWindow *mw);
Index: scribus/undogui.cpp
===================================================================
--- scribus/undogui.cpp	(Revision 27098)
+++ scribus/undogui.cpp	(Arbeitskopie)
@@ -38,7 +38,7 @@
 #include "undogui.h"
 
 
-UndoGui::UndoGui(QWidget* parent, const char* name) : DockPanelBase(name, "panel-action-history", parent)
+UndoGui::UndoGui(QWidget* parent, const char* name) : DockPanelBase(name, "panel-action-history")
 {
 	languageChange();
 }
kddock_2025-10-31_01.patch (47,965 bytes)   

nitramr

2025-10-31 20:46

developer   ~0053157

kddock.png (65,055 bytes)   
kddock.png (65,055 bytes)   

ale

2025-11-01 08:43

manager   ~0053161

Last edited: 2025-11-01 13:36

patch applied and it works!

i can now dock and undock the windows at will and it behaves (mostly...) correctly.
(sometimes the default width is a bit wild, but for a start it's more than good!)

only issue, after a make install, i got

bin/scribus: error while loading shared libraries: libkddockwidgets-qt6.so.3: cannot open shared object file: No such file or directory


which I could solve with

export LD_LIBRARY_PATH=/home/ale/bin/build/scribus-tmp/lib/


I guess that something is missing in the cmake file...

cbradney

2025-11-01 12:40

administrator   ~0053162

Here's a screenshot:
image.png (278,858 bytes)   
image.png (278,858 bytes)   

cbradney

2025-11-01 12:40

administrator   ~0053163

Versus:
image-2.png (287,288 bytes)   
image-2.png (287,288 bytes)   

cbradney

2025-11-01 12:42

administrator   ~0053164

It works, but there's some spacing issues that means it takes up a lot more space and I don't understand that white space left of the document window. It cannot be shrunk completely and it shouldn't be there in the first place.

I added these CMake options and its ok locating the lib (first one making the difference but we don't need examples, docs or other frontends:
    -DKDDockWidgets_STATIC=true \
    -DKDDockWidgets_EXAMPLES=false \
    -DKDDockWidgets_DOCS=false \
    -DKDDockWidgets_FRONTENDS='qtwidgets' \

nitramr

2025-11-01 12:56

developer   ~0053165

Thanks for the feedback. I will check how I can improve it.

ale

2025-11-01 14:31

manager   ~0053166

Last edited: 2025-11-01 15:49

Yes, adding

set(KDDockWidgets_STATIC ON)
set(KDDockWidgets_EXAMPLES OFF)
set(KDDockWidgets_DOCS OFF)
set(KDDockWidgets_FRONTENDS "qtwidgets")


in CMakeLists_Dependencies.cmake, where WANT_QTADS was, makes is runnable : - )

And this is how it looks like on my laptop, on a fresh install!
Some width are a bit too much : - )
dock-laptop.png (124,496 bytes)   
dock-laptop.png (124,496 bytes)   

ale

2025-11-01 16:26

manager   ~0053167

A few more things:

- In the default setup (when creating the new configs), the tabs are not created correctly: somehow, it shows all the tab titles in the title bar.
- When there are multiple tabs, the title of the current tab is repeated in the a docking are title bar (in the screenshot above it's the duplicated "Properties" title)
- In the screenshot I'm attaching here, there is a gray area on the right of the left docked panes. That's the minimum I can shrink it. And I don't seem to be able to remove it.
  -> Ok, I discovered what it is: when hiding the last palette that was in a tabbed area, the tabbed area is not removed and there is no way to add other palettes to that area or to remove it. Until one shows again that palette in that area and instead of closing it, first makes it floating (or move it to a different area)
- I have now a crash: start Scribus with fresh settings, don't create a new document, and double click on the "Custom shapes" panel that is docked on the left side: crash.
  (Custom shapes, should probably not be docked by default, but hidden... but that's a different issue : - )
  (I can correctly double click, as an example, "Arrange pages")
- If I make "Custom shapes" floating and close it, and restart Scribus, then, I have a "Custom pages" floating and one "ghost" "Custom pages" behind the panels docked to the left.
  But I guess that there are more issues with the "Custom pages" panel: see screenshot : - )
custom-shapes.png (12,964 bytes)   
custom-shapes.png (12,964 bytes)   
gray-area.png (23,854 bytes)   
gray-area.png (23,854 bytes)   

Issue History

Date Modified Username Field Change
2025-02-28 10:13 ale New Issue
2025-10-31 20:45 nitramr Note Added: 0053156
2025-10-31 20:45 nitramr File Added: kddock_2025-10-31_01.patch
2025-10-31 20:46 nitramr Note Added: 0053157
2025-10-31 20:46 nitramr File Added: kddock.png
2025-10-31 20:46 nitramr Note Edited: 0053156
2025-11-01 08:43 ale Note Added: 0053161
2025-11-01 12:40 cbradney Note Added: 0053162
2025-11-01 12:40 cbradney File Added: image.png
2025-11-01 12:40 cbradney Note Added: 0053163
2025-11-01 12:40 cbradney File Added: image-2.png
2025-11-01 12:42 cbradney Note Added: 0053164
2025-11-01 12:56 nitramr Note Added: 0053165
2025-11-01 13:36 ale Note Edited: 0053161
2025-11-01 14:31 ale Note Added: 0053166
2025-11-01 14:31 ale File Added: dock-laptop.png
2025-11-01 15:49 ale Note Edited: 0053166
2025-11-01 16:26 ale Note Added: 0053167
2025-11-01 16:26 ale File Added: custom-shapes.png
2025-11-01 16:26 ale File Added: gray-area.png