diff --git a/conf/editannottooldialog.cpp b/conf/editannottooldialog.cpp --- a/conf/editannottooldialog.cpp +++ b/conf/editannottooldialog.cpp @@ -189,6 +189,7 @@ annotationElement.setAttribute( QStringLiteral("leadFwd"), QString::number( la->lineLeadingForwardPoint() ) ); annotationElement.setAttribute( QStringLiteral("leadBack"), QString::number( la->lineLeadingBackwardPoint() ) ); } + annotationElement.setAttribute( QStringLiteral("endStyle"), QString::number( la->lineEndStyle() )); } else if ( toolType == ToolPolygon ) { @@ -484,6 +485,8 @@ la->setLineLeadingForwardPoint( annotationElement.attribute( QStringLiteral("leadFwd") ).toDouble() ); if ( annotationElement.hasAttribute( QStringLiteral("leadBack") ) ) la->setLineLeadingBackwardPoint( annotationElement.attribute( QStringLiteral("leadBack") ).toDouble() ); + if ( annotationElement.hasAttribute( QStringLiteral("endStyle") ) ) + la->setLineEndStyle( (Okular::LineAnnotation::TermStyle)annotationElement.attribute( QStringLiteral("endStyle") ).toInt() ); } else if ( annotType == QLatin1String("strikeout") ) { diff --git a/ui/annotationwidgets.h b/ui/annotationwidgets.h --- a/ui/annotationwidgets.h +++ b/ui/annotationwidgets.h @@ -180,6 +180,7 @@ QCheckBox * m_useColor; KColorButton * m_innerColor; QDoubleSpinBox * m_spinSize; + QComboBox * m_termStyleCombo; }; class HighlightAnnotationWidget diff --git a/ui/annotationwidgets.cpp b/ui/annotationwidgets.cpp --- a/ui/annotationwidgets.cpp +++ b/ui/annotationwidgets.cpp @@ -537,6 +537,27 @@ } connect( m_spinSize, SIGNAL(valueChanged(double)), this, SIGNAL(dataChanged()) ); + //Line Term Styles + QLabel * tmplabel3 = new QLabel( i18n( "Line End:" ), widget ); + gridlay2->addWidget( tmplabel3, 1, 0, Qt::AlignRight ); + m_termStyleCombo = new KComboBox( widget ); + tmplabel3->setBuddy( m_termStyleCombo ); + gridlay2->addWidget( m_termStyleCombo ); + + m_termStyleCombo->addItem( i18n( "□ Square" ) ); + m_termStyleCombo->addItem( i18n( "○ Circle" ) ); + m_termStyleCombo->addItem( i18n( "◇ Diamond" ) ); + m_termStyleCombo->addItem( i18n( "→ Open Arrow" ) ); + m_termStyleCombo->addItem( i18n( "⇾ Closed Arrow" ) ); + m_termStyleCombo->addItem( i18n( "None" ) ); + m_termStyleCombo->addItem( i18n( "⊣ Butt" ) ); + m_termStyleCombo->addItem( i18n( "⤚ Right Open Arrow" ) ); + m_termStyleCombo->addItem( i18n( "-⨞ Right Closed Arrow" ) ); + m_termStyleCombo->addItem( i18n( "-⧸ Slash" ) ); + m_termStyleCombo->setCurrentIndex( m_lineAnn->lineEndStyle() ); + + connect( m_termStyleCombo, SIGNAL(currentIndexChanged(int)), this, SIGNAL(dataChanged()) ); + return widget; } @@ -560,6 +581,7 @@ } } m_lineAnn->style().setWidth( m_spinSize->value() ); + m_lineAnn->setLineEndStyle( (Okular::LineAnnotation::TermStyle)m_termStyleCombo->currentIndex()); } diff --git a/ui/pageviewannotator.cpp b/ui/pageviewannotator.cpp --- a/ui/pageviewannotator.cpp +++ b/ui/pageviewannotator.cpp @@ -463,6 +463,8 @@ if ( m_annotElement.hasAttribute( QStringLiteral("leadBack") ) ) la->setLineLeadingBackwardPoint( m_annotElement.attribute( QStringLiteral("leadBack") ).toDouble() ); } + if ( m_annotElement.hasAttribute( QStringLiteral("endStyle") ) ) + la->setLineEndStyle( (Okular::LineAnnotation::TermStyle)m_annotElement.attribute( QStringLiteral("endStyle") ).toInt() ); la->setBoundingRectangle( normRect );