Skip to content

Commit

Permalink
add support for <subtitle> tag in FictionBook
Browse files Browse the repository at this point in the history
(cherry picked from commit bcdd5a9)
  • Loading branch information
slonopotamus authored and tsdgeos committed Nov 26, 2020
1 parent 239827b commit 9f7b452
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion generators/fictionbook/converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,22 @@ bool Converter::convertPoem(const QDomElement &element)

bool Converter::convertSubTitle(const QDomElement &element)
{
Q_UNUSED(element)
QTextFrame *topFrame = mCursor->currentFrame();

QTextFrameFormat frameFormat;
frameFormat.setBorder(1);
frameFormat.setPadding(8);
frameFormat.setBackground(Qt::lightGray);
frameFormat.setTopMargin(16);

mCursor->insertFrame(frameFormat);

if (!convertParagraph(element)) {
return false;
}

mCursor->setPosition(topFrame->lastPosition());

return true;
}

Expand Down

0 comments on commit 9f7b452

Please sign in to comment.