Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSPopUpButton's popup menu in pulldown mode displaying fix #43

Merged
merged 1 commit into from Jan 3, 2020
Merged

NSPopUpButton's popup menu in pulldown mode displaying fix #43

merged 1 commit into from Jan 3, 2020

Conversation

trunkmaster
Copy link
Member

@trunkmaster trunkmaster commented Dec 19, 2019

I've changed the way how poup menu is displayed when popup button operates in pulldown mode. Before this change popup menu doesn't display first item and was placed to the bottom edge of popup button. Although popup menu can't draw dark gray border around poup button.

With this change pulldown menu draws exatrly the same way as in normal mode except first item is not highlighted. So now popup menu looks visually consistent no matter what mode it opeartes in.
Plus, NSMenuView contains less popup button specific code.

item for pulldown popup button's menu.
(sizeToFit): removed commented useless code; fixed formatting.
(rectOfItemAtIndex:): draw first item cell of pulldown popup menu.
(setWindowFrameForAttachingToRect:onScreen:preferredEdge:popUpSelectedItem:):
remove useless (was used for old-style popup menu) positionning code for
popup menu. Check if owning popup is not pulldown before vertical
position correction.

* Source/NSPopUpButtonCell.m (attachPopUpWithFrame:inView:): make setting
selected item code more generic for pulldown and non-pulldown button.
Fixed formatting.
@fredkiefer
Copy link
Member

Some of the changes of this pull request are obviously correct. What I doubt is the overall change. Why would we want to display the title item (that is the first item in a pull down) in the menu?
This is the main difference between pull down and pop up and it is well documented. I just tired this on Cocoa and the difference is still there.
Of course changing this would simplify the code here a lot and I would love to see that, but this changes the whole appearance of pull down items and this needs to be decided on a completely different level.

Copy link
Member

@fredkiefer fredkiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please discuss the change on the mailing list first.

@trunkmaster trunkmaster merged commit b38bdff into gnustep:master Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants