r18799 by fschmid - Experimental new Design for Property Palette Widgets. Looks and feels like the QtDesigner PropertyEditor Window.

scribus-commit scribus-commit at lists.scribus.net
Wed Feb 5 20:33:49 UTC 2014


Author: fschmid
Date: Wed Feb  5 20:33:49 2014
New Revision: 18799

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18799
Log:
Experimental new Design for Property Palette Widgets. Looks and feels like the QtDesigner PropertyEditor Window.
Can be removed easily if it isn't accepted.

Added:
    trunk/Scribus/scribus/ui/proptree.cpp
    trunk/Scribus/scribus/ui/proptree.h
Modified:
    trunk/Scribus/scribus/CMakeLists.txt
    trunk/Scribus/scribus/ui/propertiespalette_shadow.cpp
    trunk/Scribus/scribus/ui/propertiespalette_shadow.h
    trunk/Scribus/scribus/ui/sctreewidget.cpp

Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18799&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Wed Feb  5 20:33:49 2014
@@ -138,7 +138,7 @@
   ui/propertiespalette_groupbase.ui
   ui/propertiespalette_imagebase.ui
   ui/propertiespalette_linebase.ui
-  ui/propertiespalette_shadowbase.ui
+#  ui/propertiespalette_shadowbase.ui
   ui/propertiespalette_shapebase.ui
   ui/propertiespalette_tablebase.ui
   ui/propertiespalette_textbase.ui
@@ -419,6 +419,7 @@
   ui/propertywidget_orphans.h
   ui/propertywidget_pathtext.h
   ui/propertywidget_textcolor.h
+  ui/proptree.h
   ui/query.h
   ui/replacecolors.h
   ui/replaceonecolor.h
@@ -867,6 +868,7 @@
   ui/propertywidget_pathtext.cpp
   ui/propertywidget_textcolor.cpp
   ui/propertywidgetbase.cpp
+  ui/proptree.cpp
   ui/query.cpp
   ui/replacecolors.cpp
   ui/replaceonecolor.cpp

Modified: trunk/Scribus/scribus/ui/propertiespalette_shadow.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18799&path=/trunk/Scribus/scribus/ui/propertiespalette_shadow.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_shadow.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_shadow.cpp Wed Feb  5 20:33:49 2014
@@ -15,7 +15,6 @@
 #include "sccolorengine.h"
 #include "pageitem.h"
 #include "propertiespalette_utils.h"
-#include "sccombobox.h"
 #include "scribus.h"
 #include "scribuscore.h"
 #include "scraction.h"
@@ -27,17 +26,455 @@
 #include "util_icon.h"
 #include "util_math.h"
 
-PropertiesPalette_Shadow::PropertiesPalette_Shadow( QWidget* parent) : QWidget(parent)
+PropertiesPalette_Shadow::PropertiesPalette_Shadow( QWidget* parent) : PropTreeWidget(parent)
 {
 	m_ScMW = 0;
 	m_doc = 0;
 	m_haveDoc  = false;
 	m_haveItem = false;
 	m_unitRatio = 1.0;
-
+	hasSoftShadow = new PropTreeItem(this, PropTreeItem::CheckBox, tr( "Has Drop Shadow"));
+	hasSoftShadow->setBoolValue(false);
+
+	softShadowXOffset = new PropTreeItem(this, PropTreeItem::DoubleSpinBox, tr( "X-Offset:"));
+	softShadowXOffset->setUnitValue(0);
+	softShadowXOffset->setDecimalsValue(2);
+	softShadowXOffset->setMinMaxValues(-200.0, 200.0);
+	softShadowXOffset->setDoubleValue(5.0);
+
+	softShadowYOffset = new PropTreeItem(this, PropTreeItem::DoubleSpinBox, tr( "Y-Offset:"));
+	softShadowYOffset->setUnitValue(0);
+	softShadowYOffset->setDecimalsValue(2);
+	softShadowYOffset->setMinMaxValues(-200.0, 200.0);
+	softShadowYOffset->setDoubleValue(5.0);
+
+	softShadowBlurRadius = new PropTreeItem(this, PropTreeItem::DoubleSpinBox, tr( "Blur:"));
+	softShadowBlurRadius->setUnitValue(0);
+	softShadowBlurRadius->setDecimalsValue(1);
+	softShadowBlurRadius->setMinMaxValues(-20.0, 20.0);
+	softShadowBlurRadius->setDoubleValue(2.0);
+
+	softShadowColor = new PropTreeItem(this, PropTreeItem::ColorCombo, tr( "Color:"));
+	softShadowColor->setStringValue( tr( "Black"));
+
+	softShadowShade = new PropTreeItem(this, PropTreeItem::IntSpinBox, tr( "Shade:"));
+	softShadowShade->setUnitValue(7);
+	softShadowShade->setDecimalsValue(0);
+	softShadowShade->setMinMaxValues(0, 100);
+	softShadowShade->setIntValue(100);
+
+	softShadowOpacity = new PropTreeItem(this, PropTreeItem::DoubleSpinBox, tr( "Opacity:"));
+	softShadowOpacity->setUnitValue(7);
+	softShadowOpacity->setDecimalsValue(1);
+	softShadowOpacity->setMinMaxValues(0.0, 100.0);
+	softShadowOpacity->setDoubleValue(100.0);
+
+	softShadowBlendMode = new PropTreeItem(this, PropTreeItem::ComboBox, tr( "Blendmode:"));
+	QStringList modes;
+	softShadowBlendMode->setComboStrings(modes);
+	softShadowBlendMode->setStringValue( tr( "Normal"));
+
+	languageChange();
+	m_haveItem = false;
+	setSizePolicy( QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum));
+	connect(hasSoftShadow, SIGNAL(valueChanged(bool)), this, SLOT(handleShadow(bool)));
+	connect(softShadowXOffset, SIGNAL(valueChanged(double)), this, SLOT(handleNewXOffset(double)));
+	connect(softShadowYOffset, SIGNAL(valueChanged(double)), this, SLOT(handleNewYOffset(double)));
+	connect(softShadowBlurRadius, SIGNAL(valueChanged(double)), this, SLOT(handleNewBlur(double)));
+	connect(softShadowColor, SIGNAL(valueChanged(QString)), this, SLOT(handleNewColor(QString)));
+	connect(softShadowShade, SIGNAL(valueChanged(double)), this, SLOT(handleNewShade(double)));
+	connect(softShadowOpacity, SIGNAL(valueChanged(double)), this, SLOT(handleNewOpacity(double)));
+	connect(softShadowBlendMode, SIGNAL(valueChanged(int)), this, SLOT(handleNewBlendmode(int)));
+
+	m_haveItem = false;
+}
+
+void PropertiesPalette_Shadow::setMainWindow(ScribusMainWindow* mw)
+{
+	m_ScMW = mw;
+	connect(m_ScMW, SIGNAL(UpdateRequest(int)), this, SLOT(handleUpdateRequest(int)));
+}
+
+void PropertiesPalette_Shadow::setDoc(ScribusDoc *d)
+{
+	if((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning()))
+		return;
+
+	if (m_doc)
+	{
+		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+	}
+
+	m_doc  = d;
+	m_item = NULL;
+	m_unitRatio   = m_doc->unitRatio();
+	m_unitIndex   = m_doc->unitIndex();
+	int precision = unitGetPrecisionFromIndex(m_unitIndex);
+	double maxXYWHVal =  200 * m_unitRatio;
+	double minXYVal   = -200 * m_unitRatio;
+
+	m_haveDoc = true;
+	m_haveItem = false;
+	softShadowXOffset->setUnitValue(m_unitIndex);
+	softShadowXOffset->setDecimalsValue(precision);
+	softShadowXOffset->setMinMaxValues(minXYVal, maxXYWHVal);
+	softShadowXOffset->setDoubleValue(minXYVal);
+
+	softShadowYOffset->setUnitValue(m_unitIndex);
+	softShadowYOffset->setDecimalsValue(precision);
+	softShadowYOffset->setMinMaxValues(minXYVal, maxXYWHVal);
+	softShadowYOffset->setDoubleValue(minXYVal);
+
+	softShadowBlurRadius->setUnitValue(m_unitIndex);
+	softShadowBlurRadius->setDecimalsValue(1);
+	softShadowBlurRadius->setMinMaxValues(0.0, 20.0);
+	softShadowBlurRadius->setDoubleValue(5);
+
+	softShadowShade->setDecimalsValue(0);
+	softShadowShade->setMinMaxValues(0, 100);
+	softShadowShade->setIntValue(100);
+
+	softShadowOpacity->setDecimalsValue(0);
+	softShadowOpacity->setMinMaxValues(0, 100);
+	softShadowOpacity->setIntValue(100);
+	updateColorList();
+
+	connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+	connect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+}
+
+void PropertiesPalette_Shadow::unsetDoc()
+{
+	if (m_doc)
+	{
+		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+	}
+	m_haveDoc  = false;
+	m_haveItem = false;
+	m_doc   = NULL;
+	m_item  = NULL;
+	setEnabled(false);
+}
+
+void PropertiesPalette_Shadow::unsetItem()
+{
+	m_haveItem = false;
+	m_item     = NULL;
+	handleSelectionChanged();
+}
+
+void PropertiesPalette_Shadow::handleUpdateRequest(int updateFlags)
+{
+	if (updateFlags & reqColorsUpdate)
+		updateColorList();
+}
+
+PageItem* PropertiesPalette_Shadow::currentItemFromSelection()
+{
+	PageItem *currentItem = NULL;
+	if (m_doc)
+	{
+		if (m_doc->m_Selection->count() > 1)
+			currentItem = m_doc->m_Selection->itemAt(0);
+		else if (m_doc->m_Selection->count() == 1)
+			currentItem = m_doc->m_Selection->itemAt(0);
+	}
+	return currentItem;
+}
+
+void PropertiesPalette_Shadow::setCurrentItem(PageItem *i)
+{
+	if (!m_ScMW || m_ScMW->scriptIsRunning())
+		return;
+	if (!m_doc)
+		setDoc(i->doc());
+	m_haveItem = false;
+	m_item = i;
+	hasSoftShadow->setBoolValue(i->hasSoftShadow());
+	softShadowXOffset->setDoubleValue(i->softShadowXOffset() * m_unitRatio);
+	softShadowYOffset->setDoubleValue(i->softShadowYOffset() * m_unitRatio);
+	softShadowBlurRadius->setDoubleValue(i->softShadowBlurRadius() * m_unitRatio);
+	softShadowColor->setStringValue(i->softShadowColor());
+	softShadowShade->setIntValue(i->softShadowShade());
+	softShadowOpacity->setDoubleValue(qRound(100 - (i->softShadowOpacity() * 100)));
+	softShadowBlendMode->setIntValue(i->softShadowBlendMode());
+	m_haveItem = true;
+	updateSpinBoxConstants();
+}
+
+void PropertiesPalette_Shadow::handleSelectionChanged()
+{
+	if (!m_haveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
+		return;
+
+	PageItem* currItem = currentItemFromSelection();
+	if (currItem)
+		setCurrentItem(currItem);
+	updateGeometry();
+}
+
+void PropertiesPalette_Shadow::unitChange()
+{
+	if (!m_haveDoc)
+		return;
+	m_unitRatio = m_doc->unitRatio();
+	m_unitIndex = m_doc->unitIndex();
+	softShadowXOffset->setUnitValue(m_unitIndex);
+	softShadowYOffset->setUnitValue(m_unitIndex);
+	softShadowBlurRadius->setUnitValue(m_unitIndex);
+}
+
+void PropertiesPalette_Shadow::updateColorList()
+{
+	if (!m_haveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
+		return;
+	softShadowColor->setColorList(m_doc->PageColors);
+}
+
+void PropertiesPalette_Shadow::handleNewValues()
+{
+	if (m_haveItem)
+	{
+		double x = softShadowXOffset->valueAsDouble() / m_unitRatio;
+		double y = softShadowYOffset->valueAsDouble() / m_unitRatio;
+		double r = softShadowBlurRadius->valueAsDouble() / m_unitRatio;
+		QString color = softShadowColor->valueAsString();
+		if (color == CommonStrings::tr_NoneColor)
+			color = CommonStrings::None;
+		int b = softShadowBlendMode->valueAsInt();
+		double o = (100 - softShadowOpacity->valueAsDouble()) / 100.0;
+		int s = softShadowShade->valueAsInt();
+		if (m_haveDoc)
+		{
+			m_doc->itemSelection_SetSoftShadow(hasSoftShadow->valueAsBool(), color, x, y, r, s, o, b);
+		}
+	}
+}
+
+void PropertiesPalette_Shadow::handleShadow(bool value)
+{
+	if (m_haveItem)
+	{
+		double x = softShadowXOffset->valueAsDouble() / m_unitRatio;
+		double y = softShadowYOffset->valueAsDouble() / m_unitRatio;
+		double r = softShadowBlurRadius->valueAsDouble() / m_unitRatio;
+		QString color = softShadowColor->valueAsString();
+		if (color == CommonStrings::tr_NoneColor)
+			color = CommonStrings::None;
+		int b = softShadowBlendMode->valueAsInt();
+		double o = (100 - softShadowOpacity->valueAsDouble()) / 100.0;
+		int s = softShadowShade->valueAsInt();
+		if (m_haveDoc)
+		{
+			m_doc->itemSelection_SetSoftShadow(value, color, x, y, r, s, o, b);
+		}
+	}
+}
+
+void PropertiesPalette_Shadow::handleNewXOffset(double value)
+{
+	if (m_haveItem)
+	{
+		double x = value / m_unitRatio;
+		double y = softShadowYOffset->valueAsDouble() / m_unitRatio;
+		double r = softShadowBlurRadius->valueAsDouble() / m_unitRatio;
+		QString color = softShadowColor->valueAsString();
+		if (color == CommonStrings::tr_NoneColor)
+			color = CommonStrings::None;
+		int b = softShadowBlendMode->valueAsInt();
+		double o = (100 - softShadowOpacity->valueAsInt()) / 100.0;
+		int s = softShadowShade->valueAsInt();
+		if (m_haveDoc)
+		{
+			m_doc->itemSelection_SetSoftShadow(hasSoftShadow->valueAsBool(), color, x, y, r, s, o, b);
+		}
+	}
+}
+
+void PropertiesPalette_Shadow::handleNewYOffset(double value)
+{
+	if (m_haveItem)
+	{
+		double x = softShadowXOffset->valueAsDouble() / m_unitRatio;
+		double y = value / m_unitRatio;
+		double r = softShadowBlurRadius->valueAsDouble() / m_unitRatio;
+		QString color = softShadowColor->valueAsString();
+		if (color == CommonStrings::tr_NoneColor)
+			color = CommonStrings::None;
+		int b = softShadowBlendMode->valueAsInt();
+		double o = (100 - softShadowOpacity->valueAsInt()) / 100.0;
+		int s = softShadowShade->valueAsInt();
+		if (m_haveDoc)
+		{
+			m_doc->itemSelection_SetSoftShadow(hasSoftShadow->valueAsBool(), color, x, y, r, s, o, b);
+		}
+	}
+}
+
+void PropertiesPalette_Shadow::handleNewBlur(double value)
+{
+	if (m_haveItem)
+	{
+		double x = softShadowXOffset->valueAsDouble() / m_unitRatio;
+		double y = softShadowYOffset->valueAsDouble() / m_unitRatio;
+		double r = value / m_unitRatio;
+		QString color = softShadowColor->valueAsString();
+		if (color == CommonStrings::tr_NoneColor)
+			color = CommonStrings::None;
+		int b = softShadowBlendMode->valueAsInt();
+		double o = (100 - softShadowOpacity->valueAsDouble()) / 100.0;
+		int s = softShadowShade->valueAsInt();
+		if (m_haveDoc)
+		{
+			m_doc->itemSelection_SetSoftShadow(hasSoftShadow->valueAsBool(), color, x, y, r, s, o, b);
+		}
+	}
+}
+
+void PropertiesPalette_Shadow::handleNewColor(QString value)
+{
+	if (m_haveItem)
+	{
+		double x = softShadowXOffset->valueAsDouble() / m_unitRatio;
+		double y = softShadowYOffset->valueAsDouble() / m_unitRatio;
+		double r = softShadowBlurRadius->valueAsDouble() / m_unitRatio;
+		QString color = value;
+		if (color == CommonStrings::tr_NoneColor)
+			color = CommonStrings::None;
+		int b = softShadowBlendMode->valueAsInt();
+		double o = (100 - softShadowOpacity->valueAsDouble()) / 100.0;
+		int s = softShadowShade->valueAsInt();
+		if (m_haveDoc)
+		{
+			m_doc->itemSelection_SetSoftShadow(hasSoftShadow->valueAsBool(), color, x, y, r, s, o, b);
+		}
+	}
+}
+
+void PropertiesPalette_Shadow::handleNewShade(double value)
+{
+	if (m_haveItem)
+	{
+		double x = softShadowXOffset->valueAsDouble() / m_unitRatio;
+		double y = softShadowYOffset->valueAsDouble() / m_unitRatio;
+		double r = softShadowBlurRadius->valueAsDouble() / m_unitRatio;
+		QString color = softShadowColor->valueAsString();
+		if (color == CommonStrings::tr_NoneColor)
+			color = CommonStrings::None;
+		int b = softShadowBlendMode->valueAsInt();
+		double o = (100 - softShadowOpacity->valueAsDouble()) / 100.0;
+		int s = qRound(value);
+		if (m_haveDoc)
+		{
+			m_doc->itemSelection_SetSoftShadow(hasSoftShadow->valueAsBool(), color, x, y, r, s, o, b);
+		}
+	}
+}
+
+void PropertiesPalette_Shadow::handleNewOpacity(double value)
+{
+	if (m_haveItem)
+	{
+		double x = softShadowXOffset->valueAsDouble() / m_unitRatio;
+		double y = softShadowYOffset->valueAsDouble() / m_unitRatio;
+		double r = softShadowBlurRadius->valueAsDouble() / m_unitRatio;
+		QString color = softShadowColor->valueAsString();
+		if (color == CommonStrings::tr_NoneColor)
+			color = CommonStrings::None;
+		int b = softShadowBlendMode->valueAsInt();
+		double o = (100 - value) / 100.0;
+		int s = softShadowShade->valueAsInt();
+		if (m_haveDoc)
+		{
+			m_doc->itemSelection_SetSoftShadow(hasSoftShadow->valueAsBool(), color, x, y, r, s, o, b);
+		}
+	}
+}
+
+void PropertiesPalette_Shadow::handleNewBlendmode(int value)
+{
+	if (m_haveItem)
+	{
+		double x = softShadowXOffset->valueAsDouble() / m_unitRatio;
+		double y = softShadowYOffset->valueAsDouble() / m_unitRatio;
+		double r = softShadowBlurRadius->valueAsDouble() / m_unitRatio;
+		QString color = softShadowColor->valueAsString();
+		if (color == CommonStrings::tr_NoneColor)
+			color = CommonStrings::None;
+		int b = value;
+		double o = (100 - softShadowOpacity->valueAsDouble()) / 100.0;
+		int s = softShadowShade->valueAsInt();
+		if (m_haveDoc)
+		{
+			m_doc->itemSelection_SetSoftShadow(hasSoftShadow->valueAsBool(), color, x, y, r, s, o, b);
+		}
+	}
+}
+
+void PropertiesPalette_Shadow::changeEvent(QEvent *e)
+{
+	if (e->type() == QEvent::LanguageChange)
+	{
+		languageChange();
+	}
+	else
+		QWidget::changeEvent(e);
+}
+
+void PropertiesPalette_Shadow::languageChange()
+{
+	hasSoftShadow->setText(0, tr( "Has Drop Shadow"));
+	softShadowXOffset->setText(0, tr( "X-Offset:"));
+	softShadowYOffset->setText(0, tr( "Y-Offset:"));
+	softShadowBlurRadius->setText(0, tr( "Blur:"));
+	softShadowColor->setText(0, tr( "Color:"));
+	softShadowShade->setText(0, tr( "Shade:"));
+	softShadowOpacity->setText(0, tr( "Opacity:"));
+	QStringList modes;
+	modes.append( tr("Normal"));
+	modes.append( tr("Darken"));
+	modes.append( tr("Lighten"));
+	modes.append( tr("Multiply"));
+	modes.append( tr("Screen"));
+	modes.append( tr("Overlay"));
+	modes.append( tr("Hard Light"));
+	modes.append( tr("Soft Light"));
+	modes.append( tr("Difference"));
+	modes.append( tr("Exclusion"));
+	modes.append( tr("Color Dodge"));
+	modes.append( tr("Color Burn"));
+	modes.append( tr("Hue"));
+	modes.append( tr("Saturation"));
+	modes.append( tr("Color"));
+	modes.append( tr("Luminosity"));
+	softShadowBlendMode->setComboStrings(modes);
+	softShadowBlendMode->setStringValue( tr("Normal"));
+	softShadowBlendMode->setText(0, tr( "Blendmode:"));
+}
+
+void PropertiesPalette_Shadow::updateSpinBoxConstants()
+{
+	if (!m_haveDoc)
+		return;
+	if(m_doc->m_Selection->count()==0)
+		return;
+//	softShadowXOffset->setConstants(&m_doc->constants());
+//	softShadowYOffset->setConstants(&m_doc->constants());
+
+}
+
+/*
+PropertiesPalette_Shadow::PropertiesPalette_Shadow( QWidget* parent) : QWidget(parent)
+{
+	m_ScMW = 0;
+	m_doc = 0;
+	m_haveDoc  = false;
+	m_haveItem = false;
+	m_unitRatio = 1.0;
 	setupUi(this);
 	setSizePolicy( QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum));
-
 	_userActionOn = false;
 	userActionSniffer = new UserActionSniffer(this);
 	connect(userActionSniffer, SIGNAL(actionStart()), this, SLOT(spinboxStartUserAction()));
@@ -321,5 +758,5 @@
 		return;
 	softShadowXOffset->setConstants(&m_doc->constants());
 	softShadowYOffset->setConstants(&m_doc->constants());
-
-}
+}
+*/

Modified: trunk/Scribus/scribus/ui/propertiespalette_shadow.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18799&path=/trunk/Scribus/scribus/ui/propertiespalette_shadow.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_shadow.h (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_shadow.h Wed Feb  5 20:33:49 2014
@@ -7,6 +7,80 @@
 #ifndef PROPERTIESPALETTE_SHADOW_H
 #define PROPERTIESPALETTE_SHADOW_H
 
+#include "scribusapi.h"
+#include "scguardedptr.h"
+
+#include "proptree.h"
+#include <QVBoxLayout>
+
+class PageItem;
+class ScribusDoc;
+class Selection;
+class ScribusMainWindow;
+
+class SCRIBUS_API PropertiesPalette_Shadow : public PropTreeWidget
+{
+	Q_OBJECT
+
+public:
+	PropertiesPalette_Shadow(QWidget* parent);
+	~PropertiesPalette_Shadow() {};
+
+	virtual void changeEvent(QEvent *e);
+	void updateColorList();
+
+private:
+
+	PageItem* currentItemFromSelection();
+
+public slots:
+	void setMainWindow(ScribusMainWindow *mw);
+
+	void setDoc(ScribusDoc *d);
+	void setCurrentItem(PageItem *i);
+	void unsetDoc();
+	void unsetItem();
+
+	void languageChange();
+	void unitChange();
+	void handleSelectionChanged();
+	void handleUpdateRequest(int);
+
+private slots:
+	void handleNewValues();
+	void handleShadow(bool value);
+	void handleNewXOffset(double value);
+	void handleNewYOffset(double value);
+	void handleNewBlur(double value);
+	void handleNewColor(QString value);
+	void handleNewShade(double value);
+	void handleNewOpacity(double value);
+	void handleNewBlendmode(int value);
+
+protected slots:
+	void updateSpinBoxConstants();
+
+protected:
+	PropTreeItem *hasSoftShadow;
+	PropTreeItem *softShadowXOffset;
+	PropTreeItem *softShadowYOffset;
+	PropTreeItem *softShadowBlurRadius;
+	PropTreeItem *colorProps;
+	PropTreeItem *softShadowColor;
+	PropTreeItem *softShadowShade;
+	PropTreeItem *softShadowOpacity;
+	PropTreeItem *softShadowBlendMode;
+	ScribusMainWindow *m_ScMW;
+
+	bool      m_haveDoc;
+	bool      m_haveItem;
+	double    m_unitRatio;
+	int       m_unitIndex;
+	PageItem *m_item;
+	ScGuardedPtr<ScribusDoc> m_doc;
+};
+
+/*
 #include "ui_propertiespalette_shadowbase.h"
 
 #include "scribusapi.h"
@@ -30,7 +104,7 @@
 
 	virtual void changeEvent(QEvent *e);
 
-	/** @brief Returns true if there is a user action going on at the moment of call. */
+//	 @brief Returns true if there is a user action going on at the moment of call.
 	bool userActionOn(); // not yet implemented!!! This is needed badly.
                          // When user releases the mouse button or arrow key, changes must be checked
                          // and if in ScribusView a groupTransaction has been started it must be also
@@ -76,5 +150,5 @@
 	UserActionSniffer *userActionSniffer;
 	void installSniffer(ScrSpinBox *spinBox);
 };
-
+*/
 #endif

Modified: trunk/Scribus/scribus/ui/sctreewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18799&path=/trunk/Scribus/scribus/ui/sctreewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/sctreewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/sctreewidget.cpp Wed Feb  5 20:33:49 2014
@@ -29,7 +29,6 @@
 #include <QShortcutEvent>
 
 #include "sctreewidget.h"
-
 
 ScTreeWidgetDelegate::ScTreeWidgetDelegate(QTreeWidget *view, QWidget *parent) : QItemDelegate(parent), m_view(view)
 {
@@ -130,9 +129,12 @@
 	QTreeWidgetItem *item2 = new QTreeWidgetItem(item1);
 	item2->setFlags(Qt::ItemIsEnabled);
 // hack to work around a bug in Qt-4.3.4
-	widget->layout()->activate();
-	widget->setMinimumSize(widget->layout()->minimumSize());
-	item2->setSizeHint(0, widget->layout()->minimumSize());
+	if (widget->layout())
+	{
+		widget->layout()->activate();
+		widget->setMinimumSize(widget->layout()->minimumSize());
+		item2->setSizeHint(0, widget->layout()->minimumSize());
+	}
 // end hack
 	setItemWidget(item2, 0, widget);
 	QKeySequence newMnemonic = QKeySequence::mnemonic(title);




More information about the scribus-commit mailing list