TUI: start each chapter on top of text
authorNiki Roo <niki@nikiroo.be>
Fri, 30 Jun 2017 13:20:36 +0000 (15:20 +0200)
committerNiki Roo <niki@nikiroo.be>
Fri, 30 Jun 2017 13:20:36 +0000 (15:20 +0200)
libs/jexer-0.0.4-sources.patch.jar
src/be/nikiroo/fanfix/reader/TuiReaderStoryWindow.java

index 05004dd145b615f98eac2ad80006e5d3dfd78f2d..5b1539cd54bfd3b8109649765803fd2d945e80de 100644 (file)
Binary files a/libs/jexer-0.0.4-sources.patch.jar and b/libs/jexer-0.0.4-sources.patch.jar differ
index ce4c58ab77c03a044da68a1eeb2c23c08465610c..7eb592fd4686666a6237d4787243e2dd55ab1711 100644 (file)
@@ -9,7 +9,7 @@ import jexer.TButton;
 import jexer.TCommand;
 import jexer.TKeypress;
 import jexer.TLabel;
-import jexer.TText2;
+import jexer.TText;
 import jexer.TWindow;
 import jexer.event.TResizeEvent;
 import be.nikiroo.fanfix.Instance;
@@ -21,7 +21,7 @@ import be.nikiroo.fanfix.data.Story;
 public class TuiReaderStoryWindow extends TWindow {
        private MetaData meta;
        private Story story;
-       private TText2 textField;
+       private TText textField;
        private int chapter = -2;
        private List<TButton> navigationButtons;
        private TLabel chapterName;
@@ -36,7 +36,7 @@ public class TuiReaderStoryWindow extends TWindow {
 
                // TODO: show all meta info before?
 
-               textField = new TText2(this, "", 0, 0, getWidth() - 2, getHeight() - 2);
+               textField = new TText(this, "", 0, 0, getWidth() - 2, getHeight() - 2);
 
                statusBar = newStatusBar(desc(meta));
                statusBar.addShortcutKeypress(TKeypress.kbF10, TCommand.cmExit, "Exit");
@@ -150,6 +150,7 @@ public class TuiReaderStoryWindow extends TWindow {
                        }
                        textField.setText(builder.toString());
                        textField.reflow();
+                       textField.toTop();
                }
        }