| 268 | } |
| 269 | |
| 270 | void AnnotWindow::reloadInfo() |
| 271 | { |
| 272 | QColor newcolor; |
| 273 | if (m_annot->subType() == Okular::Annotation::AText) { |
| 274 | Okular::TextAnnotation *textAnn = static_cast<Okular::TextAnnotation *>(m_annot); |
| 275 | if (textAnn->textType() == Okular::TextAnnotation::InPlace && textAnn->inplaceIntent() == Okular::TextAnnotation::TypeWriter) { |
| 276 | newcolor = QColor(0xfd, 0xfd, 0x96); |
| 277 | } |
| 278 | } |
| 279 | if (!newcolor.isValid()) { |
| 280 | 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; |
| 281 | } |
| 282 | if (newcolor != m_color) { |
| 283 | m_color = newcolor; |
| 284 | setPalette(QPalette(m_color)); |
| 285 | QPalette pl = textEdit->palette(); |
| 286 | pl.setColor(QPalette::Base, m_color); |
| 287 | textEdit->setPalette(pl); |
| 288 | } |
| 289 | m_title->setAuthor(m_annot->author()); |
| 290 | m_title->setDate(m_annot->modificationDate()); |
| 291 | } |
| 292 | |
| 293 | int AnnotWindow::pageNumber() const |
| 294 | { |
no test coverage detected