From: Niki Roo Date: Mon, 4 Mar 2019 14:09:32 +0000 (+0100) Subject: TUI: better display of stories X-Git-Tag: fanfix-2.0.0~83 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=9293188fcedc803a8a5a800007b9ac8febdb00ce;p=fanfix.git TUI: better display of stories --- diff --git a/src/be/nikiroo/fanfix/reader/tui/TuiReaderStoryWindow.java b/src/be/nikiroo/fanfix/reader/tui/TuiReaderStoryWindow.java index ead70d4..51d8fa0 100644 --- a/src/be/nikiroo/fanfix/reader/tui/TuiReaderStoryWindow.java +++ b/src/be/nikiroo/fanfix/reader/tui/TuiReaderStoryWindow.java @@ -15,6 +15,7 @@ import jexer.event.TResizeEvent; import be.nikiroo.fanfix.data.Chapter; import be.nikiroo.fanfix.data.MetaData; import be.nikiroo.fanfix.data.Paragraph; +import be.nikiroo.fanfix.data.Paragraph.ParagraphType; import be.nikiroo.fanfix.data.Story; import be.nikiroo.fanfix.library.BasicLibrary; @@ -160,7 +161,13 @@ class TuiReaderStoryWindow extends TWindow { builder.append("\n\n"); if (chap != null) { for (Paragraph para : chap) { - builder.append(para.getContent()).append("\n\n"); + if (para.getType() == ParagraphType.BREAK) { + builder.append("\n"); + } + builder.append(para.getContent()).append("\n"); + if (para.getType() == ParagraphType.BREAK) { + builder.append("\n"); + } } } textField.setText(builder.toString());