From bd36aa4f8d205b772a67963cf1d419355ebd4f86 Mon Sep 17 00:00:00 2001 From: Kirill Kalishev Date: Tue, 11 May 2010 13:21:32 +0400 Subject: [PATCH] Revert "revert: no background progress is visible" This reverts commit 5a8cf4a5c40ab15c49958f6e52ae3152897e4e2d. --- .../com/intellij/util/ui/AnimatedIcon.java | 40 +++++++------------ 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/platform/platform-api/src/com/intellij/util/ui/AnimatedIcon.java b/platform/platform-api/src/com/intellij/util/ui/AnimatedIcon.java index 5764bf40dbeb..72144f1242a1 100644 --- a/platform/platform-api/src/com/intellij/util/ui/AnimatedIcon.java +++ b/platform/platform-api/src/com/intellij/util/ui/AnimatedIcon.java @@ -150,33 +150,16 @@ public abstract class AnimatedIcon extends JComponent implements Disposable { protected void paintComponent(Graphics g) { if (myPaintingBgNow) return; - if ((myAnimator.isRunning() || myPaintPassive || (myLastPaintWasRunning && !myAnimator.isRunning()))) { - Rectangle b = getBounds(); - - if (!isOpaque()) { - try { - myPaintingBgNow = true; - Container p = getParent(); - if (p instanceof JComponent) { - JComponent parentComponent = (JComponent)p; - RepaintManager.currentManager(p).addDirtyRegion(parentComponent, b.x, b.y, b.width, b.height); - } - } - finally { - myPaintingBgNow = false; - } - } else { - Container parent = getParent(); - if (parent instanceof JComponent) { - final Component opaque = UIUtil.findNearestOpaque((JComponent)parent); - if (opaque != null) { - g.setColor(opaque.getBackground()); - g.fillRect(b.x, b.y, b.width, b.height); - } - } + if (isOpaque()) { + final Container parent = getParent(); + JComponent opaque = null; + if (parent instanceof JComponent) { + opaque = (JComponent)UIUtil.findNearestOpaque((JComponent)parent); } - - } + Color bg = opaque != null ? opaque.getBackground() : UIManager.getColor("Panel.background"); + g.setColor(bg); + g.fillRect(0, 0, getWidth(), getHeight()); + } Icon icon; @@ -207,4 +190,9 @@ public abstract class AnimatedIcon extends JComponent implements Disposable { public boolean isAnimated() { return true; } + + @Override + public String toString() { + return myName + " isRunning=" + myRunning + " isOpaque=" + isOpaque() + " paintPassive=" + myPaintPassive; + } }