Skip to content

Resolve "Alt+DoubleClickLeft also triggers Alt+ClickLeft"

This MR introduces a difference between singleClick and doubleClick, such that a double click does not fire a single click event.

At the same time, it adds a check to ensure that Alt+DblLeft does not contribute to the autosave counter.

Because of the new distinction, a single click is not registered immediately anymore. That means that e.g., a very fast Alt+Hold Left+Move might not get registered, because the pressing down of the mouse only got registered after moving the mouse. See the following gif for details:

Alt+Drag too quick to be registered

As seen in the gif, just moving the mouse after the click was registered is good enough.

The delay between executing a click and it being registered as one also introduces challenges for unit testing the UI. The existing tests of the ColorPicker feature needed to be adjusted to wait. They now take a prohibitively long time for a unit test. Therefore I have hidden them and modified CI such that CI executes all tests, including hidden ones. So the Unit-Test can be run locally without slowing them down that much.

We might want to reconsider this design choice in the feature or at least add some way to unit-test regardless by enabling us to dispatch reals singleClick-events.

Closes #328 (closed)

Measured time to execute new unit-tests
> Measure-Command {.\petrack_tests.exe}


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 20
Milliseconds      : 617
Ticks             : 206171577
TotalDays         : 0,000238624510416667
TotalHours        : 0,00572698825
TotalMinutes      : 0,343619295
TotalSeconds      : 20,6171577
TotalMilliseconds : 20617,1577

Reviewer Checklist

General code quality

  • naming conventions are met (see .clang-tidy for detailed information)
  • no static analyzer warnings in new code parts (e.g., use clang-tidy for checking)

General usability

  • old versions of pet-files are still loadable

Only if changes in UI

  • new elements are also saved and loaded from pet-file
  • check if tab order is still correct
  • all new SpinBoxes are promoted
  • new keybindings added to Petrack::keyBindings()

Merge request reports

Loading