Changeset View
Changeset View
Standalone View
Standalone View
ui/pageviewannotator.cpp
Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Line(s) | 129 | { | |||
---|---|---|---|---|---|
136 | painter->drawRect( realrect ); | 136 | painter->drawRect( realrect ); | ||
137 | painter->setPen( origpen ); | 137 | painter->setPen( origpen ); | ||
138 | } | 138 | } | ||
139 | if ( !pixmap.isNull() ) | 139 | if ( !pixmap.isNull() ) | ||
140 | painter->drawPixmap( QPointF( rect.left * xScale, rect.top * yScale ), pixmap ); | 140 | painter->drawPixmap( QPointF( rect.left * xScale, rect.top * yScale ), pixmap ); | ||
141 | } | 141 | } | ||
142 | } | 142 | } | ||
143 | 143 | | |||
144 | void addInPlaceTextAnnotation( Okular::Annotation * &ann, const QString summary, const QString content, Okular::TextAnnotation::InplaceIntent inplaceIntent ) | 144 | void addInPlaceTextAnnotation( Okular::Annotation * &ann, const QString &summary, const QString &content, Okular::TextAnnotation::InplaceIntent inplaceIntent ) | ||
145 | { | 145 | { | ||
146 | Okular::TextAnnotation * ta = new Okular::TextAnnotation(); | 146 | Okular::TextAnnotation * ta = new Okular::TextAnnotation(); | ||
147 | ann = ta; | 147 | ann = ta; | ||
148 | ta->setFlags( ta->flags() | Okular::Annotation::FixedRotation ); | 148 | ta->setFlags( ta->flags() | Okular::Annotation::FixedRotation ); | ||
149 | ta->setContents( content ); | 149 | ta->setContents( content ); | ||
150 | ta->setTextType( Okular::TextAnnotation::InPlace ); | 150 | ta->setTextType( Okular::TextAnnotation::InPlace ); | ||
151 | ta->setInplaceIntent( inplaceIntent ); | 151 | ta->setInplaceIntent( inplaceIntent ); | ||
152 | //set alignment | 152 | //set alignment | ||
▲ Show 20 Lines • Show All 968 Lines • ▼ Show 20 Line(s) | |||||
1121 | { | 1121 | { | ||
1122 | QPixmap pixmap( 32 * qApp->devicePixelRatio(), 32 * qApp->devicePixelRatio() ); | 1122 | QPixmap pixmap( 32 * qApp->devicePixelRatio(), 32 * qApp->devicePixelRatio() ); | ||
1123 | pixmap.setDevicePixelRatio( qApp->devicePixelRatio() ); | 1123 | pixmap.setDevicePixelRatio( qApp->devicePixelRatio() ); | ||
1124 | const QString annotType = toolElement.attribute( QStringLiteral("type") ); | 1124 | const QString annotType = toolElement.attribute( QStringLiteral("type") ); | ||
1125 | 1125 | | |||
1126 | // Load HiDPI variant on HiDPI screen | 1126 | // Load HiDPI variant on HiDPI screen | ||
1127 | QString imageVariant; | 1127 | QString imageVariant; | ||
1128 | if ( qApp->devicePixelRatio() > 1.05 ) { | 1128 | if ( qApp->devicePixelRatio() > 1.05 ) { | ||
1129 | imageVariant = "@2x"; | 1129 | imageVariant = QStringLiteral("@2x"); | ||
1130 | } | 1130 | } | ||
1131 | 1131 | | |||
1132 | // Load base pixmap. We'll draw on top of it | 1132 | // Load base pixmap. We'll draw on top of it | ||
1133 | pixmap.load( QStandardPaths::locate(QStandardPaths::GenericDataLocation, QString("okular/pics/tool-base-okular" + imageVariant + ".png") ) ); | 1133 | pixmap.load( QStandardPaths::locate(QStandardPaths::GenericDataLocation, QString("okular/pics/tool-base-okular" + imageVariant + ".png") ) ); | ||
1134 | 1134 | | |||
1135 | /* Parse color, innerColor and icon (if present) */ | 1135 | /* Parse color, innerColor and icon (if present) */ | ||
1136 | QColor engineColor, innerColor, textColor, annotColor; | 1136 | QColor engineColor, innerColor, textColor, annotColor; | ||
1137 | QString icon; | 1137 | QString icon; | ||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |