r17988 by fschmid - Preview Mode: Added correct handling of Text Annotations.
scribus-commit
scribus-commit at lists.scribus.net
Thu Dec 27 17:36:34 UTC 2012
Author: fschmid
Date: Thu Dec 27 17:36:34 2012
New Revision: 17988
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17988
Log:
Preview Mode: Added correct handling of Text Annotations.
Added the ability to set the icon for Text Annotations.
Modified:
trunk/Scribus/scribus/annotation.h
trunk/Scribus/scribus/canvas.cpp
trunk/Scribus/scribus/canvas.h
trunk/Scribus/scribus/canvasmode.cpp
trunk/Scribus/scribus/canvasmode_normal.cpp
trunk/Scribus/scribus/pageitem_textframe.cpp
trunk/Scribus/scribus/pageitem_textframe.h
trunk/Scribus/scribus/pdflib_core.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/scribusview.cpp
trunk/Scribus/scribus/ui/annota.cpp
trunk/Scribus/scribus/ui/annota.h
Modified: trunk/Scribus/scribus/annotation.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17988&path=/trunk/Scribus/scribus/annotation.h
==============================================================================
--- trunk/Scribus/scribus/annotation.h (original)
+++ trunk/Scribus/scribus/annotation.h Thu Dec 27 17:36:34 2012
@@ -41,10 +41,11 @@
AnToolTip(""), AnRollOver(""), AnDown(""), AnBColor(""), An_Extern(""), AnBsty(0),
AnBwid(1), AnFeed(1), AnZiel(0), AnFlag(0), AnMaxChar(-1), AnVis(0), AnChkStil(0),
AnFont(4), AnIsChk(false), AnAAact(false), AnHTML(0), AnUseIcons(false),
- AnIPlace(1), AnScaleW(0), AnFormat(0), tmp_Chk(false), on_State(false), is_Open(false)
+ AnIPlace(1), AnScaleW(0), AnFormat(0), tmp_Chk(false), on_State(false), is_Open(false), AnIcon(0), AnIsOpen(false)
{
}
- enum AnnotationType {
+ enum AnnotationType
+ {
Button = 2,
Textfield = 3,
Checkbox = 4,
@@ -55,7 +56,8 @@
Annot3D = 12,
RadioButton = 13
};
- enum AnnotationAction {
+ enum AnnotationAction
+ {
Action_None = 0,
Action_JavaScript = 1,
Action_GoTo = 2,
@@ -67,7 +69,8 @@
Action_GoToR_FileAbs = 9,
Action_Named = 10
};
- enum AnnotationScriptEvents {
+ enum AnnotationScriptEvents
+ {
Java_ReleaseButton = 0,
Java_PressButton = 1,
Java_EnterWidget = 2,
@@ -79,8 +82,20 @@
Java_FieldValidate = 8,
Java_FieldCalculate = 9
};
-
- enum AnnotationFlags {
+ enum AnnotationIconType
+ {
+ Icon_Note = 0,
+ Icon_Comment = 1,
+ Icon_Key = 2,
+ Icon_Help = 3,
+ Icon_NewParagraph = 4,
+ Icon_Paragraph = 5,
+ Icon_Insert = 6,
+ Icon_Cross = 7,
+ Icon_Circle = 8
+ };
+ enum AnnotationFlags
+ {
Flag_ReadOnly = 1, // Bit 1
Flag_Required = 2, // Bit 2
Flag_NoExport = 4, // Bit 3
@@ -139,6 +154,8 @@
void setUseIcons(bool newUseIcons) { AnUseIcons=newUseIcons; }
void setIPlace(int newIPlace) { AnIPlace=newIPlace; }
void setScaleW(int newScaleW) { AnScaleW=newScaleW; }
+ void setAnOpen(bool newIsOpen) { AnIsOpen = newIsOpen; }
+ void setIcon(int newHTML) { AnIcon = newHTML; }
int Type() const { return AnType; }
QString Action() const { return AnAction; }
@@ -176,6 +193,8 @@
bool UseIcons() const { return AnUseIcons; }
int IPlace() const { return AnIPlace; }
int ScaleW() const { return AnScaleW; }
+ bool IsAnOpen() const { return AnIsOpen; }
+ int Icon() const { return AnIcon; }
protected:
int AnType;
@@ -214,6 +233,8 @@
bool tmp_Chk;
bool on_State;
bool is_Open;
+ int AnIcon;
+ bool AnIsOpen;
};
#endif
Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17988&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Thu Dec 27 17:36:34 2012
@@ -521,6 +521,13 @@
if(mp.x()>left && mp.x()<right && mp.y()>top && mp.y()<bottom)
return true;
return false;
+}
+
+bool Canvas::cursorOverFrameControl(QPoint globalPos, QRectF targetRect, PageItem* frame)
+{
+ FPoint mp = globalToCanvas(globalPos);
+ QRectF tg = targetRect.translated(frame->xPos(), frame->yPos());
+ return tg.contains(QPointF(mp.x(), mp.y()));
}
PageItem* Canvas::itemInGroup(PageItem* group, QTransform itemPos, QRectF mouseArea) const
Modified: trunk/Scribus/scribus/canvas.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17988&path=/trunk/Scribus/scribus/canvas.h
==============================================================================
--- trunk/Scribus/scribus/canvas.h (original)
+++ trunk/Scribus/scribus/canvas.h Thu Dec 27 17:36:34 2012
@@ -167,6 +167,7 @@
bool hitsCanvasPoint(FPoint globalPoint, QPointF canvasPoint) const;
QRect exposedRect() const;
bool cursorOverTextFrameControl(QPoint globalPos, PageItem* frame);
+ bool cursorOverFrameControl(QPoint globalPos, QRectF targetRect, PageItem* frame);
/** Returns the framehandle or INSIDE if the position falls into the frame. */
FrameHandle frameHitTest(QPointF canvasPoint, PageItem* frame) const;
FrameHandle frameHitTest(QPointF point, QRectF frame) const;
Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17988&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Thu Dec 27 17:36:34 2012
@@ -376,9 +376,12 @@
QRectF drRect = QRectF(x, y, w, h).normalized();
if (m_doc->drawAsPreview && !m_doc->editOnPreview)
{
- psx->setPen(bb);
- psx->setBrush(Qt::NoBrush);
- psx->drawRect(drRect.adjusted(-1, -1, 1, 1));
+ if (!currItem->annotation().IsOpen())
+ {
+ psx->setPen(bb);
+ psx->setBrush(Qt::NoBrush);
+ psx->drawRect(drRect.adjusted(-1, -1, 1, 1));
+ }
}
else
{
@@ -414,9 +417,12 @@
psx->setBrush(Qt::NoBrush);
if (m_doc->drawAsPreview && !m_doc->editOnPreview)
{
- psx->setPen(bb);
- psx->setBrush(Qt::NoBrush);
- psx->drawRect(QRectF(x, y, w, h).adjusted(-1, -1, 1, 1));
+ if (!currItem->annotation().IsOpen())
+ {
+ psx->setPen(bb);
+ psx->setBrush(Qt::NoBrush);
+ psx->drawRect(QRectF(x, y, w, h).adjusted(-1, -1, 1, 1));
+ }
}
else
{
Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17988&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp Thu Dec 27 17:36:34 2012
@@ -152,13 +152,28 @@
void CanvasMode_Normal::mouseDoubleClickEvent(QMouseEvent *m)
{
+ PageItem *currItem = 0;
m->accept();
m_canvas->m_viewMode.m_MouseButtonPressed = false;
if (m_doc->drawAsPreview)
+ {
+ if (GetItem(&currItem))
+ {
+ if (currItem->isAnnotation())
+ {
+ if (currItem->annotation().Type() == Annotation::Text)
+ {
+ currItem->annotation().setOpen(!currItem->annotation().IsOpen());
+ currItem->asTextFrame()->setTextAnnotationOpen(currItem->annotation().IsOpen());
+ currItem->update();
+ m_view->updateContents();
+ }
+ }
+ }
return;
+ }
m_canvas->resetRenderMode();
// m_view->stopDragTimer();
- PageItem *currItem = 0;
if (m_doc->m_Selection->isMultipleSelection())
{
if (GetItem(&currItem))
@@ -299,7 +314,7 @@
if (commonMouseMove(m))
return;
- m_mouseCurrentPoint = mousePointDoc;
+// m_mouseCurrentPoint = mousePointDoc;
bool movingOrResizing = (m_canvas->m_viewMode.operItemMoving || m_canvas->m_viewMode.operItemResizing);
bool mouseIsOnPage = (m_doc->OnPage(mousePointDoc.x(), mousePointDoc.y()) != -1);
if ((m_doc->guidesPrefs().guidesShown) && (!m_doc->GuideLock) && (!movingOrResizing) && (mouseIsOnPage) )
@@ -396,6 +411,19 @@
handleMouseEnter(hoveredItem);
}
m_hoveredItem = hoveredItem;
+ if ((hoveredItem->annotation().Type() == Annotation::Text) && (hoveredItem->annotation().IsOpen()))
+ {
+ if (m_view->moveTimerElapsed() && m_canvas->m_viewMode.m_MouseButtonPressed && (m->buttons() & Qt::LeftButton) && (!currItem->locked()))
+ {
+ double dx = mousePointDoc.x() - m_mouseCurrentPoint.x();
+ double dy = mousePointDoc.y() - m_mouseCurrentPoint.y();
+ hoveredItem->setXYPos(hoveredItem->xPos() + dx, hoveredItem->yPos() + dy, true);
+ m_mouseCurrentPoint = mousePointDoc;
+ m_canvas->resetRenderMode();
+ m_canvas->setRenderModeUseBuffer(false);
+ m_canvas->repaint();
+ }
+ }
}
else
{
@@ -433,6 +461,7 @@
//>>#10116
if (m_doc->drawAsPreview)
return;
+ m_mouseCurrentPoint = mousePointDoc;
if ((GetItem(&currItem)) && (!shiftSelItems))
{
newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x());
@@ -1016,7 +1045,7 @@
//<<#10116: Click on overflow icon to get into link frame mode
PageItem* clickedItem=NULL;
clickedItem = m_canvas->itemUnderCursor(m->globalPos(), clickedItem, m->modifiers());
- if (clickedItem && clickedItem->asTextFrame() && (!m_doc->drawAsPreview))
+ if (clickedItem && clickedItem->asTextFrame() && (!clickedItem->isAnnotation()) && (!m_doc->drawAsPreview))
{
if (clickedItem->frameOverflows())
{
@@ -1281,6 +1310,19 @@
currItem = m_doc->m_Selection->itemAt(0);
if (currItem->isAnnotation())
{
+ if (currItem->annotation().Type() == Annotation::Text)
+ {
+ if (currItem->annotation().IsOpen())
+ {
+ if (m_canvas->cursorOverFrameControl(m->globalPos(), QRectF(245, 20, 11, 11), currItem))
+ {
+ currItem->annotation().setOpen(false);
+ currItem->asTextFrame()->setTextAnnotationOpen(false);
+ currItem->update();
+ m_view->updateContents();
+ }
+ }
+ }
if (currItem->annotation().Type() == Annotation::Link)
handleLinkAnnotation(currItem);
else if (currItem->annotation().Type() == Annotation::Checkbox)
Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17988&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Thu Dec 27 17:36:34 2012
@@ -71,6 +71,7 @@
unicodeTextEditMode = false;
unicodeInputCount = 0;
unicodeInputString = "";
+ m_origAnnotPos = QRectF(xPos(), yPos(), width(), height());
connect(&itemText,SIGNAL(changed()), this, SLOT(slotInvalidateLayout()));
}
@@ -83,6 +84,7 @@
unicodeInputCount = 0;
unicodeInputString = "";
m_notesFramesMap.clear();
+ m_origAnnotPos = QRectF(xPos(), yPos(), width(), height());
connect(&itemText,SIGNAL(changed()), this, SLOT(slotInvalidateLayout()));
}
@@ -3456,85 +3458,49 @@
{
if (m_Doc->drawAsPreview && !m_Doc->editOnPreview)
{
- QPainterPath chkPath;
- p->save();
- p->translate(0, 24);
- p->scale(1, -1);
- p->setBrush(QColor(255, 255, 255));
- p->setFillMode(ScPainter::Solid);
- p->setStrokeMode(ScPainter::None);
- chkPath.moveTo(3.602, 24.0);
- chkPath.lineTo(20.398, 24.0);
- chkPath.cubicTo(22.387, 24, 24, 22.387, 24, 20.398);
- chkPath.lineTo(24.0, 3.602);
- chkPath.cubicTo(24, 1.613, 22.387, 0, 20.398, 0);
- chkPath.lineTo(3.602, 0);
- chkPath.cubicTo(1.613, 0, 0, 1.613, 0, 3.602);
- chkPath.lineTo(0, 20.398);
- chkPath.cubicTo(0, 22.387, 1.613, 24, 3.602, 24);
- chkPath.closeSubpath();
- FPointArray chArr;
- chArr.fromQPainterPath(chkPath);
- p->setupPolygon(&chArr);
- p->fillPath();
- p->setFillMode(ScPainter::None);
- p->setStrokeMode(ScPainter::Solid);
- chkPath = QPainterPath();
- chkPath.moveTo(9, 18);
- chkPath.lineTo(4, 18);
- chkPath.cubicTo(4, 7, 4, 4, 6, 3);
- chkPath.lineTo(20, 3);
- chkPath.cubicTo(18, 4, 18, 7, 18, 18);
- chkPath.lineTo(17, 18);
- chArr.fromQPainterPath(chkPath);
- p->setupPolygon(&chArr, false);
- p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
- p->strokePath();
- p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 1.5, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
- p->drawLine(QPointF(10, 16), QPointF(14, 21));
- p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 1.85625, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
- chkPath = QPainterPath();
- chkPath.moveTo(15.07, 20.523);
- chkPath.cubicTo(15.07, 19.672, 14.379, 18.977, 13.523, 18.977);
- chkPath.cubicTo(12.672, 18.977, 11.977, 19.672, 11.977, 20.523);
- chkPath.cubicTo(11.977, 21.379, 12.672, 22.07, 13.523, 22.07);
- chkPath.cubicTo(14.379, 22.07, 15.07, 21.379, 15.07, 20.523);
- chkPath.closeSubpath();
- chArr.fromQPainterPath(chkPath);
- p->setupPolygon(&chArr);
- p->strokePath();
- p->drawLine(QPointF(6.5, 13.5), QPointF(15.5, 13.5));
- p->drawLine(QPointF(6.5, 10.5), QPointF(13.5, 10.5));
- p->drawLine(QPointF(6.801, 7.5), QPointF(15.5, 7.5));
- chkPath = QPainterPath();
- chkPath.moveTo(9, 19);
- chkPath.lineTo(4, 19);
- chkPath.cubicTo(4, 8, 4, 5, 6, 4);
- chkPath.lineTo(20, 4);
- chkPath.cubicTo(18, 5, 18, 8, 18, 19);
- chkPath.lineTo(17, 19);
- chArr.fromQPainterPath(chkPath);
- p->setupPolygon(&chArr, false);
- p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
- p->strokePath();
- p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 1.5, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
- p->drawLine(QPointF(10, 17), QPointF(14, 22));
- chkPath = QPainterPath(); \
- chkPath.moveTo(15.07, 21.523);
- chkPath.cubicTo(15.07, 20.672, 14.379, 19.977, 13.523, 19.977);
- chkPath.cubicTo(12.672, 19.977, 11.977, 20.672, 11.977, 21.523);
- chkPath.cubicTo(11.977, 22.379, 12.672, 23.07, 13.523, 23.07);
- chkPath.cubicTo(14.379, 23.07, 15.07, 22.379, 15.07, 21.523);
- chkPath.closeSubpath();
- chArr.fromQPainterPath(chkPath);
- p->setupPolygon(&chArr);
- p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 1.85625, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
- p->strokePath();
- p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
- p->drawLine(QPointF(6.5, 14.5), QPointF(15.5, 14.5));
- p->drawLine(QPointF(6.5, 11.5), QPointF(13.5, 11.5));
- p->drawLine(QPointF(6.801, 8.5), QPointF(15.5, 8.5));
- p->restore();
+ if (annotation().IsOpen())
+ {
+ p->save();
+ p->translate(m_origAnnotPos.x() - xPos(), m_origAnnotPos.y() - yPos());
+ drawNoteIcon(p);
+ p->restore();
+ p->save();
+ double basX = 15;
+ double basY = 15;
+ QPainterPath clp;
+ clp.addRoundedRect(basX, basY, 250, 250, 5, 5);
+ p->setBrush(QColor(240, 240, 0));
+ p->setFillMode(ScPainter::Solid);
+ p->setStrokeMode(ScPainter::None);
+ FPointArray clpArr;
+ clpArr.fromQPainterPath(clp);
+ p->setupPolygon(&clpArr);
+ p->fillPath();
+ p->setPen(QColor(0, 0, 0), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ p->setBrush(QColor(255, 255, 255));
+ p->setStrokeMode(ScPainter::Solid);
+ p->drawRect(basX + 10, basY + 20, 230, 220);
+ p->setFillMode(ScPainter::None);
+ p->drawRect(basX + 230, basY + 5, 11, 11);
+ p->setPen(QColor(0, 0, 0), 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ p->drawLine(QPointF(basX + 232, basY + 13), QPointF(basX + 239, basY + 13));
+ p->save();
+ p->translate(basX + 10, basY + 5);
+ p->scale(0.5, 0.5);
+ drawNoteIcon(p);
+ p->restore();
+ clp = QPainterPath();
+ clp.addRect(basX + 10, basY + 20, 230, 220);
+ clpArr.fromQPainterPath(clp);
+ p->setupPolygon(&clpArr);
+ p->setClipPath();
+ p->setPen(fontColor);
+ p->setFont(QFont(fontName, fontSize));
+ p->drawText(QRectF(basX + 11, basY + 21, 228, 218), bmUtf16, false, 2);
+ p->restore();
+ }
+ else
+ drawNoteIcon(p);
p->restore();
p->restore();
return;
@@ -3944,7 +3910,7 @@
//Draw the overflow icon
if (frameOverflows())
{
- if (!m_Doc->drawAsPreview)
+ if ((!m_Doc->drawAsPreview) && (!isAnnotation()))
drawOverflowMarker(p);
}
if ((m_Doc->guidesPrefs().colBordersShown) && (!m_Doc->drawAsPreview))
@@ -5220,6 +5186,345 @@
}
}
+void PageItem_TextFrame::drawNoteIcon(ScPainter *p)
+{
+ p->save();
+ p->translate(0, 24);
+ p->scale(1, -1);
+ p->setFillMode(ScPainter::None);
+ p->setStrokeMode(ScPainter::Solid);
+ FPointArray chArr;
+ if (annotation().Icon() == Annotation::Icon_Note)
+ {
+ chArr.svgInit();
+ chArr.svgMoveTo(9, 18);
+ chArr.svgLineTo(4, 18);
+ chArr.svgCurveToCubic(4, 7, 4, 4, 6, 3);
+ chArr.svgLineTo(20, 3);
+ chArr.svgCurveToCubic(18, 4, 18, 7, 18, 18);
+ chArr.svgLineTo(17, 18);
+ p->setupPolygon(&chArr, false);
+ p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ p->strokePath();
+ p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 1.5, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ p->drawLine(QPointF(10, 16), QPointF(14, 21));
+ p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 1.85625, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ chArr.resize(0);
+ chArr.svgInit();
+ chArr.svgMoveTo(15.07, 20.523);
+ chArr.svgCurveToCubic(15.07, 19.672, 14.379, 18.977, 13.523, 18.977);
+ chArr.svgCurveToCubic(12.672, 18.977, 11.977, 19.672, 11.977, 20.523);
+ chArr.svgCurveToCubic(11.977, 21.379, 12.672, 22.07, 13.523, 22.07);
+ chArr.svgCurveToCubic(14.379, 22.07, 15.07, 21.379, 15.07, 20.523);
+ chArr.svgClosePath();
+ p->setupPolygon(&chArr);
+ p->strokePath();
+ p->drawLine(QPointF(6.5, 13.5), QPointF(15.5, 13.5));
+ p->drawLine(QPointF(6.5, 10.5), QPointF(13.5, 10.5));
+ p->drawLine(QPointF(6.801, 7.5), QPointF(15.5, 7.5));
+ chArr.resize(0);
+ chArr.svgInit();
+ chArr.svgMoveTo(9, 19);
+ chArr.svgLineTo(4, 19);
+ chArr.svgCurveToCubic(4, 8, 4, 5, 6, 4);
+ chArr.svgLineTo(20, 4);
+ chArr.svgCurveToCubic(18, 5, 18, 8, 18, 19);
+ chArr.svgLineTo(17, 19);
+ p->setupPolygon(&chArr, false);
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ p->strokePath();
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 1.5, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ p->drawLine(QPointF(10, 17), QPointF(14, 22));
+ chArr.resize(0);
+ chArr.svgInit();
+ chArr.svgMoveTo(15.07, 21.523);
+ chArr.svgCurveToCubic(15.07, 20.672, 14.379, 19.977, 13.523, 19.977);
+ chArr.svgCurveToCubic(12.672, 19.977, 11.977, 20.672, 11.977, 21.523);
+ chArr.svgCurveToCubic(11.977, 22.379, 12.672, 23.07, 13.523, 23.07);
+ chArr.svgCurveToCubic(14.379, 23.07, 15.07, 22.379, 15.07, 21.523);
+ chArr.svgClosePath();
+ p->setupPolygon(&chArr);
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 1.85625, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ p->strokePath();
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ p->drawLine(QPointF(6.5, 14.5), QPointF(15.5, 14.5));
+ p->drawLine(QPointF(6.5, 11.5), QPointF(13.5, 11.5));
+ p->drawLine(QPointF(6.801, 8.5), QPointF(15.5, 8.5));
+ }
+ else if (annotation().Icon() == Annotation::Icon_Comment)
+ {
+ p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ chArr.svgInit();
+ chArr.parseSVG("M 8 20 L 16 20 C 18.363 20 20 18.215 20 16 L 20 13 C 20 10.785 18.363 9 16 9 L 13 9 L 8 3 L 8 9 C 5.637 9 4 10.785 4 13 L 4 16 C 4 18.215 5.637 20 8 20 Z");
+ p->setupPolygon(&chArr);
+ p->strokePath();
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ chArr.resize(0);
+ chArr.svgInit();
+ chArr.parseSVG("M 8 21 L 16 21 C 18.363 21 20 19.215 20 17 L 20 14 C 20 11.785 18.363 10 16 10 L 13 10 L 8 4 L 8 10 L 8 10 C 5.637 10 4 11.785 4 14 L 4 17 C 4 19.215 5.637 21 8 21 Z");
+ p->setupPolygon(&chArr);
+ p->strokePath();
+ }
+ else if (annotation().Icon() == Annotation::Icon_Key)
+ {
+ p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ chArr.svgInit();
+ QString svg = "M 11.895 18.754 C 13.926 20.625 17.09 20.496 18.961 18.465 C 20.832 16.434 20.699 13.27 18.668 11.398 C 17.164 10.016 15.043 9.746 13.281 10.516";
+ svg += " L 12.473 9.324 L 11.281 10.078 L 9.547 8.664 L 9.008 6.496 L 7.059 6.059 L 6.34 4.121 L 5.543 3.668 L 3.375 4.207 L 2.938 6.156";
+ svg += " L 10.57 13.457 C 9.949 15.277 10.391 17.367 11.895 18.754 Z";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr);
+ p->strokePath();
+ p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 1.5, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ chArr.resize(0);
+ chArr.svgInit();
+ svg = "M 16.059 15.586 C 16.523 15.078 17.316 15.043 17.824 15.512 C 18.332 15.98 18.363 16.77 17.895 17.277 C 17.43 17.785 16.637 17.816 16.129 17.352";
+ svg += " C 15.621 16.883 15.59 16.094 16.059 15.586 Z";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr);
+ p->strokePath();
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ chArr.resize(0);
+ chArr.svgInit();
+ svg = "M 11.895 19.754 C 13.926 21.625 17.09 21.496 18.961 19.465 C 20.832 17.434 20.699 14.27 18.668 12.398 C 17.164 11.016 15.043 10.746 13.281 11.516";
+ svg += " L 12.473 10.324 L 11.281 11.078 L 9.547 9.664 L 9.008 7.496 L 7.059 7.059 L 6.34 5.121 L 5.543 4.668 L 3.375 5.207 L 2.938 7.156";
+ svg += " L 10.57 14.457 C 9.949 16.277 10.391 18.367 11.895 19.754 Z";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr);
+ p->strokePath();
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 1.5, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ chArr.resize(0);
+ chArr.svgInit();
+ svg = "M 16.059 16.586 C 16.523 16.078 17.316 16.043 17.824 16.512 C 18.332 16.98 18.363 17.77 17.895 18.277";
+ svg += " C 17.43 18.785 16.637 18.816 16.129 18.352 C 15.621 17.883 15.59 17.094 16.059 16.586 Z";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr);
+ p->strokePath();
+ }
+ else if (annotation().Icon() == Annotation::Icon_Help)
+ {
+ p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ chArr.svgInit();
+ QString svg = "M 8.289 16.488 C 8.824 17.828 10.043 18.773 11.473 18.965 C 12.902 19.156 14.328 18.559 15.195 17.406 C 16.062 16.254 16.242 14.723 15.664 13.398";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr, false);
+ p->strokePath();
+ chArr.resize(0);
+ chArr.svgInit();
+ svg = "M 12 8 C 12 12 16 11 16 15";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr, false);
+ p->strokePath();
+ chArr.resize(0);
+ chArr.svgInit();
+ p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 1.539286, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ p->save();
+ p->translate(0, 24);
+ p->scale(1, -1);
+ svg = "M 12.684 20.891 C 12.473 21.258 12.004 21.395 11.629 21.196 C 11.254 20.992 11.105 20.531 11.297 20.149 C 11.488 19.77 11.945 19.61 12.332 19.789";
+ svg += " C 12.719 19.969 12.891 20.426 12.719 20.817";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr, false);
+ p->strokePath();
+ p->restore();
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 2.5, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ chArr.resize(0);
+ chArr.svgInit();
+ svg = "M 8.289 17.488 C 9.109 19.539 11.438 20.535 13.488 19.711 C 15.539 18.891 16.535 16.562 15.711 14.512 C 15.699 14.473 15.684 14.438 15.664 14.398";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr, false);
+ p->strokePath();
+ chArr.resize(0);
+ chArr.svgInit();
+ svg = "M 12 9 C 12 13 16 12 16 16";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr, false);
+ p->strokePath();
+ chArr.resize(0);
+ chArr.svgInit();
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 1.539286, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ p->save();
+ p->translate(0, 24);
+ p->scale(1, -1);
+ svg = "M 12.684 19.891 C 12.473 20.258 12.004 20.395 11.629 20.195 C 11.254 19.992 11.105 19.531 11.297 19.149 C 11.488 18.77 11.945 18.61 12.332 18.789";
+ svg += " C 12.719 18.969 12.891 19.426 12.719 19.817";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr, false);
+ p->strokePath();
+ p->restore();
+ }
+ else if (annotation().Icon() == Annotation::Icon_NewParagraph)
+ {
+ p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 4, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ chArr.svgInit();
+ p->save();
+ p->translate(0, 24);
+ p->scale(1, -1);
+ QString svg = "M 9.211 11.988 C 8.449 12.07 7.711 11.707 7.305 11.059 C 6.898 10.41 6.898 9.59 7.305 8.941 C 7.711 8.293 8.449 7.93 9.211 8.012";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr, false);
+ p->strokePath();
+ chArr.resize(0);
+ chArr.svgInit();
+ p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 1.004413, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ svg = "M 18.07 11.511 L 15.113 10.014 L 12.199 11.602 L 12.711 8.323 L 10.301 6.045 L 13.574 5.517 L 14.996 2.522 L 16.512 5.474 L 19.801 5.899 L 17.461 8.252 L 18.07 11.511 Z";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr);
+ p->strokePath();
+ p->restore();
+ chArr.resize(0);
+ chArr.svgInit();
+ p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ svg = "M 11 17 L 10 17 L 10 3";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr, false);
+ p->strokePath();
+ chArr.resize(0);
+ chArr.svgInit();
+ svg = "M 14 3 L 14 13";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr, false);
+ p->strokePath();
+ chArr.resize(0);
+ chArr.svgInit();
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 4, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ p->save();
+ p->translate(0, 24);
+ p->scale(1, -1);
+ svg = "M 9.211 10.988 C 8.109 11.105 7.125 10.309 7.012 9.211 C 6.895 8.109 7.691 7.125 8.789 7.012 C 8.93 6.996 9.07 6.996 9.211 7.012";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr, false);
+ p->strokePath();
+ chArr.resize(0);
+ chArr.svgInit();
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 1.004413, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ svg = "M 18.07 10.502 L 15.113 9.005 L 12.199 10.593 L 12.711 7.314 L 10.301 5.036 L 13.574 4.508 L 14.996 1.513 L 16.512 4.465 L 19.801 4.891 L 17.461 7.243 L 18.07 10.502 Z";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr);
+ p->strokePath();
+ p->restore();
+ chArr.resize(0);
+ chArr.svgInit();
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ svg = "M 11 18 L 10 18 L 10 4";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr, false);
+ p->strokePath();
+ chArr.resize(0);
+ chArr.svgInit();
+ svg = "M 14 4 L 14 14";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr, false);
+ p->strokePath();
+ }
+ else if (annotation().Icon() == Annotation::Icon_Paragraph)
+ {
+ p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ chArr.svgInit();
+ QString svg = "M 15 3 L 15 18 L 11 18 L 11 3";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr, false);
+ p->strokePath();
+ chArr.resize(0);
+ chArr.svgInit();
+ p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 4, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ p->save();
+ p->translate(0, 24);
+ p->scale(1, -1);
+ svg = "M 9.777 10.988 C 8.746 10.871 7.973 9.988 8 8.949 C 8.027 7.91 8.844 7.066 9.879 7.004";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr);
+ p->strokePath();
+ p->restore();
+ chArr.resize(0);
+ chArr.svgInit();
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ svg = "M 15 4 L 15 19 L 11 19 L 11 4";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr);
+ p->strokePath();
+ chArr.resize(0);
+ chArr.svgInit();
+ p->save();
+ p->translate(0, 24);
+ p->scale(1, -1);
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 4, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ svg = "M 9.777 9.988 C 8.746 9.871 7.973 8.988 8 7.949 C 8.027 6.91 8.844 6.066 9.879 6.004";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr);
+ p->strokePath();
+ p->restore();
+ }
+ else if (annotation().Icon() == Annotation::Icon_Insert)
+ {
+ p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ p->drawLine(QPointF(9, 10), QPointF(17, 10));
+ p->drawLine(QPointF(12, 14.012), QPointF(20, 14));
+ p->drawLine(QPointF(12, 6.012), QPointF(20, 6.012));
+ chArr.svgInit();
+ QString svg = "M 4 12 L 6 10 L 4 8";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr, false);
+ p->strokePath();
+ chArr.resize(0);
+ chArr.svgInit();
+ p->drawLine(QPointF(4, 12), QPointF(4, 8));
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 2, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ p->drawLine(QPointF(12, 19.012), QPointF(20, 19));
+ p->drawLine(QPointF(12, 15.012), QPointF(20, 15));
+ p->drawLine(QPointF(12, 7.012), QPointF(20, 7.012));
+ svg = "M 4 13 L 6 11 L 4 9";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr, false);
+ p->strokePath();
+ p->drawLine(QPointF(4, 13), QPointF(4, 9));
+ }
+ else if (annotation().Icon() == Annotation::Icon_Cross)
+ {
+ p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 2.5, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ p->drawLine(QPointF(18, 5), QPointF(6, 17));
+ p->drawLine(QPointF(6, 5), QPointF(18, 17));
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 2.5, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ p->drawLine(QPointF(18, 6), QPointF(6, 18));
+ p->drawLine(QPointF(6, 6), QPointF(18, 18));
+ }
+ else if (annotation().Icon() == Annotation::Icon_Circle)
+ {
+ p->setPen(QColor(qRound(255 * 0.533333), qRound(255 * 0.541176), qRound(255 * 0.521569)), 2.5, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ chArr.svgInit();
+ QString svg = "M 19.5 11.5 C 19.5 7.359 16.141 4 12 4 C 7.859 4 4.5 7.359 4.5 11.5 C 4.5 15.641 7.859 19 12 19 C 16.141 19 19.5 15.641 19.5 11.5 Z";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr);
+ p->strokePath();
+ chArr.resize(0);
+ p->setPen(QColor(qRound(255 * 0.729412), qRound(255 * 0.741176), qRound(255 * 0.713725)), 2.5, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ chArr.svgInit();
+ svg = "M 19.5 12.5 C 19.5 8.359 16.141 5 12 5 C 7.859 5 4.5 8.359 4.5 12.5 C 4.5 16.641 7.859 20 12 20 C 16.141 20 19.5 16.641 19.5 12.5 Z";
+ chArr.parseSVG(svg);
+ p->setupPolygon(&chArr);
+ p->strokePath();
+ }
+ p->restore();
+}
+
+
+void PageItem_TextFrame::setTextAnnotationOpen(bool open)
+{
+ if (annotation().Type() == Annotation::Text)
+ {
+ if (open)
+ {
+ m_origAnnotPos = QRectF(xPos(), yPos(), width(), height());
+ setWidthHeight(265, 265, true);
+ }
+ else
+ {
+ setXYPos(m_origAnnotPos.x(), m_origAnnotPos.y(), true);
+ setWidthHeight(m_origAnnotPos.width(), m_origAnnotPos.height(), true);
+ }
+ }
+}
+
QString PageItem_TextFrame::infoDescription()
{
return QString();
Modified: trunk/Scribus/scribus/pageitem_textframe.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17988&path=/trunk/Scribus/scribus/pageitem_textframe.h
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.h (original)
+++ trunk/Scribus/scribus/pageitem_textframe.h Thu Dec 27 17:36:34 2012
@@ -85,6 +85,7 @@
//simplify conditions checking if frame is in chain
//FIX: use it in other places
bool isInChain() { return ((prevInChain() != NULL) || (nextInChain() != NULL)); }
+ void setTextAnnotationOpen(bool open);
double columnWidth();
#ifdef NLS_PROTO
@@ -113,7 +114,8 @@
bool unicodeTextEditMode;
int unicodeInputCount;
QString unicodeInputString;
-
+
+ void drawNoteIcon(ScPainter *p);
virtual bool createInfoGroup(QFrame *, QGridLayout *);
virtual void applicableActions(QStringList& actionList);
virtual QString infoDescription();
@@ -133,6 +135,7 @@
QString currentShadow;
QMap<QString,StoryText> shadows;
bool checkKeyIsShortcut(QKeyEvent *k);
+ QRectF m_origAnnotPos;
private slots:
void slotInvalidateLayout();
Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17988&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Thu Dec 27 17:36:34 2012
@@ -8582,6 +8582,45 @@
case Annotation::Text:
PutDoc("/Subtype /Text\n");
PutDoc("/Contents " + EncStringUTF16(bmUtf16, annotationObj) + "\n");
+ PutDoc("/Open " );
+ if (ite->annotation().IsAnOpen())
+ PutDoc("true\n");
+ else
+ PutDoc("false\n");
+ PutDoc("/Name /");
+ switch (ite->annotation().Icon())
+ {
+ case Annotation::Icon_Note:
+ PutDoc("Note\n");
+ break;
+ case Annotation::Icon_Comment:
+ PutDoc("Comment\n");
+ break;
+ case Annotation::Icon_Key:
+ PutDoc("Key\n");
+ break;
+ case Annotation::Icon_Help:
+ PutDoc("Help\n");
+ break;
+ case Annotation::Icon_NewParagraph:
+ PutDoc("NewParagraph\n");
+ break;
+ case Annotation::Icon_Paragraph:
+ PutDoc("Paragraph\n");
+ break;
+ case Annotation::Icon_Insert:
+ PutDoc("Insert\n");
+ break;
+ case Annotation::Icon_Cross:
+ PutDoc("Cross\n");
+ break;
+ case Annotation::Icon_Circle:
+ PutDoc("Circle\n");
+ break;
+ default:
+ PutDoc("Note\n");
+ break;
+ }
break;
case 1:
case Annotation::Link:
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17988&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 Thu Dec 27 17:36:34 2012
@@ -4686,6 +4686,8 @@
currItem->annotation().setBorderColor( attrs.valueAsString("ANBCOL", CommonStrings::None));
currItem->annotation().setIPlace(attrs.valueAsInt("ANPLACE", 1));
currItem->annotation().setScaleW(attrs.valueAsInt("ANSCALE", 0));
+ currItem->annotation().setIcon(attrs.valueAsInt("ANITYP", 0));
+ currItem->annotation().setAnOpen(attrs.valueAsBool("ANOPEN", false) );
if (currItem->asTextFrame() || currItem->asPathText())
{
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17988&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 Thu Dec 27 17:36:34 2012
@@ -2467,6 +2467,8 @@
docu.writeAttribute("ANICON", item->annotation().UseIcons());
docu.writeAttribute("ANPLACE", item->annotation().IPlace());
docu.writeAttribute("ANSCALE", item->annotation().ScaleW());
+ docu.writeAttribute("ANITYP", item->annotation().Icon());
+ docu.writeAttribute("ANOPEN", item->annotation().IsAnOpen());
}
if (!item->AutoName)
docu.writeAttribute("ANNAME", item->itemName());
Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17988&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp Thu Dec 27 17:36:34 2012
@@ -321,6 +321,7 @@
bool SlaOutputDev::handleTextAnnot(Annot* annota, double xCoor, double yCoor, double width, double height)
{
+ AnnotText *anl = (AnnotText*)annota;
int z = m_doc->itemAdd(PageItem::TextFrame, PageItem::Rectangle, xCoor, yCoor, width, height, 0, CommonStrings::None, CommonStrings::None, true);
PageItem *ite = m_doc->Items->at(z);
ite->ClipEdited = true;
@@ -338,7 +339,29 @@
ite->setIsAnnotation(true);
ite->AutoName = false;
ite->annotation().setType(Annotation::Text);
- ite->annotation().setActionType(0);
+ ite->annotation().setActionType(Annotation::Action_None);
+ ite->annotation().setAnOpen(anl->getOpen());
+ QString iconName = UnicodeParsedString(anl->getIcon());
+ if (iconName == "Note")
+ ite->annotation().setIcon(Annotation::Icon_Note);
+ else if (iconName == "Comment")
+ ite->annotation().setIcon(Annotation::Icon_Comment);
+ else if (iconName == "Key")
+ ite->annotation().setIcon(Annotation::Icon_Key);
+ else if (iconName == "Help")
+ ite->annotation().setIcon(Annotation::Icon_Help);
+ else if (iconName == "NewParagraph")
+ ite->annotation().setIcon(Annotation::Icon_NewParagraph);
+ else if (iconName == "Paragraph")
+ ite->annotation().setIcon(Annotation::Icon_Paragraph);
+ else if (iconName == "Insert")
+ ite->annotation().setIcon(Annotation::Icon_Insert);
+ else if (iconName == "Cross")
+ ite->annotation().setIcon(Annotation::Icon_Cross);
+ else if (iconName == "Circle")
+ ite->annotation().setIcon(Annotation::Icon_Circle);
+ else
+ ite->annotation().setIcon(Annotation::Icon_Note);
ite->setItemName( CommonStrings::itemName_TextAnnotation + QString("%1").arg(m_doc->TotalItems));
ite->itemText.insertChars(UnicodeParsedString(annota->getContents()));
return true;
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17988&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Thu Dec 27 17:36:34 2012
@@ -18064,6 +18064,8 @@
it->annotation().setCheckState(it->annotation().IsChk());
it->annotation().setOnState(false);
it->annotation().setOpen(false);
+ it->asTextFrame()->setTextAnnotationOpen(false);
+ it->update();
}
}
allItems.clear();
@@ -18085,6 +18087,8 @@
it->annotation().setCheckState(it->annotation().IsChk());
it->annotation().setOnState(false);
it->annotation().setOpen(false);
+ it->asTextFrame()->setTextAnnotationOpen(false);
+ it->update();
}
}
allItems.clear();
@@ -18109,6 +18113,8 @@
it->annotation().setCheckState(it->annotation().IsChk());
it->annotation().setOnState(false);
it->annotation().setOpen(false);
+ it->asTextFrame()->setTextAnnotationOpen(false);
+ it->update();
}
}
allItems.clear();
Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17988&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Thu Dec 27 17:36:34 2012
@@ -479,6 +479,7 @@
}
else
{
+ Doc->ResetFormFields();
editOnPreviewToolbarButton->hide();
Doc->guidesPrefs().framesShown = storedFramesShown;
Doc->guidesPrefs().showControls = storedShowControls;
Modified: trunk/Scribus/scribus/ui/annota.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17988&path=/trunk/Scribus/scribus/ui/annota.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/annota.cpp (original)
+++ trunk/Scribus/scribus/ui/annota.cpp Thu Dec 27 17:36:34 2012
@@ -109,10 +109,35 @@
Fram = new QStackedWidget(this);
AnnotLayout->addWidget( Fram );
- Frame9 = new QFrame( this );
- Frame9->setFrameShape( QFrame::NoFrame );
- Frame9->setFrameShadow( QFrame::Plain );
- Fram->addWidget(Frame9);
+// Frame9 = new QFrame( this );
+// Frame9->setFrameShape( QFrame::NoFrame );
+// Frame9->setFrameShadow( QFrame::Plain );
+
+ GroupBox2 = new QGroupBox( this );
+ GroupBox2->setTitle( tr( "Options" ) );
+ GroupBox2Layout = new QGridLayout( GroupBox2 );
+ GroupBox2Layout->setAlignment( Qt::AlignTop );
+ GroupBox2Layout->setSpacing( 5 );
+ GroupBox2Layout->setMargin( 10 );
+ TextLabelG1 = new QLabel( tr("Icon:"), GroupBox2);
+ ComboBox2 = new QComboBox(GroupBox2);
+ ComboBox2->addItem( tr("Note"));
+ ComboBox2->addItem( tr("Comment"));
+ ComboBox2->addItem( tr("Key"));
+ ComboBox2->addItem( tr("Help"));
+ ComboBox2->addItem( tr("NewParagraph"));
+ ComboBox2->addItem( tr("Paragraph"));
+ ComboBox2->addItem( tr("Insert"));
+ ComboBox2->addItem( tr("Cross"));
+ ComboBox2->addItem( tr("Circle"));
+ ComboBox2->setEditable(false);
+ ComboBox2->setCurrentIndex(item->annotation().Icon());
+ GroupBox2Layout->addWidget( TextLabelG1, 0, 0 );
+ GroupBox2Layout->addWidget( ComboBox2, 0, 1 );
+ textIsOpen = new QCheckBox( tr("Annotation is Open"), GroupBox2);
+ textIsOpen->setChecked(item->annotation().IsAnOpen());
+ GroupBox2Layout->addWidget( textIsOpen, 1, 0, 1, 1 );
+ Fram->addWidget(GroupBox2);
GroupBox1 = new QGroupBox( this );
GroupBox1->setTitle( tr( "Destination" ) );
@@ -270,6 +295,8 @@
{
case 10:
item->annotation().setActionType(Annotation::Action_None);
+ item->annotation().setAnOpen(textIsOpen->isChecked());
+ item->annotation().setIcon(ComboBox2->currentIndex());
break;
case 11:
item->annotation().setAction(tmp.setNum(SpinBox2->value())+" "+ tmp2.setNum(Height-SpinBox3->value())+" 0");
Modified: trunk/Scribus/scribus/ui/annota.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17988&path=/trunk/Scribus/scribus/ui/annota.h
==============================================================================
--- trunk/Scribus/scribus/ui/annota.h (original)
+++ trunk/Scribus/scribus/ui/annota.h Thu Dec 27 17:36:34 2012
@@ -56,9 +56,13 @@
ScrSpinBox* SpinBox1;
ScrSpinBox* SpinBox2;
ScrSpinBox* SpinBox3;
- QFrame* Frame9;
+// QFrame* Frame9;
QPushButton* PushButton1;
QPushButton* PushButton2;
+ QGroupBox* GroupBox2;
+ QLabel* TextLabelG1;
+ QComboBox* ComboBox2;
+ QCheckBox* textIsOpen;
PageItem* item;
ScribusView* view;
int Width;
@@ -79,6 +83,7 @@
QVBoxLayout* AnnotLayout;
QHBoxLayout* Layout1;
QGridLayout* GroupBox1Layout;
+ QGridLayout* GroupBox2Layout;
QHBoxLayout* Layout1_2;
};
More information about the scribus-commit
mailing list