From: Niki Roo Date: Sun, 24 Mar 2019 17:08:22 +0000 (+0100) Subject: gui: improve internal text reader X-Git-Tag: fanfix-2.0.0~4 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=e2da2602b60d4cbf5f9743d6733ec2f85555b9ed;p=fanfix.git gui: improve internal text reader --- diff --git a/src/be/nikiroo/fanfix/reader/ui/GuiReaderViewerTextOutput.java b/src/be/nikiroo/fanfix/reader/ui/GuiReaderViewerTextOutput.java index e9a44b5..47d9664 100644 --- a/src/be/nikiroo/fanfix/reader/ui/GuiReaderViewerTextOutput.java +++ b/src/be/nikiroo/fanfix/reader/ui/GuiReaderViewerTextOutput.java @@ -6,6 +6,7 @@ import java.util.Arrays; import be.nikiroo.fanfix.Instance; import be.nikiroo.fanfix.data.Chapter; import be.nikiroo.fanfix.data.Paragraph; +import be.nikiroo.fanfix.data.Paragraph.ParagraphType; import be.nikiroo.fanfix.data.Story; import be.nikiroo.fanfix.output.BasicOutput; @@ -57,27 +58,35 @@ public class GuiReaderViewerTextOutput { @Override protected void writeParagraph(Paragraph para) throws IOException { + if ((para.getType() == ParagraphType.QUOTE) == !paraInQuote) { + paraInQuote = !paraInQuote; + if (paraInQuote) { + builder.append("
"); + builder.append("
"); + } else { + builder.append("
"); + builder.append("
"); + } + } + switch (para.getType()) { case NORMAL: + builder.append("    "); builder.append(decorateText(para.getContent())); builder.append("
"); break; case BLANK: - builder.append("
"); + builder.append("

"); break; case BREAK: - builder.append("
* * *

"); + builder.append("

"); + builder.append("* * *"); + builder.append("



"); break; case QUOTE: - if (!paraInQuote) { - builder.append("
"); - } else { - builder.append("
"); - } - paraInQuote = !paraInQuote; - builder.append("
"); - builder.append("–  "); + builder.append("    "); + builder.append("— "); builder.append(decorateText(para.getContent())); builder.append("
"); @@ -88,7 +97,7 @@ public class GuiReaderViewerTextOutput { @Override protected String enbold(String word) { - return "" + word + ""; + return "" + word + ""; } @Override