This patch is for bug 379958.
In its current state, it only fixes the bug for the brush size shortcuts.
I'm interested in fixing the opacity shortcuts as well, but I'm unsure of how to do so.
I've thought of three ways, all of which modify KisCanvasControlsManager::stepAlpha():
- Don't change the opacity when the active tool's flags() have the KisTool::FLAG_USES_CUSTOM_COMPOSITEOP bit cleared. This is how the opacity slider is disabled by KisPaintopBox::slotToolChanged(), but I question it being the right way to go since "USES_CUSTOM_COMPOSITEOP" may not strictly mean "has adjustable opacity."
- Store the value given to KisPaintopBox::setWidgetState(int flags) (flags here is not the the same as KisTool::flags()) and add a function to get the stored value. Don't change the opacity if the DISABLE_OPACITY bit was set. If I go this route, I wonder if there's any chance that the value will ever be out of sync with the actual state of the widgets.
- Add a function to KisPaintopBox that returns a flags value based on the current isEnabled() state of all the widgets that are set by KisPaintopBox::setWidgetState(). This introduces extra maintenance since the new function should be updated any time setWidgetState() is modified.
The final issue I mentioned in the bug report was regarding shift+drag modifying the brush size when the slider was disabled.
I mistakenly linked to the wrong bug, which should have been 379564 .
Before that bug was fixed, you could switch to the smart patch tool (which disabled the size slider), switch to the freehand tool, and then be able to shift+drag to change the size even though the slider was still disabled.
Tools appear to get shift+drag functionality when they inherit from KisToolFreehand, which, according to Doxygen, would be the "Freehand Brush Tool", "Multibrush Tool", "Dynamic Brush Tool", and the "Colorize Mask Editing Tool".
All those have an enabled size slider, so I still think it's not much of an issue at the moment.