X-Git-Url: https://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Freader%2Fui%2FGuiReaderGroup.java;h=17bf43cbb455a66bb357e68ddb53f0d97d426ebb;hb=b02c7819a6dcc0d62a0e9135d439f9352f5c80ce;hp=7b15425682b96e363df67c66d7a87ac7be35da9d;hpb=08e2185a6c13eb75e9b80e2523c0862959c88a13;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/reader/ui/GuiReaderGroup.java b/src/be/nikiroo/fanfix/reader/ui/GuiReaderGroup.java index 7b15425..17bf43c 100644 --- a/src/be/nikiroo/fanfix/reader/ui/GuiReaderGroup.java +++ b/src/be/nikiroo/fanfix/reader/ui/GuiReaderGroup.java @@ -179,8 +179,13 @@ public class GuiReaderGroup extends JPanel { * up/down one line at a time. */ private void computeItemsPerLine() { - // TODO - itemsPerLine = 5; + itemsPerLine = 1; + + if (books != null && books.size() > 0) { + // this.pane holds all the books with a hgap of 5 px + int wbook = books.get(0).getWidth() + 5; + itemsPerLine = pane.getWidth() / wbook; + } } /** @@ -270,6 +275,8 @@ public class GuiReaderGroup extends JPanel { pane.repaint(); validate(); repaint(); + + computeItemsPerLine(); } /**