From: Niki Roo Date: Wed, 6 May 2020 21:56:29 +0000 (+0200) Subject: touch frame update X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=0d47e23fdf83d8ae81ea57458ef1a4998efbf848;p=fanfix-swing.git touch frame update --- diff --git a/src/be/nikiroo/fanfix_swing/gui/TouchFrame.java b/src/be/nikiroo/fanfix_swing/gui/TouchFrame.java index 85730550..95faeb28 100644 --- a/src/be/nikiroo/fanfix_swing/gui/TouchFrame.java +++ b/src/be/nikiroo/fanfix_swing/gui/TouchFrame.java @@ -29,6 +29,8 @@ public class TouchFrame extends JFrame { private BooksPanel books; public TouchFrame() { + setLayout(new BorderLayout()); + active = new ArrayList(); root = new JPanel(new BorderLayout()); @@ -75,7 +77,7 @@ public class TouchFrame extends JFrame { } }); - this.add(root); + this.add(root, BorderLayout.CENTER); showBooks(); setSize(355, 465); } @@ -103,26 +105,32 @@ public class TouchFrame extends JFrame { } private void open(Story story) { + final JComponent[] comps = new JComponent[2]; + // Integrate it with showViewer or something if (story.getMeta().isImageDocument()) { ViewerImages viewer = new ViewerImages(story) { @Override protected JToolBar createToolBar() { - JToolBar toolbar = super.createToolBar(); - active.add(toolbar); - TouchFrame.this.add(toolbar, BorderLayout.NORTH); + comps[0] = super.createToolBar(); return null; } @Override protected void initGui() { super.initGui(); - removeShows(); - active.add(scroll); - root.add(scroll); + comps[1] = scroll; } }; + removeShows(); + + // TODO: toolbar not so nice + add EXIT button + active.add(comps[0]); + active.add(comps[1]); + TouchFrame.this.add(comps[0], BorderLayout.NORTH); + root.add(comps[1]); + revalidate(); repaint();