From 8702b1421f88b9e39011e82ade9b50172042e656 Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Fri, 23 Jul 2010 17:06:23 -0400 Subject: [PATCH] Fix for issue #777, also fixed a declared type while I was at it --- AppKit/CPMenu/CPMenu.j | 2 +- AppKit/CPPopUpButton.j | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/AppKit/CPMenu/CPMenu.j b/AppKit/CPMenu/CPMenu.j index 39203dfa7..4cdcd7a16 100644 --- a/AppKit/CPMenu/CPMenu.j +++ b/AppKit/CPMenu/CPMenu.j @@ -75,7 +75,7 @@ var _CPMenuBarVisible = NO, id _delegate; - CPMenuItem _highlightedIndex; + int _highlightedIndex; _CPMenuWindow _menuWindow; } diff --git a/AppKit/CPPopUpButton.j b/AppKit/CPPopUpButton.j index b5ac0e1e1..6072501dd 100644 --- a/AppKit/CPPopUpButton.j +++ b/AppKit/CPPopUpButton.j @@ -662,6 +662,9 @@ CPPopUpButtonStatePullsDown = CPThemeState("pulls-down"); location = CGPointMake(CGRectGetMinX(contentRect) - standardLeftMargin, 0.0); minimumWidth += standardLeftMargin; + + // To ensure the selected item is highlighted correctly, unset the highlighted item + [menu _highlightItemAtIndex:CPNotFound]; } [menu setMinimumWidth:minimumWidth];