r15504 by craig - #9386: StyleManager Line Style widget does not change units

scribus-commit scribus-commit at lists.scribus.net
Thu Oct 7 22:26:27 CEST 2010


Author: craig
Date: Thu Oct  7 20:26:27 2010
New Revision: 15504

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15504
Log:
#9386: StyleManager Line Style widget does not change units

Modified:
    trunk/Scribus/scribus/ui/smlinestyle.cpp
    trunk/Scribus/scribus/ui/smlinestyle.h
    trunk/Scribus/scribus/ui/smlinestylewidget.cpp
    trunk/Scribus/scribus/ui/smlinestylewidget.h
    trunk/Scribus/scribus/ui/smpstylewidget.h

Modified: trunk/Scribus/scribus/ui/smlinestyle.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15504&path=/trunk/Scribus/scribus/ui/smlinestyle.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smlinestyle.cpp (original)
+++ trunk/Scribus/scribus/ui/smlinestyle.cpp Thu Oct  7 20:26:27 2010
@@ -20,7 +20,7 @@
 #include "util.h"
 
 
-SMLineStyle::SMLineStyle() : StyleItem(), doc_(0), widget_(0), twidget_(0), selectionIsDirty_(false)
+SMLineStyle::SMLineStyle() : StyleItem(), doc_(0), widget_(0), twidget_(0), selectionIsDirty_(false), unitRatio_(1.0)
 {
 	
 }
@@ -55,6 +55,11 @@
 	{
 		tmpLines = doc_->MLineStyles;
 		selection_.clear();
+		if (widget_)
+		{
+			if (unitRatio_ != doc_->unitRatio())
+				unitChange();
+		}
 	}
 	else
 	{
@@ -369,7 +374,10 @@
 
 void SMLineStyle::unitChange()
 {
-
+	double oldRatio = unitRatio_;
+	unitRatio_ = doc_->unitRatio();
+	if (widget_)
+		widget_->unitChange(oldRatio, unitRatio_, doc_->unitIndex());
 }
 
 void SMLineStyle::setupConnections()

Modified: trunk/Scribus/scribus/ui/smlinestyle.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15504&path=/trunk/Scribus/scribus/ui/smlinestyle.h
==============================================================================
--- trunk/Scribus/scribus/ui/smlinestyle.h (original)
+++ trunk/Scribus/scribus/ui/smlinestyle.h Thu Oct  7 20:26:27 2010
@@ -58,6 +58,7 @@
 	QTabWidget               *twidget_;
 	QMap<QString, multiLine>  tmpLines;
 	bool                      selectionIsDirty_;
+	double unitRatio_;
 	QMap<QString, multiLine*> selection_;
 	QList<RemoveItem>         deleted_;
 	int                       currentLine_;

Modified: trunk/Scribus/scribus/ui/smlinestylewidget.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15504&path=/trunk/Scribus/scribus/ui/smlinestylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smlinestylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smlinestylewidget.cpp Thu Oct  7 20:26:27 2010
@@ -71,8 +71,12 @@
 /***********************************/
 /*      End Tooltips               */
 /***********************************/
+}
 
 
+void SMLineStyleWidget::unitChange(double oldRatio, double newRatio, int unitIndex)
+{
+	lineWidth->setNewUnit(unitIndex);
 }
 
 void SMLineStyleWidget::showStyle(const multiLine &lineStyle, ColorList &colorList, int subLine)
@@ -145,7 +149,7 @@
 	for (multiLine::iterator it = currentStyle.begin(); it != currentStyle.end(); ++it)
 	{
 		pm2 = getWidePixmap(getColor((*it).Color, (*it).Shade));
-		tmp2 = " "+tmp.setNum((*it).Width)+ tr(" pt")+" ";
+		tmp2 = " "+tmp.setNum((*it).Width)+ lineWidth->suffix()+" ";
 		if ((*it).Dash < 6)
 			tmp2 += CommonStrings::translatePenStyleName(static_cast<Qt::PenStyle>((*it).Dash));
 		tmp2 += " ";

Modified: trunk/Scribus/scribus/ui/smlinestylewidget.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15504&path=/trunk/Scribus/scribus/ui/smlinestylewidget.h
==============================================================================
--- trunk/Scribus/scribus/ui/smlinestylewidget.h (original)
+++ trunk/Scribus/scribus/ui/smlinestylewidget.h Thu Oct  7 20:26:27 2010
@@ -29,6 +29,7 @@
 	
 	void showStyle(const multiLine &lineStyle, ColorList &colorList, int subLine = 0);
 	void languageChange();
+	void unitChange(double oldRatio, double newRatio, int unitIndex);
 
 private:
 	LineCombo *dashCombo;

Modified: trunk/Scribus/scribus/ui/smpstylewidget.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15504&path=/trunk/Scribus/scribus/ui/smpstylewidget.h
==============================================================================
--- trunk/Scribus/scribus/ui/smpstylewidget.h (original)
+++ trunk/Scribus/scribus/ui/smpstylewidget.h Thu Oct  7 20:26:27 2010
@@ -28,9 +28,7 @@
 	void show(QList<ParagraphStyle*> &pstyles, QList<ParagraphStyle> &pstylesAll, QList<CharStyle> &cstyles, int unitIndex, const QString &defLang);
 
 	void clearAll();
-
 	void languageChange();
-
 	void unitChange(double oldRatio, double newRatio, int unitIndex);
 
 private:




More information about the scribus-commit mailing list