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 scrolling on Wayland #481

Merged
merged 10 commits into from
Sep 24, 2022
Merged

Fix scrolling on Wayland #481

merged 10 commits into from
Sep 24, 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?

Wayland is using smooth scrolling. However, in gaphor the scrollbar jumps when the cursor hits an item.

Issue Number: #480

What is the new behavior?

Scrolling works smooth on Wayland. In addition, while scrolling now only a redraw is done, not a full update.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Sep 23, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.55%.

Quality metrics Before After Change
Complexity 3.02 ⭐ 3.46 ⭐ 0.44 👎
Method Length 48.76 ⭐ 49.38 ⭐ 0.62 👎
Working memory 4.97 ⭐ 4.96 ⭐ -0.01 👍
Quality 78.76% 78.21% -0.55% 👎
Other metrics Before After Change
Lines 714 707 -7
Changed files Quality Before Quality After Quality Change
gaphas/view/gtkview.py 76.57% ⭐ 76.42% ⭐ -0.15% 👎
gaphas/view/scrolling.py 72.78% 🙂 68.57% 🙂 -4.21% 👎
tests/conftest.py 89.12% ⭐ 88.88% ⭐ -0.24% 👎
tests/test_tool_scroll.py 89.13% ⭐ 89.13% ⭐ 0.00%
tests/test_view.py 82.86% ⭐ 85.20% ⭐ 2.34% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
gaphas/view/gtkview.py GtkView.update_back_buffer 15 🙂 235 ⛔ 10 😞 42.03% 😞 Try splitting into smaller methods. Extract out complex expressions
gaphas/view/scrolling.py Scrolling.set_property 17 🙂 150 😞 10 😞 47.26% 😞 Try splitting into smaller methods. Extract out complex expressions
gaphas/view/gtkview.py GtkView.__init__ 6 ⭐ 226 ⛔ 51.44% 🙂 Try splitting into smaller methods
gaphas/view/scrolling.py Scrolling.update_adjustments 2 ⭐ 167 😞 6 ⭐ 68.30% 🙂 Try splitting into smaller methods
tests/test_view.py test_scroll_adjustments_signal 0 ⭐ 125 😞 3 ⭐ 82.70% ⭐ Try splitting into smaller methods

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!

This avoids jumpy behavior during smooth scrolls.
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