Made line extensions configurable in the straight line annotation tool

remotes/origin/epub-qtextdoc
Fabio D'Urso 14 years ago
parent 51076a2653
commit 6bce1b85bc
  1. 11
      conf/widgetannottools.cpp
  2. 7
      ui/pageviewannotator.cpp

@ -302,12 +302,17 @@ QString NewAnnotToolDialog::toolXml() const
else if ( toolType == "straight-line" )
{
Okular::LineAnnotation * la = static_cast<Okular::LineAnnotation*>( m_stubann );
Q_UNUSED( la );
QString lineExt;
if ( la->lineLeadingForwardPoint() != 0 || la->lineLeadingBackwardPoint() != 0 )
lineExt = QString( "leadFwd=\"%1\" leadBack=\"%2\"" ).arg( la->lineLeadingForwardPoint() ).arg( la->lineLeadingBackwardPoint() );
return QString( "<tool type=\"straight-line\">"
"<engine type=\"PolyLine\" color=\"%1\" points=\"2\">"
"<annotation type=\"Line\" color=\"%1\" opacity=\"%2\" width=\"%3\" />"
"<annotation type=\"Line\" color=\"%1\" opacity=\"%2\" width=\"%3\" %4 />"
"</engine>"
"</tool>" ).arg( color ).arg( opacity ).arg( width );
"</tool>" ).arg( color ).arg( opacity ).arg( width )
.arg( lineExt );
}
else if ( toolType == "polygon" )
{

@ -421,6 +421,13 @@ class PolyLineEngine : public AnnotatorEngine
if ( m_annotElement.hasAttribute( "innerColor" ) )
la->setLineInnerColor( QColor( m_annotElement.attribute( "innerColor" ) ) );
}
else if ( numofpoints == 2 )
{
if ( m_annotElement.hasAttribute( "leadFwd" ) )
la->setLineLeadingForwardPoint( m_annotElement.attribute( "leadFwd" ).toDouble() );
if ( m_annotElement.hasAttribute( "leadBack" ) )
la->setLineLeadingBackwardPoint( m_annotElement.attribute( "leadBack" ).toDouble() );
}
la->setBoundingRectangle( normRect );

Loading…
Cancel
Save