mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
Never change the state of the selected item of a NSPopUpButton configured as a pull down
This commit is contained in:
parent
606505326c
commit
ec3353ecd8
2 changed files with 17 additions and 8 deletions
|
@ -1,3 +1,9 @@
|
|||
2022-02-26 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/NSPopUpButtonCell.m: Never change the state of the
|
||||
selected item when configured as a pull down to match Apple's
|
||||
documentation and implementation.
|
||||
|
||||
2022-02-06 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/NSPopUpButtonCell.m: Add fix to avoid a dangling
|
||||
|
|
|
@ -332,13 +332,16 @@ static NSImage *_pbc_image[5];
|
|||
{
|
||||
id <NSMenuItem> selectedItem = [self selectedItem];
|
||||
|
||||
if (flag)
|
||||
if (!_pbcFlags.pullsDown)
|
||||
{
|
||||
[selectedItem setState: NSOnState];
|
||||
}
|
||||
else
|
||||
{
|
||||
[selectedItem setState: NSOffState];
|
||||
if (flag)
|
||||
{
|
||||
[selectedItem setState: NSOnState];
|
||||
}
|
||||
else
|
||||
{
|
||||
[selectedItem setState: NSOffState];
|
||||
}
|
||||
}
|
||||
|
||||
_pbcFlags.altersStateOfSelectedItem = flag;
|
||||
|
@ -673,7 +676,7 @@ static NSImage *_pbc_image[5];
|
|||
|
||||
if (_selectedItem != nil)
|
||||
{
|
||||
if (_pbcFlags.altersStateOfSelectedItem)
|
||||
if (!_pbcFlags.pullsDown && _pbcFlags.altersStateOfSelectedItem)
|
||||
{
|
||||
[_selectedItem setState: NSOffState];
|
||||
}
|
||||
|
@ -690,7 +693,7 @@ static NSImage *_pbc_image[5];
|
|||
|
||||
if (_selectedItem != nil)
|
||||
{
|
||||
if (_pbcFlags.altersStateOfSelectedItem)
|
||||
if (!_pbcFlags.pullsDown && _pbcFlags.altersStateOfSelectedItem)
|
||||
{
|
||||
[_selectedItem setState: NSOnState];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue