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

Refactor MenuItemMorph, PluggableMenuItemSpec and PragmaMenuAndShortcutRegistrationItem to support use of a FormSet and apply that to CmdCommand #16201

Merged
merged 11 commits into from
Mar 11, 2024

Conversation

Rinzwind
Copy link
Contributor

This pull request refactors MenuItemMorph to support use of a FormSet for the icon and applies that to the CmdCommand hierarchy. In the CmdCommand hierarchy, the overrides of #defaultMenuIcon are refactored to override #defaultMenuIconName instead.

@Rinzwind Rinzwind marked this pull request as draft February 18, 2024 16:27
@Rinzwind
Copy link
Contributor Author

I converted this to a draft. Commit 02f48dc introduces a bug in #setUpIconForMenuItem: where the argument, despite the variable name ‘aMenuItemMorph’, can also be a PragmaMenuAndShortcutRegistration, which does not understand #iconFormSet:.

…on’, which held a Form, by an instance variable ‘iconFormSet’, which holds a FormSet.
…nce variable ‘icon’, which held a Form, by an instance variable ‘iconFormSet’, which holds a FormSet.
…mand to ‘menuItem’ (#doRegisterContextMenuItemsFor:withBuilder: on CmdCommand sends #setUpIconForMenuItem: with a PragmaMenuAndShortcutRegistration, rather than a MenuItemMorph, as the argument).
@Rinzwind
Copy link
Contributor Author

I fixed the bug referred to in my previous message by first refactoring PluggableMenuItemSpec and PragmaMenuAndShortcutRegistrationItem as well.

@Rinzwind Rinzwind changed the title Refactor MenuItemMorph to support use of a FormSet and apply that to CmdCommand Refactor MenuItemMorph, PluggableMenuItemSpec and PragmaMenuAndShortcutRegistrationItem to support use of a FormSet and apply that to CmdCommand Feb 18, 2024
@Rinzwind Rinzwind marked this pull request as ready for review February 18, 2024 19:35
@@ -13,6 +13,7 @@ Class {
'label',
'help',
'icon',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
'icon',

Copy link
Member

Choose a reason for hiding this comment

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

This instance variable is not used anymore and should be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Forgot to actually remove it indeed, fixed in commit 49a7a88.

@jecisc jecisc added the Status: Need more work The issue is nearly ready. Waiting some last bits. label Feb 19, 2024
…utRegistrationItem to replace the instance variable ‘icon’ […] by […] ‘iconFormSet’ […]”): ‘icon’ was not actually removed.
@Ducasse
Copy link
Member

Ducasse commented Feb 24, 2024

@jecisc can you check it? Tx

@Rinzwind
Copy link
Contributor Author

Rinzwind commented Mar 4, 2024

@jecisc Could I ask for an update on the (re)review? If you’re not available, it might be better to let someone else take over?

@jecisc jecisc merged commit 879920e into pharo-project:Pharo12 Mar 11, 2024
1 of 2 checks passed
@Rinzwind Rinzwind deleted the menuitemmorph-formset branch March 29, 2024 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Need more work The issue is nearly ready. Waiting some last bits.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants