Commit 97263dcd authored by Pino Toscano's avatar Pino Toscano

- drop the "stamp-" prefix from svg stamps: first the stamp is searched among...

- drop the "stamp-" prefix from svg stamps: first the stamp is searched among the SVG stamps, otherwise the classic "icon" loading is tried
- now that we have all the graphics for them, activate the standard PDF stamps, yay!

svn path=/trunk/KDE/kdegraphics/okular/; revision=884844
parent 0b399926
......@@ -265,13 +265,11 @@ QWidget * StampAnnotationWidget::createStyleWidget()
gblay->addWidget( m_pixmapSelector );
m_pixmapSelector->setEditable( true );
// FIXME!!! use the standard names instead (when we'll have the artwork)
m_pixmapSelector->addItem( i18n( "Okular" ), "okular" );
m_pixmapSelector->addItem( i18n( "Bookmark" ), "bookmarks" );
m_pixmapSelector->addItem( i18n( "KDE" ), "kde" );
m_pixmapSelector->addItem( i18n( "Information" ), "help-about" );
m_pixmapSelector->addItem( i18n( "Approved" ), "stamp-approved" );
#if 0
m_pixmapSelector->addItem( i18n( "Approved" ), "Approved" );
m_pixmapSelector->addItem( i18n( "As Is" ), "AsIs" );
m_pixmapSelector->addItem( i18n( "Confidential" ), "Confidential" );
m_pixmapSelector->addItem( i18n( "Departmental" ), "Departmental" );
......@@ -285,7 +283,6 @@ QWidget * StampAnnotationWidget::createStyleWidget()
m_pixmapSelector->addItem( i18n( "Not For Public Release" ), "NotForPublicRelease" );
m_pixmapSelector->addItem( i18n( "Sold" ), "Sold" );
m_pixmapSelector->addItem( i18n( "Top Secret" ), "TopSecret" );
#endif
m_pixmapSelector->setIcon( m_stampAnn->stampIconName() );
m_pixmapSelector->setPreviewSize( 64 );
......
......@@ -165,21 +165,17 @@ QString prettyToolTip( const Okular::Annotation * ann )
QPixmap loadStamp( const QString& _name, const QSize& size, int iconSize )
{
const QString name = _name.toLower();
if ( name.startsWith( QLatin1String( "stamp-" ) ) )
QSvgRenderer * r = 0;
if ( ( r = s_data->svgStamps() ) && r->elementExists( name ) )
{
const QString stampName = name.mid( 6 );
QSvgRenderer * r = 0;
if ( ( r = s_data->svgStamps() ) && r->elementExists( stampName ) )
{
const QRectF stampElemRect = r->boundsOnElement( stampName );
const QRectF stampRect( size.isValid() ? QRectF( QPointF( 0, 0 ), size ) : stampElemRect );
QPixmap pixmap( stampRect.size().toSize() );
pixmap.fill( Qt::transparent );
QPainter p( &pixmap );
r->render( &p, stampName );
p.end();
return pixmap;
}
const QRectF stampElemRect = r->boundsOnElement( name );
const QRectF stampRect( size.isValid() ? QRectF( QPointF( 0, 0 ), size ) : stampElemRect );
QPixmap pixmap( stampRect.size().toSize() );
pixmap.fill( Qt::transparent );
QPainter p( &pixmap );
r->render( &p, name );
p.end();
return pixmap;
}
QPixmap pixmap;
const KIconLoader * il = iconLoader();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment