r24560 by jghali - Move LayerPalette's Table widget to protected area

scribus-commit scribus-commit at lists.scribus.net
Sat Mar 13 19:56:11 UTC 2021


Author: jghali
Date: Sat Mar 13 19:56:11 2021
New Revision: 24560

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24560
Log:
Move LayerPalette's Table widget to protected area

Modified:
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/ui/layers.cpp
    trunk/Scribus/scribus/ui/layers.h

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24560&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Sat Mar 13 19:56:11 2021
@@ -707,7 +707,6 @@
 	connect( scrActions["toolsLayers"], SIGNAL(toggled(bool)) , layerPalette, SLOT(setPaletteShown(bool)));
 	connect( layerPalette, SIGNAL(paletteShown(bool)), scrActions["toolsLayers"], SLOT(setChecked(bool)));
 	layerPalette->installEventFilter(this);
-	layerPalette->Table->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)));

Modified: trunk/Scribus/scribus/ui/layers.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24560&path=/trunk/Scribus/scribus/ui/layers.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/layers.cpp	(original)
+++ trunk/Scribus/scribus/ui/layers.cpp	Sat Mar 13 19:56:11 2021
@@ -33,13 +33,13 @@
 #include <QVBoxLayout>
 
 #include "iconmanager.h"
+#include "sclayer.h"
 #include "scribus.h"
 #include "scribusapp.h"
 #include "scribusdoc.h"
 #include "selection.h"
 #include "ui/scrspinbox.h"
 #include "undomanager.h"
-
 
 LayerPalette::LayerPalette(QWidget* parent) : ScDockPalette(parent, "Layers", Qt::WindowFlags()), m_Doc(nullptr)
 {
@@ -170,6 +170,12 @@
 	connect(header, SIGNAL(sectionClicked(int)), this, SLOT(toggleAllfromHeader(int)));
 }
 
+void LayerPalette::installEventFilter(QObject *obj)
+{
+	ScDockPalette::installEventFilter(obj);
+	Table->installEventFilter(obj);
+}
+
 void LayerPalette::clearContent()
 {
 	disconnect(blendMode, SIGNAL(activated(int)), this, SLOT(changeBlendMode(int)));
@@ -194,7 +200,7 @@
 	disconnect(Table, SIGNAL(cellChanged(int,int)), this, SLOT(changeName(int,int)));
 	if (!m_Doc)
 	{
-		layers=nullptr;
+		layers = nullptr;
 		newLayerButton->setEnabled(false);
 		duplicateLayerButton->setEnabled(false);
 		deleteLayerButton->setEnabled(false);

Modified: trunk/Scribus/scribus/ui/layers.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24560&path=/trunk/Scribus/scribus/ui/layers.h
==============================================================================
--- trunk/Scribus/scribus/ui/layers.h	(original)
+++ trunk/Scribus/scribus/ui/layers.h	Sat Mar 13 19:56:11 2021
@@ -12,7 +12,6 @@
 #include "scribusapi.h"
 #include "ui/scdockpalette.h"
 #include "scribusstructs.h"
-#include "sclayer.h"
 
 class CheckBox;
 class QComboBox;
@@ -24,6 +23,7 @@
 class QTableWidgetItem;
 class QToolButton;
 class QVBoxLayout;
+class ScLayers;
 class ScrSpinBox;
 class ScribusDoc;
 
@@ -35,10 +35,10 @@
 	LayerPalette(QWidget* parent);
 	~LayerPalette() {};
 
+	void installEventFilter(QObject *);
+
 	void setDoc(ScribusDoc* doc);
 	void rebuildList();
-	
-	QTableWidget* Table { nullptr };	//public for the event filter in scribus.cpp.. TODO
 
 public slots:
 	void addLayer();
@@ -65,11 +65,11 @@
 
 signals:
 	void LayerChanged();
-	void LayerActivated(int);
 
 protected:
 	QWidget* containerWidget { nullptr };
 	ScribusDoc* m_Doc { nullptr };
+	QTableWidget* Table { nullptr };
 	QVBoxLayout* LayerPaletteLayout { nullptr };
 	QHBoxLayout* Layout1 { nullptr };
 	QHBoxLayout* layout1 { nullptr };
@@ -83,6 +83,7 @@
 	QToolButton* deleteLayerButton { nullptr };
 	QToolButton* raiseLayerButton { nullptr };
 	QToolButton* lowerLayerButton { nullptr };
+
 	ScLayers *layers { nullptr };
 
 	void changeEvent(QEvent *e) override;




More information about the scribus-commit mailing list