Changeset View
Changeset View
Standalone View
Standalone View
ui/annotwindow.cpp
Show First 20 Lines • Show All 253 Lines • ▼ Show 20 Line(s) | |||||
254 | 254 | | |||
255 | void AnnotWindow::updateAnnotation( Okular::Annotation * a ) | 255 | void AnnotWindow::updateAnnotation( Okular::Annotation * a ) | ||
256 | { | 256 | { | ||
257 | m_annot = a; | 257 | m_annot = a; | ||
258 | } | 258 | } | ||
259 | 259 | | |||
260 | void AnnotWindow::reloadInfo() | 260 | void AnnotWindow::reloadInfo() | ||
261 | { | 261 | { | ||
262 | const QColor newcolor = m_annot->style().color().isValid() ? m_annot->style().color() : Qt::yellow; | 262 | QColor newcolor; | ||
263 | if ( m_annot->subType() == Okular::Annotation::AText ) | ||||
264 | { | ||||
265 | Okular::TextAnnotation * textAnn = static_cast< Okular::TextAnnotation * >( m_annot ); | ||||
266 | if ( textAnn->textType() == Okular::TextAnnotation::InPlace && textAnn->inplaceIntent() == Okular::TextAnnotation::TypeWriter ) | ||||
267 | newcolor = QColor("#fdfd96"); | ||||
268 | } | ||||
269 | if ( !newcolor.isValid() ) | ||||
270 | newcolor = m_annot->style().color().isValid() ? QColor(m_annot->style().color().red(), m_annot->style().color().green(), m_annot->style().color().blue(), 255) : Qt::yellow; | ||||
263 | if ( newcolor != m_color ) | 271 | if ( newcolor != m_color ) | ||
264 | { | 272 | { | ||
265 | m_color = newcolor; | 273 | m_color = newcolor; | ||
266 | setPalette( QPalette( m_color ) ); | 274 | setPalette( QPalette( m_color ) ); | ||
267 | QPalette pl = textEdit->palette(); | 275 | QPalette pl = textEdit->palette(); | ||
268 | pl.setColor( QPalette::Base, m_color ); | 276 | pl.setColor( QPalette::Base, m_color ); | ||
269 | textEdit->setPalette( pl ); | 277 | textEdit->setPalette( pl ); | ||
270 | } | 278 | } | ||
▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines |