r15847 by fschmid - Added a "Calligraphic Pen" tool a la Inkscape.
scribus-commit
scribus-commit at lists.scribus.net
Sun Nov 14 00:04:17 CET 2010
Author: fschmid
Date: Sat Nov 13 23:04:17 2010
New Revision: 15847
URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15847
Log:
Added a "Calligraphic Pen" tool a la Inkscape.
Added:
trunk/Scribus/resources/icons/16/draw-calligraphic.png (with props)
trunk/Scribus/resources/icons/22/draw-calligraphic.png (with props)
trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
trunk/Scribus/scribus/canvasmode_drawcalligraphic.h
Modified:
trunk/Scribus/scribus/CMakeLists.txt
trunk/Scribus/scribus/actionmanager.cpp
trunk/Scribus/scribus/canvas.cpp
trunk/Scribus/scribus/canvas.h
trunk/Scribus/scribus/canvasmode.cpp
trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
trunk/Scribus/scribus/prefsmanager.cpp
trunk/Scribus/scribus/prefsstructs.h
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/scribusstructs.h
trunk/Scribus/scribus/ui/about.cpp
trunk/Scribus/scribus/ui/modetoolbar.cpp
trunk/Scribus/scribus/ui/prefs_itemtools.cpp
trunk/Scribus/scribus/ui/prefs_itemtoolsbase.ui
Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Sat Nov 13 23:04:17 2010
@@ -451,6 +451,7 @@
canvasmode_copyproperties.cpp
canvasmode_create.cpp
canvasmode_drawbezier.cpp
+ canvasmode_drawcalligraphic.cpp
canvasmode_drawfreehand.cpp
canvasmode_eyedropper.cpp
canvasmode_framelinks.cpp
Modified: trunk/Scribus/scribus/actionmanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&path=/trunk/Scribus/scribus/actionmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/actionmanager.cpp (original)
+++ trunk/Scribus/scribus/actionmanager.cpp Sat Nov 13 23:04:17 2010
@@ -712,6 +712,8 @@
scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-path.png"), loadIcon("22/draw-path.png"), "", defaultKey(name), mainWindow, modeDrawBezierLine));
name="toolsInsertFreehandLine";
scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-freehand.png"), loadIcon("22/draw-freehand.png"), "", defaultKey(name), mainWindow, modeDrawFreehandLine));
+ name="toolsInsertCalligraphicLine";
+ scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-calligraphic.png"), loadIcon("22/draw-calligraphic.png"), "", defaultKey(name), mainWindow, modeDrawCalligraphicLine));
name="toolsRotate";
scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/transform-rotate.png"), loadIcon("22/transform-rotate.png"), "", defaultKey(name), mainWindow, modeRotation));
name="toolsZoom";
@@ -780,7 +782,7 @@
*modeActionNames << "toolsSelect" << "toolsInsertTextFrame" << "toolsInsertImageFrame" << "toolsInsertTableFrame";
*modeActionNames << "toolsInsertShape" << "toolsInsertPolygon" << "toolsInsertLine" << "toolsInsertBezier";
- *modeActionNames << "toolsInsertFreehandLine" << "toolsInsertRenderFrame" << "toolsRotate" << "toolsZoom" << "toolsEditContents";
+ *modeActionNames << "toolsInsertFreehandLine" << "toolsInsertCalligraphicLine" << "toolsInsertRenderFrame" << "toolsRotate" << "toolsZoom" << "toolsEditContents";
*modeActionNames << "toolsEditWithStoryEditor" << "toolsLinkTextFrame" << "toolsUnlinkTextFrame";
*modeActionNames << "toolsEyeDropper" << "toolsCopyProperties";
*modeActionNames << "toolsPDFPushButton" << "toolsPDFTextField" << "toolsPDFCheckBox" << "toolsPDFComboBox" << "toolsPDFListBox" << "toolsPDFAnnotText" << "toolsPDFAnnotLink";
@@ -1471,6 +1473,7 @@
(*scrActions)["toolsInsertShape"]->setText( tr("Insert &Shape"));
(*scrActions)["toolsInsertPolygon"]->setText( tr("Insert &Polygon"));
(*scrActions)["toolsInsertLine"]->setText( tr("Insert &Line"));
+ (*scrActions)["toolsInsertCalligraphicLine"]->setText( tr("Insert Calligraphic Line"));
(*scrActions)["toolsInsertBezier"]->setText( tr("Insert &Bezier Curve"));
(*scrActions)["toolsInsertFreehandLine"]->setText( tr("Insert &Freehand Line"));
@@ -1641,6 +1644,7 @@
defKeys.insert("toolsInsertLine", Qt::Key_L);
defKeys.insert("toolsInsertBezier", Qt::Key_B);
defKeys.insert("toolsInsertFreehandLine", Qt::Key_F);
+
defKeys.insert("toolsInsertRenderFrame", Qt::Key_D); //TODO: First free key. Select a meaningful
defKeys.insert("toolsRotate", Qt::Key_R);
defKeys.insert("toolsZoom", Qt::Key_Z);
@@ -1861,6 +1865,7 @@
<< "toolsInsertLine"
<< "toolsInsertBezier"
<< "toolsInsertFreehandLine"
+ << "toolsInsertCalligraphicLine"
<< "toolsInsertRenderFrame"
<< "stickyTools"
<< "insertGlyph"
Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Sat Nov 13 23:04:17 2010
@@ -1047,7 +1047,7 @@
{
if (!m_viewMode.redrawPolygon.isEmpty())
{
- if (m_viewMode.m_MouseButtonPressed && (m_doc->appMode == modeDrawFreehandLine))
+ if (m_viewMode.m_MouseButtonPressed && ((m_doc->appMode == modeDrawFreehandLine) || (m_doc->appMode == modeDrawCalligraphicLine)))
{
drawControlsFreehandLine(psx);
}
Modified: trunk/Scribus/scribus/canvas.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&path=/trunk/Scribus/scribus/canvas.h
==============================================================================
--- trunk/Scribus/scribus/canvas.h (original)
+++ trunk/Scribus/scribus/canvas.h Sat Nov 13 23:04:17 2010
@@ -101,6 +101,7 @@
friend class CanvasMode_Normal;
friend class CanvasMode_Rotate;
friend class FreehandMode;
+ friend class CalligraphicMode;
/* Dont rely on these codes!
* 2 8 3
Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Sat Nov 13 23:04:17 2010
@@ -22,6 +22,7 @@
#include "canvasmode_create.h"
#include "canvasmode_drawbezier.h"
#include "canvasmode_drawfreehand.h"
+#include "canvasmode_drawcalligraphic.h"
#include "canvasmode_edit.h"
#include "canvasmode_editgradient.h"
#include "canvasmode_editmeshgradient.h"
@@ -123,6 +124,9 @@
case modeDrawFreehandLine:
result = new FreehandMode(view);
break;
+ case modeDrawCalligraphicLine:
+ result = new CalligraphicMode(view);
+ break;
case modeDrawLine:
case modeDrawShapes:
case modeDrawImage:
@@ -575,6 +579,7 @@
qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
break;
case modeDrawFreehandLine:
+ case modeDrawCalligraphicLine:
qApp->changeOverrideCursor(QCursor(loadIcon("DrawFreeLine.png"), 0, 32));
break;
case modeImportObject:
Modified: trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&path=/trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawfreehand.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_drawfreehand.cpp Sat Nov 13 23:04:17 2010
@@ -381,7 +381,7 @@
return;
}
-
+#if 0
assert(false);
if (m_doc->appMode != modeDrawBezierLine) //FIXME: that should be dead - av
{
@@ -963,7 +963,7 @@
}*/
}
}
-
+#endif
m_canvas->setRenderModeUseBuffer(false);
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&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 Nov 13 23:04:17 2010
@@ -920,6 +920,14 @@
doc->itemToolPrefs().shapeLineColorShade = attrs.valueAsInt("PENSHADE", 100);
doc->itemToolPrefs().lineColorShade = attrs.valueAsInt("LINESHADE", 100);
doc->itemToolPrefs().shapeFillColorShade = attrs.valueAsInt("BRUSHSHADE", 100);
+ doc->itemToolPrefs().calligrapicPenFillColor = attrs.valueAsString("calligrapicPenFillColor", "Black");
+ doc->itemToolPrefs().calligrapicPenLineColor = attrs.valueAsString("calligrapicPenLineColor", "Black");
+ doc->itemToolPrefs().calligrapicPenFillColorShade = attrs.valueAsInt("calligrapicPenFillColorShade", 100);
+ doc->itemToolPrefs().calligrapicPenLineColorShade = attrs.valueAsInt("calligrapicPenLineColorShade", 100);
+ doc->itemToolPrefs().calligrapicPenLineWidth = attrs.valueAsDouble("calligrapicPenLineWidth", 1.0);
+ doc->itemToolPrefs().calligrapicPenAngle = attrs.valueAsDouble("calligrapicPenAngle", 0.0);
+ doc->itemToolPrefs().calligrapicPenWidth = attrs.valueAsDouble("calligrapicPenWidth", 10.0);
+ doc->itemToolPrefs().calligrapicPenStyle = static_cast<Qt::PenStyle>(attrs.valueAsInt("calligrapicPenStyle"));
doc->opToolPrefs().magMin = attrs.valueAsInt("MAGMIN", 1);
doc->opToolPrefs().magMax = attrs.valueAsInt("MAGMAX", 3200);
doc->opToolPrefs().magStep = attrs.valueAsInt("MAGSTEP", 200);
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&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 Nov 13 23:04:17 2010
@@ -235,6 +235,14 @@
docu.writeAttribute("MARGC",m_Doc->guidesPrefs().marginColor.name());
docu.writeAttribute("RANDF", static_cast<int>(m_Doc->marginColored()));
docu.writeAttribute("currentProfile", m_Doc->curCheckProfile());
+ docu.writeAttribute("calligrapicPenFillColor", m_Doc->itemToolPrefs().calligrapicPenFillColor);
+ docu.writeAttribute("calligrapicPenLineColor", m_Doc->itemToolPrefs().calligrapicPenLineColor);
+ docu.writeAttribute("calligrapicPenFillColorShade", m_Doc->itemToolPrefs().calligrapicPenFillColorShade);
+ docu.writeAttribute("calligrapicPenLineColorShade", m_Doc->itemToolPrefs().calligrapicPenLineColorShade);
+ docu.writeAttribute("calligrapicPenLineWidth", m_Doc->itemToolPrefs().calligrapicPenLineWidth);
+ docu.writeAttribute("calligrapicPenAngle", m_Doc->itemToolPrefs().calligrapicPenAngle);
+ docu.writeAttribute("calligrapicPenWidth", m_Doc->itemToolPrefs().calligrapicPenWidth);
+ docu.writeAttribute("calligrapicPenStyle", m_Doc->itemToolPrefs().calligrapicPenStyle);
writeCheckerProfiles(docu);
writeLinestyles(docu);
Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Sat Nov 13 23:04:17 2010
@@ -220,6 +220,16 @@
appPrefs.itemToolPrefs.textStrokeShade = 100;
appPrefs.itemToolPrefs.textTabFillChar = "";
appPrefs.itemToolPrefs.textTabWidth = 36.0;
+ // defaults for calligraphic pen
+ appPrefs.itemToolPrefs.calligrapicPenFillColor = "Black";
+ appPrefs.itemToolPrefs.calligrapicPenLineColor = "Black";
+ appPrefs.itemToolPrefs.calligrapicPenFillColorShade = 100;
+ appPrefs.itemToolPrefs.calligrapicPenLineColorShade = 100;
+ appPrefs.itemToolPrefs.calligrapicPenLineWidth = 1.0;
+ appPrefs.itemToolPrefs.calligrapicPenAngle = 0.0;
+ appPrefs.itemToolPrefs.calligrapicPenWidth = 10.0;
+ appPrefs.itemToolPrefs.calligrapicPenStyle = Qt::SolidLine;
+
appPrefs.opToolPrefs.dispX = 10.0;
appPrefs.opToolPrefs.dispY = 10.0;
appPrefs.opToolPrefs.constrain = 15.0;
@@ -1068,6 +1078,10 @@
bool PrefsManager::isToolColor(const struct ItemToolPrefs& settings, const QString& name)
{
+ if (settings.calligrapicPenLineColor == name)
+ return true;
+ if (settings.calligrapicPenFillColor == name)
+ return true;
if (settings.textColor == name)
return true;
if (settings.textStrokeColor == name)
@@ -1110,6 +1124,10 @@
names.append(settings.lineColor);
if (!names.contains(settings.imageFillColor))
names.append(settings.imageFillColor);
+ if (!names.contains(settings.calligrapicPenFillColor))
+ names.append(settings.calligrapicPenFillColor);
+ if (!names.contains(settings.calligrapicPenLineColor))
+ names.append(settings.calligrapicPenLineColor);
return names;
}
@@ -1136,6 +1154,10 @@
settings.lineColor = replaceMap[settings.lineColor];
if (replaceMap.contains(settings.imageFillColor))
settings.imageFillColor = replaceMap[settings.imageFillColor];
+ if (replaceMap.contains(settings.calligrapicPenFillColor))
+ settings.calligrapicPenFillColor = replaceMap[settings.calligrapicPenFillColor];
+ if (replaceMap.contains(settings.calligrapicPenLineColor))
+ settings.calligrapicPenLineColor = replaceMap[settings.calligrapicPenLineColor];
}
void PrefsManager::setColorSet(const ColorList& colorSet)
@@ -1166,6 +1188,12 @@
QString brushPict = appPrefs.itemToolPrefs.imageFillColor;
if (!tmpSet.contains(brushPict) && brushPict != CommonStrings::None)
tmpSet[brushPict] = appPrefs.colorPrefs.DColors[brushPict];
+ QString brushCpen = appPrefs.itemToolPrefs.calligrapicPenFillColor;
+ if (!tmpSet.contains(brushCpen) && brushCpen != CommonStrings::None)
+ tmpSet[brushCpen] = appPrefs.colorPrefs.DColors[brushCpen];
+ QString brushCpen2 = appPrefs.itemToolPrefs.calligrapicPenLineColor;
+ if (!tmpSet.contains(brushCpen2) && brushCpen2 != CommonStrings::None)
+ tmpSet[brushCpen2] = appPrefs.colorPrefs.DColors[brushCpen2];
appPrefs.colorPrefs.DColors = tmpSet;
}
@@ -1447,6 +1475,14 @@
dcItemTools.setAttribute("LineEndArrow", appPrefs.itemToolPrefs.lineEndArrow);
dcItemTools.setAttribute("FontFace",appPrefs.itemToolPrefs.textFont);
dcItemTools.setAttribute("FontSize",appPrefs.itemToolPrefs.textSize / 10.0);
+ dcItemTools.setAttribute("calligrapicPenFillColor", appPrefs.itemToolPrefs.calligrapicPenFillColor);
+ dcItemTools.setAttribute("calligrapicPenLineColor", appPrefs.itemToolPrefs.calligrapicPenLineColor);
+ dcItemTools.setAttribute("calligrapicPenFillColorShade", appPrefs.itemToolPrefs.calligrapicPenFillColorShade);
+ dcItemTools.setAttribute("calligrapicPenLineColorShade", appPrefs.itemToolPrefs.calligrapicPenLineColorShade);
+ dcItemTools.setAttribute("calligrapicPenLineWidth", appPrefs.itemToolPrefs.calligrapicPenLineWidth);
+ dcItemTools.setAttribute("calligrapicPenAngle", appPrefs.itemToolPrefs.calligrapicPenAngle);
+ dcItemTools.setAttribute("calligrapicPenWidth", appPrefs.itemToolPrefs.calligrapicPenWidth);
+ dcItemTools.setAttribute("calligrapicPenStyle",appPrefs.itemToolPrefs.calligrapicPenStyle);
elem.appendChild(dcItemTools);
QDomElement dcOperatorTools=docu.createElement("OperatorTools");
@@ -1967,6 +2003,14 @@
if (dc.tagName()=="ItemTools")
{
+ appPrefs.itemToolPrefs.calligrapicPenFillColor = dc.attribute("calligrapicPenFillColor", "Black");
+ appPrefs.itemToolPrefs.calligrapicPenLineColor = dc.attribute("calligrapicPenLineColor", "Black");
+ appPrefs.itemToolPrefs.calligrapicPenFillColorShade = dc.attribute("calligrapicPenFillColorShade", "100").toInt();
+ appPrefs.itemToolPrefs.calligrapicPenLineColorShade = dc.attribute("calligrapicPenLineColorShade", "100").toInt();
+ appPrefs.itemToolPrefs.calligrapicPenLineWidth = ScCLocale::toDoubleC(dc.attribute("calligrapicPenLineWidth"), 1.0);
+ appPrefs.itemToolPrefs.calligrapicPenAngle = ScCLocale::toDoubleC(dc.attribute("calligrapicPenAngle"), 0.0);
+ appPrefs.itemToolPrefs.calligrapicPenWidth = ScCLocale::toDoubleC(dc.attribute("calligrapicPenWidth"), 10.0);
+ appPrefs.itemToolPrefs.calligrapicPenStyle = dc.attribute("calligrapicPenStyle").toInt();
appPrefs.itemToolPrefs.shapeLineColor = dc.attribute("ShapeLineColor");
appPrefs.itemToolPrefs.shapeFillColor = dc.attribute("ShapeFillColor", CommonStrings::None);
appPrefs.itemToolPrefs.lineColor = dc.attribute("LineColor");
Modified: trunk/Scribus/scribus/prefsstructs.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&path=/trunk/Scribus/scribus/prefsstructs.h
==============================================================================
--- trunk/Scribus/scribus/prefsstructs.h (original)
+++ trunk/Scribus/scribus/prefsstructs.h Sat Nov 13 23:04:17 2010
@@ -214,6 +214,15 @@
bool imageAspectRatio; //! Use stored aspect ratio for the image
int imageLowResType; //! Preview type for an image frame
bool imageUseEmbeddedPath; //! Use embedded path, eg from an EPS etc.
+ /* Calligraphic Pen Tool */
+ QString calligrapicPenFillColor; //! Default calligrapicPen fill color
+ QString calligrapicPenLineColor; //! Default calligrapicPen line color
+ int calligrapicPenFillColorShade; //! Default calligrapicPen fill shade
+ int calligrapicPenLineColorShade; //! Default calligrapicPen line shade
+ double calligrapicPenLineWidth; //! Width of line
+ double calligrapicPenAngle; //! Angle of the calligraphics Brush
+ double calligrapicPenWidth; //! Width of the calligraphics Brush
+ int calligrapicPenStyle; //! Line style of the calligraphics Brush
};
struct OperatorToolPrefs
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sat Nov 13 23:04:17 2010
@@ -796,6 +796,7 @@
scrMenuMgr->addMenuItem(scrActions["toolsInsertLine"], "Insert", false);
scrMenuMgr->addMenuItem(scrActions["toolsInsertBezier"], "Insert", false);
scrMenuMgr->addMenuItem(scrActions["toolsInsertFreehandLine"], "Insert", false);
+ scrMenuMgr->addMenuItem(scrActions["toolsInsertCalligraphicLine"], "Insert", false);
scrMenuMgr->addMenuSeparator("Insert");
scrMenuMgr->addMenuItem(scrActions["stickyTools"], "Insert", true);
scrMenuMgr->addMenuSeparator("Insert");
@@ -2385,6 +2386,7 @@
scrActions["toolsInsertLine"]->setEnabled(true);
scrActions["toolsInsertBezier"]->setEnabled(true);
scrActions["toolsInsertFreehandLine"]->setEnabled(true);
+ scrActions["toolsInsertCalligraphicLine"]->setEnabled(true);
scrActions["toolsInsertPolygon"]->setEnabled(true);
scrActions["toolsInsertRenderFrame"]->setEnabled(true);
scrActions["toolsMeasurements"]->setEnabled(true);
@@ -4558,6 +4560,7 @@
scrActions["toolsInsertLine"]->setEnabled(false);
scrActions["toolsInsertBezier"]->setEnabled(false);
scrActions["toolsInsertFreehandLine"]->setEnabled(false);
+ scrActions["toolsInsertCalligraphicLine"]->setEnabled(false);
scrActions["toolsInsertPolygon"]->setEnabled(false);
scrActions["toolsInsertRenderFrame"]->setEnabled(false);
scrActions["toolsLinkTextFrame"]->setEnabled(false);
@@ -6093,6 +6096,7 @@
scrActions["toolsInsertLine"]->setEnabled(false);
scrActions["toolsInsertBezier"]->setEnabled(false);
scrActions["toolsInsertFreehandLine"]->setEnabled(false);
+ scrActions["toolsInsertCalligraphicLine"]->setEnabled(false);
scrActions["toolsInsertPolygon"]->setEnabled(false);
scrActions["toolsInsertRenderFrame"]->setEnabled(false);
scrActions["toolsLinkTextFrame"]->setEnabled(false);
@@ -6173,6 +6177,7 @@
scrActions["toolsInsertLine"]->setEnabled(true);
scrActions["toolsInsertBezier"]->setEnabled(true);
scrActions["toolsInsertFreehandLine"]->setEnabled(true);
+ scrActions["toolsInsertCalligraphicLine"]->setEnabled(true);
scrActions["toolsInsertPolygon"]->setEnabled(true);
scrActions["toolsInsertRenderFrame"]->setEnabled(true);
scrActions["toolsPDFPushButton"]->setEnabled(true);
@@ -6266,6 +6271,7 @@
scrActions["toolsInsertLine"]->setChecked(mode==modeDrawLine);
scrActions["toolsInsertBezier"]->setChecked(mode==modeDrawBezierLine);
scrActions["toolsInsertFreehandLine"]->setChecked(mode==modeDrawFreehandLine);
+ scrActions["toolsInsertCalligraphicLine"]->setChecked(mode == modeDrawCalligraphicLine);
scrActions["toolsInsertRenderFrame"]->setChecked(mode==modeDrawLatex);
scrActions["toolsRotate"]->setChecked(mode==modeRotation);
scrActions["toolsZoom"]->setChecked(mode==modeMagnifier);
@@ -6467,6 +6473,7 @@
case modeDrawBezierLine:
qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
break;
+ case modeDrawCalligraphicLine:
case modeDrawFreehandLine:
qApp->changeOverrideCursor(QCursor(loadIcon("DrawFreeLine.png"), 0, 32));
break;
@@ -9030,6 +9037,7 @@
scrActions["toolsInsertLine"]->setEnabled(setter);
scrActions["toolsInsertBezier"]->setEnabled(setter);
scrActions["toolsInsertFreehandLine"]->setEnabled(setter);
+ scrActions["toolsInsertCalligraphicLine"]->setEnabled(setter);
scrActions["toolsInsertPolygon"]->setEnabled(setter);
scrActions["toolsInsertRenderFrame"]->setEnabled(setter);
if (doc->masterPageMode())
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sat Nov 13 23:04:17 2010
@@ -397,6 +397,10 @@
docPrefsData.itemToolPrefs.textFillColor = appPrefsData.itemToolPrefs.textFillColor;
if (appPrefsData.itemToolPrefs.textLineColor != CommonStrings::None)
PageColors.insert(appPrefsData.itemToolPrefs.textLineColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.textLineColor]);
+ if (appPrefsData.itemToolPrefs.calligrapicPenFillColor != CommonStrings::None)
+ PageColors.insert(appPrefsData.itemToolPrefs.calligrapicPenFillColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.calligrapicPenFillColor]);
+ if (appPrefsData.itemToolPrefs.calligrapicPenLineColor != CommonStrings::None)
+ PageColors.insert(appPrefsData.itemToolPrefs.calligrapicPenLineColor, appPrefsData.colorPrefs.DColors[appPrefsData.itemToolPrefs.calligrapicPenLineColor]);
ParagraphStyle pstyle;
Modified: trunk/Scribus/scribus/scribusstructs.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&path=/trunk/Scribus/scribus/scribusstructs.h
==============================================================================
--- trunk/Scribus/scribus/scribusstructs.h (original)
+++ trunk/Scribus/scribus/scribusstructs.h Sat Nov 13 23:04:17 2010
@@ -497,7 +497,8 @@
modeDrawLatex,
modeImportObject,
modeInsertPDF3DAnnotation,
- modeEditMeshGradient
+ modeEditMeshGradient,
+ modeDrawCalligraphicLine
};
struct AlignObjs
Modified: trunk/Scribus/scribus/ui/about.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&path=/trunk/Scribus/scribus/ui/about.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/about.cpp (original)
+++ trunk/Scribus/scribus/ui/about.cpp Sat Nov 13 23:04:17 2010
@@ -114,7 +114,7 @@
buildID = new QLabel( tab );
buildID->setAlignment(Qt::AlignCenter);
buildID->setTextInteractionFlags(Qt::TextSelectableByMouse);
- QString BUILD_DAY = "7";
+ QString BUILD_DAY = "14";
QString BUILD_MONTH = CommonStrings::november;
QString BUILD_YEAR = "2010";
QString BUILD_TIME = "";
Modified: trunk/Scribus/scribus/ui/modetoolbar.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&path=/trunk/Scribus/scribus/ui/modetoolbar.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/modetoolbar.cpp (original)
+++ trunk/Scribus/scribus/ui/modetoolbar.cpp Sat Nov 13 23:04:17 2010
@@ -73,6 +73,7 @@
this->addAction(m_ScMW->scrActions["toolsInsertLine"]);
this->addAction(m_ScMW->scrActions["toolsInsertBezier"]);
this->addAction(m_ScMW->scrActions["toolsInsertFreehandLine"]);
+ this->addAction(m_ScMW->scrActions["toolsInsertCalligraphicLine"]);
this->addAction(m_ScMW->scrActions["toolsRotate"]);
this->addAction(m_ScMW->scrActions["toolsZoom"]);
this->addAction(m_ScMW->scrActions["toolsEditContents"]);
Modified: trunk/Scribus/scribus/ui/prefs_itemtools.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&path=/trunk/Scribus/scribus/ui/prefs_itemtools.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_itemtools.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_itemtools.cpp Sat Nov 13 23:04:17 2010
@@ -25,13 +25,24 @@
setupUi(this);
lineEndArrowComboBox->setStartDirection(false);
shapeLineWidthSpinBox->setNewUnit(0);
+ shapeLineWidthSpinBox->setMaximum(36);
+ shapeLineWidthSpinBox->setDecimals(1);
lineWidthSpinBox->setNewUnit(0);
- shapeLineWidthSpinBox->setMaximum(36);
lineWidthSpinBox->setMaximum(36);
- shapeLineWidthSpinBox->setDecimals(1);
lineWidthSpinBox->setDecimals(1);
+ calPenLineWidthSpinBox->setNewUnit(0);
+ calPenLineWidthSpinBox->setMaximum(36);
+ calPenLineWidthSpinBox->setDecimals(1);
+ calPenWidthSpinBox->setNewUnit(0);
+ calPenWidthSpinBox->setMaximum(100);
+ calPenWidthSpinBox->setDecimals(1);
+ calPenAngleSpinBox->setNewUnit(6);
+ calPenAngleSpinBox->setMaximum(180);
+ calPenAngleSpinBox->setMinimum(-180);
+ calPenAngleSpinBox->setDecimals(0);
shapeLineWidthSpinBox->setSpecialValueText( tr("Hairline"));
lineWidthSpinBox->setSpecialValueText( tr("Hairline"));
+ calPenLineWidthSpinBox->setSpecialValueText( tr("Hairline"));
textSizeSpinBox->setNewUnit(0);
textSizeSpinBox->setMinimum(0.5);
textSizeSpinBox->setMaximum(2048);
@@ -173,6 +184,15 @@
lineEndArrowComboBox->setCurrentIndex(prefsData->itemToolPrefs.lineEndArrow);
lineWidthSpinBox->setValue(prefsData->itemToolPrefs.lineWidth);
//
+ //Calligraphic Pen Tool
+ calPenFillColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.calligrapicPenFillColor);
+ calPenFillShadingSpinBox->setValue(prefsData->itemToolPrefs.calligrapicPenFillColorShade);
+ calPenColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.calligrapicPenLineColor);
+ calPenLineShadingSpinBox->setValue(prefsData->itemToolPrefs.calligrapicPenLineColorShade);
+ calPenStyleComboBox->setCurrentIndex(static_cast<int>(prefsData->itemToolPrefs.calligrapicPenStyle) - 1);
+ calPenLineWidthSpinBox->setValue(prefsData->itemToolPrefs.calligrapicPenLineWidth);
+ calPenAngleSpinBox->setValue(prefsData->itemToolPrefs.calligrapicPenAngle);
+ calPenWidthSpinBox->setValue(prefsData->itemToolPrefs.calligrapicPenWidth);
enableSignals(true);
}
@@ -279,6 +299,19 @@
prefsData->itemToolPrefs.lineWidth = lineWidthSpinBox->value();
prefsData->itemToolPrefs.lineStartArrow = lineStartArrowComboBox->currentIndex();
prefsData->itemToolPrefs.lineEndArrow = lineEndArrowComboBox->currentIndex();
+ //Calligraphic Pen Tool
+ prefsData->itemToolPrefs.calligrapicPenFillColor = calPenFillColorComboBox->currentText();
+ if (prefsData->itemToolPrefs.calligrapicPenFillColor == CommonStrings::tr_NoneColor)
+ prefsData->itemToolPrefs.calligrapicPenFillColor = CommonStrings::None;
+ prefsData->itemToolPrefs.calligrapicPenLineColor = calPenColorComboBox->currentText();
+ if (prefsData->itemToolPrefs.calligrapicPenLineColor == CommonStrings::tr_NoneColor)
+ prefsData->itemToolPrefs.calligrapicPenLineColor = CommonStrings::None;
+ prefsData->itemToolPrefs.calligrapicPenFillColorShade = calPenFillShadingSpinBox->value();
+ prefsData->itemToolPrefs.calligrapicPenLineColorShade = calPenLineShadingSpinBox->value();
+ prefsData->itemToolPrefs.calligrapicPenStyle = static_cast<Qt::PenStyle>(calPenStyleComboBox->currentIndex()) + 1;
+ prefsData->itemToolPrefs.calligrapicPenLineWidth = calPenLineWidthSpinBox->value();
+ prefsData->itemToolPrefs.calligrapicPenAngle = calPenAngleSpinBox->value();
+ prefsData->itemToolPrefs.calligrapicPenWidth = calPenWidthSpinBox->value();
}
void Prefs_ItemTools::enableSignals(bool on)
Modified: trunk/Scribus/scribus/ui/prefs_itemtoolsbase.ui
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15847&path=/trunk/Scribus/scribus/ui/prefs_itemtoolsbase.ui
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_itemtoolsbase.ui (original)
+++ trunk/Scribus/scribus/ui/prefs_itemtoolsbase.ui Sat Nov 13 23:04:17 2010
@@ -79,8 +79,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>614</width>
- <height>720</height>
+ <width>637</width>
+ <height>632</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
@@ -651,8 +651,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>629</width>
- <height>622</height>
+ <width>637</width>
+ <height>632</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
@@ -1299,6 +1299,141 @@
<size>
<width>20</width>
<height>428</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_4">
+ <attribute name="title">
+ <string>Calligraphic Pen</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_9">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_10">
+ <item>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_45">
+ <property name="text">
+ <string>Fill Color:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="ColorCombo" name="calPenFillColorComboBox"/>
+ </item>
+ <item row="0" column="2">
+ <widget class="QLabel" name="label_49">
+ <property name="text">
+ <string>Shading:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <widget class="QSpinBox" name="calPenFillShadingSpinBox">
+ <property name="suffix">
+ <string> %</string>
+ </property>
+ <property name="maximum">
+ <number>100</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_50">
+ <property name="text">
+ <string>Line Color:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="ColorCombo" name="calPenColorComboBox"/>
+ </item>
+ <item row="1" column="2">
+ <widget class="QLabel" name="label_48">
+ <property name="text">
+ <string>Shading:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3">
+ <widget class="QSpinBox" name="calPenLineShadingSpinBox">
+ <property name="suffix">
+ <string> %</string>
+ </property>
+ <property name="maximum">
+ <number>100</number>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_47">
+ <property name="text">
+ <string>Line Style:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="LineCombo" name="calPenStyleComboBox"/>
+ </item>
+ <item row="2" column="2">
+ <widget class="QLabel" name="label_51">
+ <property name="text">
+ <string>Pen Angle:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3">
+ <widget class="ScrSpinBox" name="calPenAngleSpinBox"/>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_46">
+ <property name="text">
+ <string>Line Width:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="ScrSpinBox" name="calPenLineWidthSpinBox"/>
+ </item>
+ <item row="3" column="2">
+ <widget class="QLabel" name="label_52">
+ <property name="text">
+ <string>Pen Width:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="3">
+ <widget class="ScrSpinBox" name="calPenWidthSpinBox"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_16">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_11">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>501</height>
</size>
</property>
</spacer>
More information about the scribus-commit
mailing list