Changeset View
Changeset View
Standalone View
Standalone View
generators/epub/converter.cpp
Show First 20 Lines • Show All 290 Lines • ▼ Show 20 Line(s) | 209 | if(epub_it_get_curr(it)) { | |||
---|---|---|---|---|---|
291 | const QPalette orig = qApp->palette(); | 291 | const QPalette orig = qApp->palette(); | ||
292 | QPalette p = orig; | 292 | QPalette p = orig; | ||
293 | p.setColor(QPalette::Link, Qt::blue); | 293 | p.setColor(QPalette::Link, Qt::blue); | ||
294 | qApp->setPalette(p); | 294 | qApp->setPalette(p); | ||
295 | // HACK END | 295 | // HACK END | ||
296 | 296 | | |||
297 | QTextBlock before; | 297 | QTextBlock before; | ||
298 | if(firstPage) { | 298 | if(firstPage) { | ||
299 | // preHtml & postHtml make it possible to have a margin around the content of the page | 299 | mTextDocument->setHtml(htmlContent); | ||
300 | const QString preHtml = QString::fromLatin1("<html><head></head><body>" | | |||
301 | "<table style=\"-qt-table-type: root; margin-top:%1px; margin-bottom:%1px; margin-left:%1px; margin-right:%1px;\">" | | |||
302 | "<tr>" | | |||
303 | "<td style=\"border: none;\">").arg(mTextDocument->padding); | | |||
304 | const QString postHtml = QStringLiteral("</tr></table></body></html>"); | | |||
305 | mTextDocument->setHtml(preHtml + htmlContent + postHtml); | | |||
306 | firstPage = false; | 300 | firstPage = false; | ||
307 | before = mTextDocument->begin(); | 301 | before = mTextDocument->begin(); | ||
308 | } else { | 302 | } else { | ||
309 | before = _cursor->block(); | 303 | before = _cursor->block(); | ||
310 | _cursor->insertHtml(htmlContent); | 304 | _cursor->insertHtml(htmlContent); | ||
311 | } | 305 | } | ||
312 | // HACK BEGIN | 306 | // HACK BEGIN | ||
313 | qApp->setPalette(orig); | 307 | qApp->setPalette(orig); | ||
▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines |