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

Ensure that the highlight property is correctly propagated in CPButton. (Was: Update CPButton. #3004

Open
wants to merge 2 commits into
base: narwhal
Choose a base branch
from

Conversation

michaelbach
Copy link
Contributor

Ensure that the highlight property is correctly propagated in CPButton. (Was: Update CPButton.j)

Ensure that the `highlight` property is correctly propagated.
@cappbot cappbot added this to the Someday milestone Sep 12, 2021
@cappbot cappbot added the #new label Sep 12, 2021
@cappbot
Copy link

cappbot commented Sep 12, 2021

Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.

@@ -548,7 +548,7 @@ CPButtonImageOffset = 3.0;
return;

_isHighlighted = shouldHighlight;

[super highlight: shouldHighlight];
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove the space after the colon.

@daboe01
Copy link
Contributor

daboe01 commented Jan 4, 2022

-#new
+AppKit

@daboe01
Copy link
Contributor

daboe01 commented Jan 4, 2022

@michaelbach can you please fix the formatting issue (space after colon)?

@cappbot cappbot added AppKit and removed #new labels Jan 4, 2022
@cappbot
Copy link

cappbot commented Jan 4, 2022

Milestone: Someday. Label: AppKit. What's next? A reviewer should examine this issue.

@daboe01
Copy link
Contributor

daboe01 commented Jan 5, 2022

+#ready-to-commit

@cappbot
Copy link

cappbot commented Jan 5, 2022

Milestone: Someday. Labels: #ready-to-commit, AppKit. What's next? The changes for this issue are ready to be committed by a member of the core team.

@cacaodev
Copy link
Contributor

Thank you for your contribution. Before this pr can be merged, we need a better report: what exactly was not working before the pr and what is fixed now. We also need a test (manual in this case) or a path to a test in the repository where the reviewer can verify the change.
For more informations about our reporting guidelines: https://www.cappuccino.dev/contribute.html#bug-reports

@cappbot
Copy link

cappbot commented Mar 16, 2022

Milestone: Someday. Labels: #needs-ui-test, AppKit. What's next? A reviewer should examine this issue.

@michaelbach
Copy link
Contributor Author

michaelbach commented Apr 26, 2022

Thank you for your contribution. Before this pr can be merged, we need a better report: what exactly was not working before the pr and what is fixed now. …

Thank you for looking into it.

Before: The getter [someButton isHighlighted] did not return the correct state. In contrast, the local(!) variable _isHighlighted in CPButton works and reports the correct state. Reason: The getter is inherited from the super (CPControl), but since the state is not propagated to super, it cannot report the right state. So either implement an additional getter [… isHighlighted] in CPButton.j, or send the state change to super (that's what my PR does), and super's getter will respond with the correct state.

After: [someButton isHighlighted] returns the correct state.

This problem crops up when one codes a custom button. When pressing (but not releasing the button) the state should be visually indicated, and so the info is needed. The problem can be circumvented by using _isHighlighted, but it's not correct behaviour and the next one will stumble over it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants