From 89f2c4799d6a9d16d2c909da175621e0f2eda301 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Wed, 8 Apr 2020 17:55:14 +0200 Subject: [PATCH] BookLine: fixed size and highlight colour for the * --- src/be/nikiroo/fanfix_swing/gui/book/BookCoverImager.java | 4 +++- src/be/nikiroo/fanfix_swing/gui/book/BookLine.java | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/be/nikiroo/fanfix_swing/gui/book/BookCoverImager.java b/src/be/nikiroo/fanfix_swing/gui/book/BookCoverImager.java index 9d3aa9f..84a4f94 100644 --- a/src/be/nikiroo/fanfix_swing/gui/book/BookCoverImager.java +++ b/src/be/nikiroo/fanfix_swing/gui/book/BookCoverImager.java @@ -39,6 +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 int TEXT_HEIGHT = 50; public static final int TEXT_WIDTH = COVER_WIDTH + 40; @@ -105,7 +107,7 @@ class BookCoverImager { g.fillRect(clip.x, clip.y, clip.width, clip.height); if (!cached) { - UIUtils.drawEllipse3D(g, new Color(0, 80, 220), COVER_WIDTH + HOFFSET + 30, 10, 20, 20); + UIUtils.drawEllipse3D(g, UNCACHED_ICON_COLOR, COVER_WIDTH + HOFFSET + 30, 10, 20, 20); } } diff --git a/src/be/nikiroo/fanfix_swing/gui/book/BookLine.java b/src/be/nikiroo/fanfix_swing/gui/book/BookLine.java index 6437f61..b4c6be4 100644 --- a/src/be/nikiroo/fanfix_swing/gui/book/BookLine.java +++ b/src/be/nikiroo/fanfix_swing/gui/book/BookLine.java @@ -2,6 +2,7 @@ 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; @@ -51,10 +52,13 @@ public class BookLine extends JPanel { * Initialise this {@link BookLine}. */ protected void init() { - // TODO: image + // TODO: image? iconCached = new JLabel(" "); iconNotCached = new JLabel(" * "); + iconNotCached.setForeground(BookCoverImager.UNCACHED_ICON_COLOR); + iconCached.setPreferredSize(iconNotCached.getPreferredSize()); + title = new JLabel(); secondary = new JLabel(); secondary.setForeground(AUTHOR_COLOR); @@ -154,7 +158,7 @@ public class BookLine extends JPanel { String main = info.getMainInfo(); String optSecondary = info.getSecondaryInfo(seeWordCount); - //TODO: max size limit? + // TODO: max size limit? title.setText(main); secondary.setText(optSecondary + " "); -- 2.27.0