aboutsummaryrefslogtreecommitdiff
path: root/libjava/javax/swing/plaf/basic/BasicMenuItemUI.java
diff options
context:
space:
mode:
authorRoman Kennke <roman@kennke.org>2005-04-25 19:36:43 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2005-04-25 19:36:43 +0000
commit8efae6bbfa04f662589bbfc64dbbe68935f973d2 (patch)
tree6a73f30784c260b998e5fb2e421b3c002d8ff608 /libjava/javax/swing/plaf/basic/BasicMenuItemUI.java
parent9f62c3e3ed53732a8fe755ad5109c1a6ed25bb0c (diff)
downloadgcc-8efae6bbfa04f662589bbfc64dbbe68935f973d2.zip
gcc-8efae6bbfa04f662589bbfc64dbbe68935f973d2.tar.gz
gcc-8efae6bbfa04f662589bbfc64dbbe68935f973d2.tar.bz2
2005-04-25 Roman Kennke <roman@kennke.org>
* javax/swing/plaf/basic/BasicScrollBarUI.java (initDefaults): Initialize thumb*Color fields correctly. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/text/GapContent.java: Added API comments. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/plaf/metal/MetalBorders.java: Added inner class ScrollPaneBorder. * javax/swing/plaf/metal/MetalLookAndFeel.java (initComponentDefaults): Added default for "ScrollPane.border" to use the new ScrollPaneBorder. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/text/AbstractDocument.java: Added FIXME comments. This class still has to be implemented thread-safe. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/tree/DefaultTreeSelectionModel.java (DefaultTreeSelectionModel): Initialize listenerList here. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/plaf/metal/MetalTextFieldUI.java (createUI): Return one instance per Component instead of a shared instance. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/text/Document.java: Added API documentation comments. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/text/AbstractDocument.java (getDocumentProperties): Implemented. (setDocumentProperties): Implemented. (getProperty): Implemented. (putProperty): Implemented. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/BoxLayout (preferredLayoutSize): Fixed computation so that it correctly adds the top and bottom insets of the container. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/plaf/basic/BasicMenuItemUI.java (paintText): Make use of the 'selectionForeground' UI default for text painting. 2005-04-25 Roman Kennke <roman@kennke.org> * javax/swing/plaf/basic/BasicLookAndFeel.java (initSystemColorDefaults): Modified colors to match the BasicLookAndFeel in the reference implementation. (initComponentDefaults): Likewise. From-SVN: r98733
Diffstat (limited to 'libjava/javax/swing/plaf/basic/BasicMenuItemUI.java')
-rw-r--r--libjava/javax/swing/plaf/basic/BasicMenuItemUI.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/libjava/javax/swing/plaf/basic/BasicMenuItemUI.java b/libjava/javax/swing/plaf/basic/BasicMenuItemUI.java
index ff48a74..50af23a 100644
--- a/libjava/javax/swing/plaf/basic/BasicMenuItemUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicMenuItemUI.java
@@ -605,7 +605,17 @@ public class BasicMenuItemUI extends MenuItemUI
if (text != null && ! text.equals(""))
{
if (menuItem.isEnabled())
- g.setColor(menuItem.getForeground());
+ {
+ /* Menu item is considered to be highlighted when it is selected.
+ It is considered to be selected if menu item is inside some menu
+ and is armed or if it is both armed and pressed */
+ if (menuItem.getModel().isArmed()
+ && (menuItem.getParent() instanceof MenuElement
+ || menuItem.getModel().isPressed()))
+ g.setColor(selectionForeground);
+ else
+ g.setColor(menuItem.getForeground());
+ }
else
// FIXME: should fix this to use 'disabledForeground', but its
// default value in BasicLookAndFeel is null.