Fix color entry spamming undo stack (1.4.x)
Irrelevant for 1.5-dev as it uses a new color widget that doesn't have this problem.
Add a static function to only change undo key on color commiting.
There are quite some round-trips between color widgets in 1.4.x, and this is a minimal fix. Let me know if deduplicating code between color widgets and paint selectors is instead preferred.
Tests to match behavior:
for both when entry is active and inactive
- Click on slider: no undo log
- Drag slider: no undo log
- Type in spinbutton: no undo log
- Deselect, reselect, click on slider: new undo log
- Deselect, reselect, type in spinbutton: new undo log
- Hold down spinbutton inc/dec button: spamming → no spamming
- Type in hex entry: undo log, spamming → no spamming
| before | after |
|---|---|
Fixes #5499
Edited by Willy (Wen-Wei) Kao