From d47101676b538d72d8943bd32fe356ceb5b45222 Mon Sep 17 00:00:00 2001 From: Bill Kuker Date: Mon, 2 Jul 2012 18:44:02 +0000 Subject: [PATCH] Give a better indication that the button this colorIcon is on is disabled: Draw an empty outline rectangle if disabled, a filled rectangle if enabled. --- core/src/net/sf/openrocket/gui/components/ColorIcon.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/net/sf/openrocket/gui/components/ColorIcon.java b/core/src/net/sf/openrocket/gui/components/ColorIcon.java index eb68ea168..8da617d22 100644 --- a/core/src/net/sf/openrocket/gui/components/ColorIcon.java +++ b/core/src/net/sf/openrocket/gui/components/ColorIcon.java @@ -34,8 +34,13 @@ public class ColorIcon implements Icon { @Override public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y) { - g.setColor(color); - g.fillRect(x, y, getIconWidth(), getIconHeight()); + if ( c.isEnabled() ){ + g.setColor(color); + g.fillRect(x, y, getIconWidth(), getIconHeight()); + } else { + g.setColor(color); + g.drawRect(x, y, getIconWidth(), getIconHeight()); + } } }