mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Fix problem with pull-down menu not allowing same item to be selected twice in a row
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31232 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
56e074cdb8
commit
dda6652e85
2 changed files with 16 additions and 3 deletions
|
@ -1,3 +1,10 @@
|
|||
2010-09-02 Doug Simons <doug.simons@testplant.com>
|
||||
|
||||
* Source/NSPopUpButtonCell.m:
|
||||
Fix problem with pull-down menu not allowing same item to be selected
|
||||
twice in a row. Also correct setAltersStateOfSelectedItem: to work as
|
||||
described in the Cocoa docs (states were reversed).
|
||||
|
||||
2010-08-30 Doug Simons <doug.simons@testplant.com>
|
||||
|
||||
* Source/NSPopUpButtonCell.m:
|
||||
|
|
|
@ -320,11 +320,11 @@ static NSImage *_pbc_image[5];
|
|||
|
||||
if (flag)
|
||||
{
|
||||
[selectedItem setState: NSOffState];
|
||||
[selectedItem setState: NSOnState];
|
||||
}
|
||||
else
|
||||
{
|
||||
[selectedItem setState: NSOnState];
|
||||
[selectedItem setState: NSOffState];
|
||||
}
|
||||
|
||||
_pbcFlags.altersStateOfSelectedItem = flag;
|
||||
|
@ -649,7 +649,13 @@ static NSImage *_pbc_image[5];
|
|||
id<NSMenuItem> oldSelectedItem = _selectedItem;
|
||||
|
||||
if (_selectedItem == item)
|
||||
return;
|
||||
{
|
||||
// pull-down should set highlighted item even when selection is unchanged
|
||||
if (_pbcFlags.pullsDown)
|
||||
[[_menu menuRepresentation] setHighlightedItemIndex:
|
||||
[_menu indexOfItem: _selectedItem]];
|
||||
return;
|
||||
}
|
||||
|
||||
if (_selectedItem != nil)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue