r15503 by craig - #9386: StyleManager Line Style widget does not change units
scribus-commit
scribus-commit at lists.scribus.net
Thu Oct 7 22:26:21 CEST 2010
Author: craig
Date: Thu Oct 7 20:26:21 2010
New Revision: 15503
URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15503
Log:
#9386: StyleManager Line Style widget does not change units
Modified:
branches/Version135/Scribus/scribus/smlinestyle.cpp
branches/Version135/Scribus/scribus/smlinestyle.h
branches/Version135/Scribus/scribus/smlinestylewidget.cpp
branches/Version135/Scribus/scribus/smlinestylewidget.h
branches/Version135/Scribus/scribus/smpstylewidget.h
Modified: branches/Version135/Scribus/scribus/smlinestyle.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15503&path=/branches/Version135/Scribus/scribus/smlinestyle.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/smlinestyle.cpp (original)
+++ branches/Version135/Scribus/scribus/smlinestyle.cpp Thu Oct 7 20:26:21 2010
@@ -19,7 +19,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)
{
}
@@ -54,6 +54,11 @@
{
tmpLines = doc_->MLineStyles;
selection_.clear();
+ if (widget_)
+ {
+ if (unitRatio_ != doc_->unitRatio())
+ unitChange();
+ }
}
else
{
@@ -368,7 +373,10 @@
void SMLineStyle::unitChange()
{
-
+ double oldRatio = unitRatio_;
+ unitRatio_ = doc_->unitRatio();
+ if (widget_)
+ widget_->unitChange(oldRatio, unitRatio_, doc_->unitIndex());
}
void SMLineStyle::setupConnections()
Modified: branches/Version135/Scribus/scribus/smlinestyle.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15503&path=/branches/Version135/Scribus/scribus/smlinestyle.h
==============================================================================
--- branches/Version135/Scribus/scribus/smlinestyle.h (original)
+++ branches/Version135/Scribus/scribus/smlinestyle.h Thu Oct 7 20:26:21 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: branches/Version135/Scribus/scribus/smlinestylewidget.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15503&path=/branches/Version135/Scribus/scribus/smlinestylewidget.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/smlinestylewidget.cpp (original)
+++ branches/Version135/Scribus/scribus/smlinestylewidget.cpp Thu Oct 7 20:26:21 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: branches/Version135/Scribus/scribus/smlinestylewidget.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15503&path=/branches/Version135/Scribus/scribus/smlinestylewidget.h
==============================================================================
--- branches/Version135/Scribus/scribus/smlinestylewidget.h (original)
+++ branches/Version135/Scribus/scribus/smlinestylewidget.h Thu Oct 7 20:26:21 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: branches/Version135/Scribus/scribus/smpstylewidget.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15503&path=/branches/Version135/Scribus/scribus/smpstylewidget.h
==============================================================================
--- branches/Version135/Scribus/scribus/smpstylewidget.h (original)
+++ branches/Version135/Scribus/scribus/smpstylewidget.h Thu Oct 7 20:26:21 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