talmolab / sleap

A deep learning framework for multi-animal pose tracking.
https://sleap.ai
Other
435 stars 97 forks source link

Allow zoom with trackpad #1540

Closed roomrys closed 1 year ago

roomrys commented 1 year ago

Description

This PR allows zooming with the trackpad on a laptop. Zooming with the trackpad actually passes a MouseButton into the events.buttons(), so previously this was being passed over in the wheelEvent.

Now, we just check that the event modifier is not the Alt key (which is the only other action that uses the wheelEvent - for rotating an instance about a node).

Types of changes

Does this address any currently open issues?

Outside contributors checklist

Thank you for contributing to SLEAP!

:heart:

Summary by CodeRabbit

codecov[bot] commented 1 year ago

Codecov Report

Merging #1540 (c8e9a8e) into develop (ed77b49) will decrease coverage by 0.01%. The diff coverage is 50.00%.

@@             Coverage Diff             @@
##           develop    #1540      +/-   ##
===========================================
- Coverage    73.39%   73.39%   -0.01%     
===========================================
  Files          134      134              
  Lines        23961    23961              
===========================================
- Hits         17586    17585       -1     
- Misses        6375     6376       +1     
Files Coverage Δ
sleap/gui/app.py 75.34% <ø> (ø)
sleap/gui/widgets/video.py 64.34% <50.00%> (ø)

... and 1 file with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

coderabbitai[bot] commented 1 year ago

Walkthrough

The proposed changes primarily focus on refining the user interface and improving the user experience. They include minor adjustments such as removing empty lines and unnecessary conditions, as well as significant modifications related to zoom behavior, event handling, and graphical element manipulation.

Changes

File Path Summary
sleap/gui/app.py An empty line was removed in the dropEvent method.
sleap/gui/widgets/video.py Various changes were made, including adjustments to zoom behavior, event handlers, and function calls. Also, the creation and manipulation of graphical elements were updated.

🐇

In the land of code, where the brackets lie,

Changes small and large, under the digital sky.

Zooming, dropping, handling events,

Each line of code, makes a difference immense.

So here's to the coder, with their keen sight,

Making the user's journey, ever so light. 🎉

Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - Mention `@coderabbitai` in any *review comment* for bot assistance. - Note: Review comments are made on code diffs or files, not on the PR overview. ### Pause Incremental Reviews - Insert `@coderabbitai: ignore` in the PR description to halt the bot's ongoing reviews. Remove the line to resume. - Additionally, enter `@coderabbitai pause` to halt the bot's ongoing reviews as any issue or review comment. To resume reviews, enter `@coderabbitai resume` as any issue or review comment.
roomrys commented 1 year ago

This needs to be revisited with a different approach