View Issue Details

IDProjectCategoryView StatusLast Update
0017268ScribusUser Interfacepublic2024-09-16 20:54
Reporternitramr Assigned Tonitramr  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformDesktop PCOSUbuntuOS Version24.04 64-bit
Product Version1.7.0.svn 
Target Version1.7.0 
Summary0017268: ScribusMainWindow::editMasterPagesStart() open empty page palette window
DescriptionSince we implemented the advanced docking system, we need to toggle visibility of dock widgets using the toogleView() function or just use show() and close() to get the correct behavior.

ScribusMainWindow::editMasterPagesStart() still uses setVisibility() directly, and using visibility manipulation directly does not trigger functions in the dock manager to control visibility correctly.

This visibility change results in an empty floating window.
Steps To Reproduce1. Open Scribus and configure the workspace that Arrange Pages and Outline window are stacked (Arrange Pages is not visible)
2. Create a new document
3. Open Outline window and click on the master page in the tree (should be "normal")
4. Now, there is an empty floating window with title "Manage Masterpages"
Hint: This window is empty because "Arrange Pages" window is already docked, but the dock manager was not called to manage the right visibility state
Additional InformationThe fix implements the same behavior of 1.6.2
TagsNo tags attached.
PatchYes

Activities

nitramr

2024-09-14 12:22

developer  

pagepalette_fix_2024-09-14_01.patch (2,137 bytes)   
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(Revision 26284)
+++ scribus/scribus.cpp	(Arbeitskopie)
@@ -245,6 +245,7 @@
 #include "util_file.h"
 #include "util_formats.h"
 #include "third_party/Qt-Advanced-Docking-System/src/IconProvider.h"
+#include "third_party/Qt-Advanced-Docking-System/src/DockAreaWidget.h"
 
 #ifdef HAVE_SVNVERSION
 	#include "svnversion.h"
@@ -7573,10 +7574,10 @@
 }
 
 void ScribusMainWindow::editMasterPagesStart(const QString& temp)
-{
+{	
 	if (!HaveDoc)
 		return;
-	m_pagePalVisible = pagePalette->isVisible();
+	m_pagePaletteWasClosed = pagePalette->isClosed();
 	QString mpName;
 	if (temp.isEmpty())
 		mpName = doc->currentPage()->masterPageName();
@@ -7604,10 +7605,12 @@
 	view->saveViewState();
 
 	pagePalette->startMasterPageMode(mpName);
-	if (!pagePalette->isVisible())
+	if (pagePalette->isClosed())
 	{
-		pagePalette->show();
+		auto* area = pagePalette->dockAreaWidget();
+		auto* dockWidget = area->currentDockWidget();
 		scrActions["toolsPages"]->setChecked(true);
+		area->setCurrentDockWidget(dockWidget);
 	}
 	appModeHelper->setMasterPageEditMode(true, doc);
 }
@@ -7627,10 +7630,9 @@
 		Apply_MasterPage(doc->DocPages.at(i)->masterPageName(), i, false);
 
 	pagePalette->endMasterPageMode();
-	if (pagePalette->isFloating())
+	if (m_pagePaletteWasClosed && pagePalette->isFloating())
 	{
-		pagePalette->setVisible(m_pagePalVisible);
-		scrActions["toolsPages"]->setChecked(m_pagePalVisible);
+		scrActions["toolsPages"]->setChecked(false);
 	}
 
 	ScribusView::ViewState viewState = view->topViewState();
Index: scribus/scribus.h
===================================================================
--- scribus/scribus.h	(Revision 26284)
+++ scribus/scribus.h	(Arbeitskopie)
@@ -665,7 +665,7 @@
 	bool insertMarkDialog(PageItem_TextFrame* item, MarkType mT, ScItemsState* &is, const QString &text, int markInsertPosition);
 	int m_marksCount { 0 }; //remember marks count from last call
 	bool m_WasAutoSave { false };
-	bool m_pagePalVisible { false };
+	bool m_pagePaletteWasClosed { true };
 };
 
 #endif
floatingwindow.png (69,382 bytes)   
floatingwindow.png (69,382 bytes)   

jghali

2024-09-16 19:51

administrator   ~0051354

Committed, thanks!

Issue History

Date Modified Username Field Change
2024-09-14 12:22 nitramr New Issue
2024-09-14 12:22 nitramr File Added: pagepalette_fix_2024-09-14_01.patch
2024-09-14 12:22 nitramr File Added: floatingwindow.png
2024-09-16 19:51 jghali Assigned To => nitramr
2024-09-16 19:51 jghali Status new => resolved
2024-09-16 19:51 jghali Resolution open => fixed
2024-09-16 19:51 jghali Note Added: 0051354
2024-09-16 20:54 cbradney Status resolved => closed