diff --git a/conf/widgetannottools.cpp b/conf/widgetannottools.cpp
index e4be577e2..3ea855130 100644
--- a/conf/widgetannottools.cpp
+++ b/conf/widgetannottools.cpp
@@ -259,6 +259,7 @@ QString NewAnnotToolDialog::toolXml() const
const QByteArray toolType = m_type->itemData( m_type->currentIndex() ).toByteArray();
const QString color = m_stubann->style().color().name();
const double opacity = m_stubann->style().opacity();
+ const double width = m_stubann->style().width();
if ( toolType == "note-linked" )
{
@@ -286,9 +287,9 @@ QString NewAnnotToolDialog::toolXml() const
Q_UNUSED( ia );
return QString( ""
""
- ""
+ ""
""
- "").arg( color ).arg( opacity );
+ "").arg( color ).arg( opacity ).arg( width );
}
else if ( toolType == "straight-line" )
{
@@ -296,9 +297,9 @@ QString NewAnnotToolDialog::toolXml() const
Q_UNUSED( la );
return QString( ""
""
- ""
+ ""
""
- "" ).arg( color ).arg( opacity );
+ "" ).arg( color ).arg( opacity ).arg( width );
}
else if ( toolType == "polygon" )
{
@@ -306,9 +307,9 @@ QString NewAnnotToolDialog::toolXml() const
Q_UNUSED( la );
return QString( ""
""
- ""
+ ""
""
- "" ).arg( color ).arg( opacity );
+ "" ).arg( color ).arg( opacity ).arg( width );
}
else if ( toolType == "text-markup" )
{
@@ -346,11 +347,11 @@ QString NewAnnotToolDialog::toolXml() const
{
Okular::GeomAnnotation * ga = static_cast( m_stubann );
const bool isCircle = (ga->geometricalType() == Okular::GeomAnnotation::InscribedCircle);
- return QString( ""
+ return QString( ""
""
- ""
+ ""
""
- "").arg( color ).arg( opacity )
+ "").arg( color ).arg( opacity ).arg( width )
.arg( isCircle ? "ellipse" : "rectangle" )
.arg( isCircle ? "GeomCircle" : "GeomSquare" );
}
diff --git a/ui/data/tools.xml b/ui/data/tools.xml
index 867bbd6b0..1579a8e96 100644
--- a/ui/data/tools.xml
+++ b/ui/data/tools.xml
@@ -48,14 +48,14 @@ Engine/Annotation Types [specific attributes]:
Straight Yellow Line
-
+
5
Draw a polygon (click on the first point to close it)
-
+
6
@@ -76,7 +76,7 @@ Engine/Annotation Types [specific attributes]:
A cyan ellipse
-
+
9
diff --git a/ui/pageviewannotator.cpp b/ui/pageviewannotator.cpp
index 13382edc3..91080d058 100644
--- a/ui/pageviewannotator.cpp
+++ b/ui/pageviewannotator.cpp
@@ -238,7 +238,8 @@ class PickPointEngine : public AnnotatorEngine
ga->setGeometricalType( Okular::GeomAnnotation::InscribedSquare );
else
ga->setGeometricalType( Okular::GeomAnnotation::InscribedCircle );
- ga->style().setWidth( 5 );
+ if ( m_annotElement.hasAttribute( "width" ) )
+ ann->style().setWidth( m_annotElement.attribute( "width" ).toDouble() );
//set boundary
rect.left = qMin( startpoint.x, point.x );
rect.top = qMin( startpoint.y, point.y );
@@ -423,6 +424,9 @@ class PolyLineEngine : public AnnotatorEngine
if ( !ann )
return QList< Okular::Annotation* >();
+ if ( m_annotElement.hasAttribute( "width" ) )
+ ann->style().setWidth( m_annotElement.attribute( "width" ).toDouble() );
+
// set common attributes
ann->style().setColor( m_annotElement.hasAttribute( "color" ) ?
m_annotElement.attribute( "color" ) : m_engineColor );