From 080aa831b3ebd2e3d738beb6bf7a07f64b78b095 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Tue, 5 May 2020 22:38:31 +0200 Subject: [PATCH] importer item: re-add overlay percentage complete --- .../fanfix_swing/gui/importer/ImporterItem.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/be/nikiroo/fanfix_swing/gui/importer/ImporterItem.java b/src/be/nikiroo/fanfix_swing/gui/importer/ImporterItem.java index e18b2596..3367ee04 100644 --- a/src/be/nikiroo/fanfix_swing/gui/importer/ImporterItem.java +++ b/src/be/nikiroo/fanfix_swing/gui/importer/ImporterItem.java @@ -3,6 +3,8 @@ package be.nikiroo.fanfix_swing.gui.importer; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Font; +import java.awt.Graphics; +import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -251,4 +253,17 @@ public class ImporterItem extends ListenerPanel implements Hoverable { } }); } + + @Override + public void paint(Graphics g) { + // Overlay up to x% completed + Rectangle clip = g.getClipBounds(); + if (!(clip == null || clip.getWidth() <= 0 || clip.getHeight() <= 0)) { + g.setColor(new Color(200, 200, 255, 128)); + g.fillRect(clip.x, clip.y, (int) Math.round(clip.width * progress), + clip.height); + } + + super.paint(g); + } } \ No newline at end of file -- 2.27.0