-
Notifications
You must be signed in to change notification settings - Fork 178
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
Globally fix slow mousewheeling issues, with scaling! #5103
Conversation
@@ -285,7 +286,7 @@ | |||
|
|||
/* ATB */ | |||
panLanceAssignment = new LanceAssignmentView(getCampaign()); | |||
JScrollPane paneLanceDeployment = new JScrollPane(panLanceAssignment); | |||
JScrollPane paneLanceDeployment = new JScrollPaneWithSpeed(panLanceAssignment); |
Check notice
Code scanning / CodeQL
Unread local variable Note
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5103 +/- ##
============================================
+ Coverage 10.42% 10.54% +0.11%
- Complexity 6035 6038 +3
============================================
Files 953 956 +3
Lines 134268 134164 -104
Branches 19456 19472 +16
============================================
+ Hits 14003 14142 +139
+ Misses 118922 118673 -249
- Partials 1343 1349 +6 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
JScrollPane
. They're everywhere. Sometimes the mousewheel scrolling works fine with them, sometimes it doesn't. There doesn't seem to be any pattern to when it works.MegaMek and MegaMekLab already control their
JScrollPane
s withget*ScrollBar().setUnitIncrement(int)
, seemingly doing it for each one separately. HQ only does it for the StratCon map.Something like two-thirds of HQ's are anonymous, which makes setting properties on them a bother.
This implements a drop-in replacement for
JScrollPane
,JScrollPaneWithSpeed
, which sets its own increment modified by the GUI scale factor, and replaces all uses ofJScrollPane
with it. (Except that Stratcon Map one.) This provides a single point for tuning and would allow for customization down the line.