improve cached icon
authorNiki Roo <niki@nikiroo.be>
Wed, 8 Apr 2020 21:45:29 +0000 (23:45 +0200)
committerNiki Roo <niki@nikiroo.be>
Wed, 8 Apr 2020 21:45:29 +0000 (23:45 +0200)
src/be/nikiroo/fanfix_swing/gui/book/BookCoverImager.java
src/be/nikiroo/fanfix_swing/gui/book/BookLine.java

index 84a4f944417f5b7a30f02e262a0e8839812f5677..8bdcfabfee341b26bea43f05fe04df70c0d78627 100644 (file)
@@ -39,7 +39,8 @@ class BookCoverImager {
        static final Color SPINE_COLOR_RIGHT = new Color(100, 100, 100);
        static final Color BORDER = Color.black;
 
-       public static final Color UNCACHED_ICON_COLOR = new Color(0, 80, 220);
+       public static final Color UNCACHED_ICON_COLOR = Color.green.darker(); 
+                       // new Color(0, 80, 220);
 
        public static final int TEXT_HEIGHT = 50;
        public static final int TEXT_WIDTH = COVER_WIDTH + 40;
@@ -106,9 +107,7 @@ class BookCoverImager {
                g.setColor(color);
                g.fillRect(clip.x, clip.y, clip.width, clip.height);
 
-               if (!cached) {
-                       UIUtils.drawEllipse3D(g, UNCACHED_ICON_COLOR, COVER_WIDTH + HOFFSET + 30, 10, 20, 20);
-               }
+               UIUtils.drawEllipse3D(g, UNCACHED_ICON_COLOR, COVER_WIDTH + HOFFSET + 30, 10, 20, 20, cached);
        }
 
        /**
index b4c6be41c7123786a9d33bfbd9bb1bfa150a8a19..beb4c973674eb2b6483e28aa28bc6647224710e7 100644 (file)
@@ -2,11 +2,11 @@ package be.nikiroo.fanfix_swing.gui.book;
 
 import java.awt.BorderLayout;
 import java.awt.Color;
-import java.awt.Dimension;
 import java.awt.Graphics;
 
 import javax.swing.JLabel;
 import javax.swing.JPanel;
+import javax.swing.SwingConstants;
 
 import be.nikiroo.fanfix.data.Story;
 import be.nikiroo.fanfix_swing.gui.BooksPanel;
@@ -52,19 +52,29 @@ public class BookLine extends JPanel {
         * Initialise this {@link BookLine}.
         */
        protected void init() {
-               // TODO: image?
-               iconCached = new JLabel("   ");
-               iconNotCached = new JLabel(" * ");
+               iconCached = new JLabel(" ◉ ");
+               iconNotCached = new JLabel(" ○ ");
 
                iconNotCached.setForeground(BookCoverImager.UNCACHED_ICON_COLOR);
+               iconCached.setForeground(BookCoverImager.UNCACHED_ICON_COLOR);
                iconCached.setPreferredSize(iconNotCached.getPreferredSize());
 
                title = new JLabel();
                secondary = new JLabel();
                secondary.setForeground(AUTHOR_COLOR);
 
+               JLabel id = new JLabel(info.getMeta().getLuid());
+               id.setPreferredSize(new JLabel(" 999 ").getPreferredSize());
+               id.setForeground(Color.gray);
+               id.setHorizontalAlignment(SwingConstants.CENTER);
+
+               JPanel idTitle = new JPanel(new BorderLayout());
+               idTitle.setOpaque(false);
+               idTitle.add(id, BorderLayout.WEST);
+               idTitle.add(title, BorderLayout.CENTER);
+
                setLayout(new BorderLayout());
-               add(title, BorderLayout.CENTER);
+               add(idTitle, BorderLayout.CENTER);
                add(secondary, BorderLayout.EAST);
 
                updateMeta();