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

Improve handling mouse clicks on macOS #567

Merged
merged 19 commits into from
Mar 28, 2017
Merged

Improve handling mouse clicks on macOS #567

merged 19 commits into from
Mar 28, 2017

Conversation

zenangst
Copy link
Owner

@zenangst zenangst commented Mar 26, 2017

This PR introduces a new mouseClick property on Interaction. Now you can easily configure if you should single or double click on NSTableView-based components. Will try to add the same behavior to NSCollectionView based views in the future.

mouseClick does not really make sense to include on any other platform than macOS.
So I'll make an issue to make two Interaction structs, one for click-based OS:es and one combined for iOS and tvOS. I didn't include that change in this PR to keep the size down.

@mention-bot
Copy link

@zenangst, thanks for your PR! By analyzing the history of the files in this pull request, we identified @JohnSundell to be a potential reviewer.

@codecov-io
Copy link

codecov-io commented Mar 26, 2017

Codecov Report

Merging #567 into master will increase coverage by 0.23%.
The diff coverage is 93.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #567      +/-   ##
==========================================
+ Coverage   82.78%   83.01%   +0.23%     
==========================================
  Files         120      121       +1     
  Lines        9051     9104      +53     
==========================================
+ Hits         7493     7558      +65     
+ Misses       1558     1546      -12
Flag Coverage Δ
#ios 84.5% <100%> (+0.02%) ⬆️
#osx 84.33% <93.5%> (+0.58%) ⬆️
#tvos 76.99% <100%> (+0.03%) ⬆️
Impacted Files Coverage Δ
...s/macOS/Extensions/Delegate+macOS+Extensions.swift 58% <ø> (+5.74%) ⬆️
Sources/macOS/Classes/Component.swift 79.24% <100%> (+3.75%) ⬆️
Sources/Shared/Structs/Interaction.swift 100% <100%> (ø) ⬆️
SpotsTests/Shared/TestInteraction.swift 100% <100%> (ø)
...ources/macOS/Extensions/Component+macOS+List.swift 100% <100%> (ø) ⬆️
SpotsTests/macOS/TestClickInteraction.swift 88.63% <88.63%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a120411...ae2df3d. Read the comment docs.

Copy link
Collaborator

@vadymmarkov vadymmarkov left a comment

Choose a reason for hiding this comment

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

Great 🍰

This is done to avoid recursion, if we don't force unwrap here it will
end up running the same function over and over again.
@zenangst zenangst merged commit deeac80 into zenangst:master Mar 28, 2017
@zenangst zenangst deleted the improve/click-interactions-on-macos branch March 28, 2017 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants