r17054 by fschmid - Made image stroke settings working in preferences.

scribus-commit scribus-commit at lists.scribus.net
Sat Dec 3 08:24:56 UTC 2011


Author: fschmid
Date: Sat Dec  3 08:24:55 2011
New Revision: 17054

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17054
Log:
Made image stroke settings working in preferences.

Modified:
    trunk/Scribus/scribus/canvasmode_create.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
    trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
    trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
    trunk/Scribus/scribus/prefsmanager.cpp
    trunk/Scribus/scribus/prefsstructs.h
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusview.cpp
    trunk/Scribus/scribus/ui/prefs_itemtools.cpp

Modified: trunk/Scribus/scribus/canvasmode_create.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17054&path=/trunk/Scribus/scribus/canvasmode_create.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_create.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_create.cpp Sat Dec  3 08:24:55 2011
@@ -657,15 +657,15 @@
 		break;
 	case modeDrawLatex:
 		if (modifiers == Qt::ShiftModifier)
-			z = m_doc->itemAddArea(PageItem::LatexFrame, PageItem::Unspecified, Rxp, Ryp, 1, m_doc->itemToolPrefs().imageFillColor, CommonStrings::None, true);
+			z = m_doc->itemAddArea(PageItem::LatexFrame, PageItem::Unspecified, Rxp, Ryp, 1, m_doc->itemToolPrefs().imageFillColor, m_doc->itemToolPrefs().imageStrokeColor, true);
 		else
-			z = m_doc->itemAdd(PageItem::LatexFrame, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().imageFillColor, CommonStrings::None, true);
+			z = m_doc->itemAdd(PageItem::LatexFrame, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().imageFillColor, m_doc->itemToolPrefs().imageStrokeColor, true);
 		break;
 	case modeDrawImage:
 		if (modifiers == Qt::ShiftModifier)
-			z = m_doc->itemAddArea(PageItem::ImageFrame, PageItem::Unspecified, Rxp, Ryp, 1, m_doc->itemToolPrefs().imageFillColor, CommonStrings::None, true);
+			z = m_doc->itemAddArea(PageItem::ImageFrame, PageItem::Unspecified, Rxp, Ryp, 1, m_doc->itemToolPrefs().imageFillColor, m_doc->itemToolPrefs().imageStrokeColor, true);
 		else
-			z = m_doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().imageFillColor, CommonStrings::None, true);
+			z = m_doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().imageFillColor, m_doc->itemToolPrefs().imageStrokeColor, true);
 		break;
 	case modeDrawText:
 		if (modifiers == Qt::ShiftModifier)
@@ -894,11 +894,11 @@
 	case modeInsertPDF3DAnnotation:
 		if (modifiers == Qt::ShiftModifier)
 		{
-			z = m_doc->itemAddArea(PageItem::OSGFrame, PageItem::Unspecified, Rxp, Ryp, 1, m_doc->itemToolPrefs().imageFillColor, CommonStrings::None, true);
+			z = m_doc->itemAddArea(PageItem::OSGFrame, PageItem::Unspecified, Rxp, Ryp, 1, m_doc->itemToolPrefs().imageFillColor, m_doc->itemToolPrefs().imageStrokeColor, true);
 		}
 		else
 		{
-			z = m_doc->itemAdd(PageItem::OSGFrame, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().imageFillColor, CommonStrings::None, true);
+			z = m_doc->itemAdd(PageItem::OSGFrame, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().imageFillColor, m_doc->itemToolPrefs().imageStrokeColor, true);
 		}
 		currItem = m_doc->Items->at(z);
 		currItem->setIsAnnotation(true);

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17054&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Sat Dec  3 08:24:55 2011
@@ -2071,6 +2071,9 @@
 	if (attrs.hasAttribute("CPICT"))
 		doc->itemToolPrefs().imageFillColor = attrs.valueAsString("CPICT");
 	doc->itemToolPrefs().imageFillColorShade = attrs.valueAsInt("PICTSHADE", 100);
+	if (attrs.hasAttribute("CSPICT"))
+		doc->itemToolPrefs().imageStrokeColor = attrs.valueAsString("CSPICT");
+	doc->itemToolPrefs().imageStrokeColorShade = attrs.valueAsInt("PICTSSHADE", 100);
 }
 
 void Scribus150Format::readTypographicSettings(ScribusDoc* doc, ScXmlStreamAttributes& attrs)
@@ -3695,7 +3698,7 @@
 	case PageItem::ImageFrame:
 	case PageItem::OSGFrame:
 	case PageItem::LatexFrame: /*Everything that is valid for image frames is also valid for latex frames*/
-		z = doc->itemAdd(pt, PageItem::Unspecified, x, y, w, h, 1, doc->itemToolPrefs().imageFillColor, CommonStrings::None, true);
+		z = doc->itemAdd(pt, PageItem::Unspecified, x, y, w, h, 1, doc->itemToolPrefs().imageFillColor, doc->itemToolPrefs().imageStrokeColor, true);
 		currItem = doc->Items->at(z);
 		if (pagenr > -2) 
 			currItem->OwnPage = pagenr;

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17054&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Sat Dec  3 08:24:55 2011
@@ -319,6 +319,8 @@
 	docu.writeAttribute("MAGSTEP",m_Doc->opToolPrefs().magStep);
 	docu.writeAttribute("CPICT",m_Doc->itemToolPrefs().imageFillColor);
 	docu.writeAttribute("PICTSHADE",m_Doc->itemToolPrefs().imageFillColorShade);
+	docu.writeAttribute("CSPICT",m_Doc->itemToolPrefs().imageStrokeColor);
+	docu.writeAttribute("PICTSSHADE",m_Doc->itemToolPrefs().imageStrokeColorShade);
 	docu.writeAttribute("PICTSCX",m_Doc->itemToolPrefs().imageScaleX);
 	docu.writeAttribute("PICTSCY",m_Doc->itemToolPrefs().imageScaleY);
 	docu.writeAttribute("PSCALE", static_cast<int>(m_Doc->itemToolPrefs().imageScaleType));

Modified: trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17054&path=/trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pct/importpct.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pct/importpct.cpp Sat Dec  3 08:24:55 2011
@@ -1759,7 +1759,7 @@
 		image = image.convertToFormat(QImage::Format_ARGB32);
 		if (!isPixmap)
 			image.invertPixels();
-		int z = m_Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, baseX + dstRect.left(), baseY + dstRect.top(), imgCols, imgRows, 0, m_Doc->itemToolPrefs().imageFillColor, CommonStrings::None, true);
+		int z = m_Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, baseX + dstRect.left(), baseY + dstRect.top(), imgCols, imgRows, 0, m_Doc->itemToolPrefs().imageFillColor, m_Doc->itemToolPrefs().imageStrokeColor, true);
 		PageItem *ite = m_Doc->Items->at(z);
 		ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pct_XXXXXX.png");
 		ite->tempImageFile->open();

Modified: trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17054&path=/trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp Sat Dec  3 08:24:55 2011
@@ -1451,7 +1451,7 @@
 	double h = e.attribute( "height" ).isEmpty() ? 1.0 : parseUnit( e.attribute( "height" ) );
 	setupNode(e);
 	parseClipPathAttr(e, clipPath);
-	int z = m_Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, x+BaseX, y+BaseY, w, h, 1, m_Doc->itemToolPrefs().imageFillColor, CommonStrings::None, true);
+	int z = m_Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, x+BaseX, y+BaseY, w, h, 1, m_Doc->itemToolPrefs().imageFillColor, m_Doc->itemToolPrefs().imageStrokeColor, true);
 	PageItem* ite = m_Doc->Items->at(z);
 	if (!fname.isEmpty())
 	{

Modified: trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17054&path=/trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp Sat Dec  3 08:24:55 2011
@@ -393,7 +393,7 @@
 	}
 	double w = (bitmap.rect.x2 - bitmap.rect.x1) * 72.0;
 	double h = (bitmap.rect.y2 - bitmap.rect.y1) * 72.0;
-	int z = m_Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, bitmap.rect.x1 * 72 + baseX, bitmap.rect.y1 * 72 + baseY, w, h, 1, m_Doc->itemToolPrefs().imageFillColor, CommonStrings::None, true);
+	int z = m_Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, bitmap.rect.x1 * 72 + baseX, bitmap.rect.y1 * 72 + baseY, w, h, 1, m_Doc->itemToolPrefs().imageFillColor, m_Doc->itemToolPrefs().imageStrokeColor, true);
 	PageItem *ite = m_Doc->Items->at(z);
 	ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_wpg_XXXXXX.png");
 	ite->tempImageFile->open();

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17054&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp Sat Dec  3 08:24:55 2011
@@ -84,7 +84,7 @@
 									ValueToPoint(w),
 									ValueToPoint(h),
 									1, ScCore->primaryMainWindow()->doc->itemToolPrefs().imageFillColor,
-									CommonStrings::None, true);
+									ScCore->primaryMainWindow()->doc->itemToolPrefs().imageStrokeColor, true);
 	if (Name != EMPTY_STRING)
 	{
 		QString objName = QString::fromUtf8(Name);

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17054&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Sat Dec  3 08:24:55 2011
@@ -257,10 +257,6 @@
 	appPrefs.opToolPrefs.magMin = 1;
 	appPrefs.opToolPrefs.magMax = 3200;
 	appPrefs.opToolPrefs.magStep = 200;
-	appPrefs.itemToolPrefs.imageFillColor = CommonStrings::None;
-	appPrefs.itemToolPrefs.imageFillColorShade = 100;
-	appPrefs.itemToolPrefs.imageScaleX = 1;
-	appPrefs.itemToolPrefs.imageScaleY = 1;
 	appPrefs.docSetupPrefs.docUnitIndex = 0;
 	appPrefs.itemToolPrefs.polyCorners = 4;
 	appPrefs.itemToolPrefs.polyFactor = 0.5;
@@ -274,6 +270,17 @@
 	appPrefs.itemToolPrefs.spiralStartAngle = 0.0;
 	appPrefs.itemToolPrefs.spiralEndAngle = 1080.0;
 	appPrefs.itemToolPrefs.spiralFactor = 1.2;
+	// Image item prefs
+	appPrefs.itemToolPrefs.imageFillColor = CommonStrings::None;
+	appPrefs.itemToolPrefs.imageFillColorShade = 100;
+	appPrefs.itemToolPrefs.imageStrokeColor = CommonStrings::None;
+	appPrefs.itemToolPrefs.imageStrokeColorShade = 100;
+	appPrefs.itemToolPrefs.imageScaleX = 1;
+	appPrefs.itemToolPrefs.imageScaleY = 1;
+	appPrefs.itemToolPrefs.imageScaleType = true;
+	appPrefs.itemToolPrefs.imageAspectRatio = true;
+	appPrefs.itemToolPrefs.imageLowResType = 1;
+	appPrefs.itemToolPrefs.imageUseEmbeddedPath = false;
 //	appPrefs.PSize = 40;
 	appPrefs.printerPrefs.ClipMargin = false;
 	appPrefs.printerPrefs.GCRMode = false;
@@ -299,10 +306,6 @@
 	appPrefs.docSetupPrefs.bleeds.Left = 0;
 	appPrefs.docSetupPrefs.bleeds.Right = 0;
 	appPrefs.docSetupPrefs.bleeds.Bottom = 0;
-	appPrefs.itemToolPrefs.imageScaleType = true;
-	appPrefs.itemToolPrefs.imageAspectRatio = true;
-	appPrefs.itemToolPrefs.imageLowResType = 1;
-	appPrefs.itemToolPrefs.imageUseEmbeddedPath = false;
 	appPrefs.hyphPrefs.MinWordLen = 3;
 	appPrefs.hyphPrefs.HyCount = 2;
 	appPrefs.hyphPrefs.Language = "";
@@ -1106,6 +1109,8 @@
 		return true;
 	if (settings.imageFillColor == name)
 		return true;
+	if (settings.imageStrokeColor == name)
+		return true;
 	return false;
 }
 
@@ -1132,6 +1137,8 @@
 		names.append(settings.lineColor);
 	if (!names.contains(settings.imageFillColor))
 		names.append(settings.imageFillColor);
+	if (!names.contains(settings.imageStrokeColor))
+		names.append(settings.imageStrokeColor);
 	if (!names.contains(settings.calligrapicPenFillColor))
 		names.append(settings.calligrapicPenFillColor);
 	if (!names.contains(settings.calligrapicPenLineColor))
@@ -1162,6 +1169,8 @@
 		settings.lineColor = replaceMap[settings.lineColor];
 	if (replaceMap.contains(settings.imageFillColor))
 		settings.imageFillColor = replaceMap[settings.imageFillColor];
+	if (replaceMap.contains(settings.imageStrokeColor))
+		settings.imageStrokeColor = replaceMap[settings.imageStrokeColor];
 	if (replaceMap.contains(settings.calligrapicPenFillColor))
 		settings.calligrapicPenFillColor = replaceMap[settings.calligrapicPenFillColor];
 	if (replaceMap.contains(settings.calligrapicPenLineColor))
@@ -1196,6 +1205,9 @@
 	QString brushPict = appPrefs.itemToolPrefs.imageFillColor;
 	if (!tmpSet.contains(brushPict) && brushPict != CommonStrings::None)
 		tmpSet[brushPict] = appPrefs.colorPrefs.DColors[brushPict];
+	QString penPict = appPrefs.itemToolPrefs.imageStrokeColor;
+	if (!tmpSet.contains(penPict) && penPict != CommonStrings::None)
+		tmpSet[penPict] = appPrefs.colorPrefs.DColors[penPict];
 	QString brushCpen = appPrefs.itemToolPrefs.calligrapicPenFillColor;
 	if (!tmpSet.contains(brushCpen) && brushCpen != CommonStrings::None)
 		tmpSet[brushCpen] = appPrefs.colorPrefs.DColors[brushCpen];
@@ -1475,6 +1487,8 @@
 	dcItemTools.setAttribute("ShapeFillColorShade",appPrefs.itemToolPrefs.shapeFillColorShade);
 	dcItemTools.setAttribute("ImageFillColor",appPrefs.itemToolPrefs.imageFillColor);
 	dcItemTools.setAttribute("ImageFillColorShade",appPrefs.itemToolPrefs.imageFillColorShade);
+	dcItemTools.setAttribute("ImageStrokeColor",appPrefs.itemToolPrefs.imageStrokeColor);
+	dcItemTools.setAttribute("ImageStrokeColorShade",appPrefs.itemToolPrefs.imageStrokeColorShade);
 	dcItemTools.setAttribute("ImageScaleX",ScCLocale::toQStringC(appPrefs.itemToolPrefs.imageScaleX));
 	dcItemTools.setAttribute("ImageScaleY",ScCLocale::toQStringC(appPrefs.itemToolPrefs.imageScaleY));
 	dcItemTools.setAttribute("PolygonCorners", appPrefs.itemToolPrefs.polyCorners);
@@ -2085,6 +2099,8 @@
 			appPrefs.itemToolPrefs.shapeFillColorShade  = dc.attribute("ShapeFillColorShade").toInt();
 			appPrefs.itemToolPrefs.imageFillColor = dc.attribute("ImageFillColor", CommonStrings::None);
 			appPrefs.itemToolPrefs.imageFillColorShade = dc.attribute("ImageFillColorShade", "100").toInt();
+			appPrefs.itemToolPrefs.imageStrokeColor = dc.attribute("ImageStrokeColor", CommonStrings::None);
+			appPrefs.itemToolPrefs.imageStrokeColorShade = dc.attribute("ImageStrokeColorShade", "100").toInt();
 			appPrefs.itemToolPrefs.imageScaleX = ScCLocale::toDoubleC(dc.attribute("ImageScaleX"), 1.0);
 			appPrefs.itemToolPrefs.imageScaleY = ScCLocale::toDoubleC(dc.attribute("ImageScaleY"), 1.0);
 			appPrefs.itemToolPrefs.imageScaleType = static_cast<bool>(dc.attribute("PSCALE", "1").toInt());
@@ -2698,5 +2714,7 @@
 		appPrefs.itemToolPrefs.lineColor = CommonStrings::None;
 	if (appPrefs.itemToolPrefs.imageFillColor == CommonStrings::tr_NoneColor)
 		appPrefs.itemToolPrefs.imageFillColor = CommonStrings::None;
-}
-
+	if (appPrefs.itemToolPrefs.imageStrokeColor == CommonStrings::tr_NoneColor)
+		appPrefs.itemToolPrefs.imageStrokeColor = CommonStrings::None;
+}
+

Modified: trunk/Scribus/scribus/prefsstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17054&path=/trunk/Scribus/scribus/prefsstructs.h
==============================================================================
--- trunk/Scribus/scribus/prefsstructs.h (original)
+++ trunk/Scribus/scribus/prefsstructs.h Sat Dec  3 08:24:55 2011
@@ -219,6 +219,8 @@
 	/* Image Tool */
 	QString imageFillColor; //! Default fill color of an image frame
 	int imageFillColorShade; //! Default shade of fill color of an image grame
+	QString imageStrokeColor; //! Default stroke color of an image frame
+	int imageStrokeColorShade; //! Default shade of stroke color of an image grame
 	double imageScaleX; //! X scale of an image within an image frame
 	double imageScaleY; //! Y scale of an image within an image frame
 	bool imageScaleType; //! Scale type of image

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17054&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sat Dec  3 08:24:55 2011
@@ -3358,7 +3358,7 @@
 		}
 		else if (rasterFiles.contains(fi.suffix().toLower()))
 		{
-			int z = doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, doc->currentPage()->xOffset(), doc->currentPage()->yOffset(), 1, 1, doc->itemToolPrefs().shapeLineWidth, doc->itemToolPrefs().imageFillColor, CommonStrings::None, true);
+			int z = doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, doc->currentPage()->xOffset(), doc->currentPage()->yOffset(), 1, 1, doc->itemToolPrefs().shapeLineWidth, doc->itemToolPrefs().imageFillColor, doc->itemToolPrefs().imageStrokeColor, true);
 			PageItem *b = doc->Items->at(z);
 			b->LayerID = doc->activeLayer();
 			doc->loadPict(data, b);

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17054&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sat Dec  3 08:24:55 2011
@@ -419,6 +419,9 @@
 	if (appPrefsData.itemToolPrefs.imageFillColor != CommonStrings::None)
 		PageColors.insert(appPrefsData.itemToolPrefs.imageFillColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.imageFillColor]);
 	docPrefsData.itemToolPrefs.imageFillColor = appPrefsData.itemToolPrefs.imageFillColor;
+	if (appPrefsData.itemToolPrefs.imageStrokeColor != CommonStrings::None)
+		PageColors.insert(appPrefsData.itemToolPrefs.imageStrokeColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.imageStrokeColor]);
+	docPrefsData.itemToolPrefs.imageStrokeColor = appPrefsData.itemToolPrefs.imageStrokeColor;
 	if (appPrefsData.itemToolPrefs.textFillColor != CommonStrings::None)
 		PageColors.insert(appPrefsData.itemToolPrefs.textFillColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.textFillColor]);
 	docPrefsData.itemToolPrefs.textFillColor = appPrefsData.itemToolPrefs.textFillColor;
@@ -3047,7 +3050,7 @@
 		found = false;
 		// Tool preferences colors
 		if ((it.key() == docPrefsData.itemToolPrefs.shapeFillColor) || (it.key() == docPrefsData.itemToolPrefs.shapeLineColor) || (it.key() == docPrefsData.itemToolPrefs.imageFillColor)
-				|| (it.key() == docPrefsData.itemToolPrefs.lineColor) || (it.key() == docPrefsData.itemToolPrefs.textColor))
+				 || (it.key() == docPrefsData.itemToolPrefs.imageStrokeColor) || (it.key() == docPrefsData.itemToolPrefs.lineColor) || (it.key() == docPrefsData.itemToolPrefs.textColor))
 		{
 			if (spot)
 			{
@@ -4382,7 +4385,7 @@
 		//Q_ASSERTs here will warn on creation issues when a coder specifies the frameType incorrectly
 		//for items that do not have/need a frameType for creation.
 		case PageItem::ImageFrame:
-			newItem = new PageItem_ImageFrame(this, x, y, b, h, w, docPrefsData.itemToolPrefs.imageFillColor, CommonStrings::None);
+			newItem = new PageItem_ImageFrame(this, x, y, b, h, w, docPrefsData.itemToolPrefs.imageFillColor, docPrefsData.itemToolPrefs.imageStrokeColor);
 			Q_ASSERT(frameType==PageItem::Rectangle || frameType==PageItem::Unspecified);
 			break;
 		case PageItem::TextFrame:
@@ -4415,12 +4418,12 @@
 			Q_ASSERT(frameType==PageItem::Unspecified);
 			break;
 		case PageItem::LatexFrame:
-			newItem = new PageItem_LatexFrame(this, x, y, b, h, w, docPrefsData.itemToolPrefs.imageFillColor, CommonStrings::None);
+			newItem = new PageItem_LatexFrame(this, x, y, b, h, w, docPrefsData.itemToolPrefs.imageFillColor, docPrefsData.itemToolPrefs.imageStrokeColor);
 			Q_ASSERT(frameType==PageItem::Rectangle || frameType==PageItem::Unspecified);
 			break;
 #ifdef HAVE_OSG
 		case PageItem::OSGFrame:
-			newItem = new PageItem_OSGFrame(this, x, y, b, h, w, docPrefsData.itemToolPrefs.imageFillColor, CommonStrings::None);
+			newItem = new PageItem_OSGFrame(this, x, y, b, h, w, docPrefsData.itemToolPrefs.imageFillColor, docPrefsData.itemToolPrefs.imageStrokeColor);
 			Q_ASSERT(frameType==PageItem::Rectangle || frameType==PageItem::Unspecified);
 			break;
 #endif
@@ -4638,12 +4641,14 @@
 			newItem->IProfile = docPrefsData.colorPrefs.DCMSset.DefaultImageRGBProfile;
 			newItem->IRender = docPrefsData.colorPrefs.DCMSset.DefaultIntentImages;
 			newItem->setFillShade(docPrefsData.itemToolPrefs.imageFillColorShade);
+			newItem->setLineShade(docPrefsData.itemToolPrefs.imageStrokeColorShade);
 			break;
 		case PageItem::LatexFrame:
 #ifdef HAVE_OSG
 		case PageItem::OSGFrame:
 #endif
 			newItem->setFillShade(docPrefsData.itemToolPrefs.imageFillColorShade);
+			newItem->setLineShade(docPrefsData.itemToolPrefs.imageStrokeColorShade);
 			break;
 		case PageItem::TextFrame:
 //			newItem->setFontFillShade(itemToolPrefs.textShade);

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17054&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Sat Dec  3 08:24:55 2011
@@ -943,7 +943,7 @@
 		//SeleItemPos is from 1.2.x. Needs reenabling for dragging *TO* a frame
 		if ((fi.exists()) && (img) && !selectedItemByDrag && !vectorFile)// && (!SeleItemPos(e->pos())))
 		{
-			int z = Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, dropPosDoc.x(), dropPosDoc.y(), 1, 1, Doc->itemToolPrefs().shapeLineWidth, Doc->itemToolPrefs().imageFillColor, CommonStrings::None, true);
+			int z = Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, dropPosDoc.x(), dropPosDoc.y(), 1, 1, Doc->itemToolPrefs().shapeLineWidth, Doc->itemToolPrefs().imageFillColor, Doc->itemToolPrefs().imageStrokeColor, true);
 			PageItem *b = Doc->Items->at(z);
 			b->LayerID = Doc->activeLayer();
 			Doc->loadPict(url.toLocalFile(), b);

Modified: trunk/Scribus/scribus/ui/prefs_itemtools.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17054&path=/trunk/Scribus/scribus/ui/prefs_itemtools.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_itemtools.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_itemtools.cpp Sat Dec  3 08:24:55 2011
@@ -131,8 +131,6 @@
 	rightTextDistanceSpinBox->setValue(prefsData->itemToolPrefs.textDistances.Right * unitRatio);
 
 	//Image Tool
-//TODO	imageFrameLineColorComboBox
-//TODO	imageFrameLineShadingSpinBox
 	imageFreeScalingRadioButton->setChecked( prefsData->itemToolPrefs.imageScaleType );
 	imageFrameScalingRadioButton->setChecked( !prefsData->itemToolPrefs.imageScaleType );
 	imageHorizontalScalingSpinBox->setValue(qRound(prefsData->itemToolPrefs.imageScaleX * 100));
@@ -140,6 +138,8 @@
 	imageKeepAspectRatioCheckBox->setChecked(prefsData->itemToolPrefs.imageAspectRatio);
 	imageFrameFillColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.imageFillColor);
 	imageFrameFillShadingSpinBox->setValue(prefsData->itemToolPrefs.imageFillColorShade );
+	imageFrameLineColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.imageStrokeColor);
+	imageFrameLineShadingSpinBox->setValue(prefsData->itemToolPrefs.imageStrokeColorShade );
 	imageUseEmbeddedClippingPathCheckBox->setChecked(prefsData->itemToolPrefs.imageUseEmbeddedPath);
 	switch (prefsData->itemToolPrefs.imageLowResType)
 	{
@@ -255,14 +255,16 @@
 
 	//Image Tool
 	//
-	//	TODO imageFrameLineColorComboBox
-	//	TODO imageFrameLineShadingSpinBox
 	//	TODO scalingLockToolButton
 
 	prefsData->itemToolPrefs.imageFillColor = imageFrameFillColorComboBox->currentText();
 	if (prefsData->itemToolPrefs.imageFillColor == CommonStrings::tr_NoneColor)
 		prefsData->itemToolPrefs.imageFillColor = CommonStrings::None;
 	prefsData->itemToolPrefs.imageFillColorShade = imageFrameFillShadingSpinBox->value();
+	prefsData->itemToolPrefs.imageStrokeColor = imageFrameLineColorComboBox->currentText();
+	if (prefsData->itemToolPrefs.imageStrokeColor == CommonStrings::tr_NoneColor)
+		prefsData->itemToolPrefs.imageStrokeColor = CommonStrings::None;
+	prefsData->itemToolPrefs.imageStrokeColorShade = imageFrameFillShadingSpinBox->value();
 	prefsData->itemToolPrefs.imageScaleX = static_cast<double>(imageHorizontalScalingSpinBox->value()) / 100.0;
 	prefsData->itemToolPrefs.imageScaleY = static_cast<double>(imageVerticalScalingSpinBox->value()) / 100.0;
 	prefsData->itemToolPrefs.imageScaleType = imageFreeScalingRadioButton->isChecked();




More information about the scribus-commit mailing list