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

Fix Ctrl-scroll zoom for GTK4 #503

Merged
merged 1 commit into from
Oct 20, 2022
Merged

Fix Ctrl-scroll zoom for GTK4 #503

merged 1 commit into from
Oct 20, 2022

Conversation

amolenaar
Copy link
Member

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Documentation content changes

What is the current behavior?

Apps like Firefox and Inkscape use Ctrl+scroll wheel to zoom.

Issue Number: gaphor/gaphor#1798

What is the new behavior?

Scroll-zoom works on GTK4.
For GTK3 it's not possible, since scroll events can't be propagated.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 19, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.92%.

Quality metrics Before After Change
Complexity 5.82 ⭐ 5.57 ⭐ -0.25 👍
Method Length 85.69 🙂 83.34 🙂 -2.35 👍
Working memory 2.66 ⭐ 3.09 ⭐ 0.43 👎
Quality 60.35% 🙂 61.27% 🙂 0.92% 👍
Other metrics Before After Change
Lines 471 521 50
Changed files Quality Before Quality After Quality Change
examples/demo.py 57.16% 🙂 57.28% 🙂 0.12% 👍
gaphas/tool/init.py % % %
gaphas/tool/zoom.py 80.78% ⭐ 78.00% ⭐ -2.78% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
examples/demo.py create_window 13 🙂 851 ⛔ 31.45% 😞 Try splitting into smaller methods
examples/demo.py create_canvas 1 ⭐ 267 ⛔ 6 ⭐ 62.56% 🙂 Try splitting into smaller methods
gaphas/tool/zoom.py on_scroll 2 ⭐ 101 🙂 10 😞 66.87% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

For GTK3 it's not possible, since scroll events can't be propagated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant