MegaMek / megameklab

MegaMekLab is a BattleTech unit modification program. It allows creating and modifying all unit types available in MegaMek from Support Vehicles up to WarShips. It also allows printing record sheets for single or multiple units.
http://www.megamek.org
86 stars 134 forks source link

Fix cursor when drag-dropping in MML #1657

Closed pavelbraginskiy closed 2 weeks ago

pavelbraginskiy commented 2 weeks ago

Previously I implemented the ability to drag files onto MML using DropTarget. This worked, but it caused various cosmetic problems, most notably where the mouse cursor would often be wrong when dragging an item, showing the Forbidden cursor when a drop actually was possible.

This moves the code from DropTarget to TransferHandler. TransferHandler is more capable than DropTarget and works much better here.

Other than moving the code from DropTarget to TransferHandler, this PR doesn't actually change any code except to show the user an error message when they try to drag an invalid file onto MML.

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 2.16%. Comparing base (7e572e1) to head (b99df8a). Report is 6 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1657 +/- ## =========================================== - Coverage 2.16% 2.16% -0.01% Complexity 209 209 =========================================== Files 268 268 Lines 30924 30927 +3 Branches 5290 5290 =========================================== Hits 669 669 - Misses 30098 30101 +3 Partials 157 157 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.