Summary
I created this patch to open a discussion about a somewhat subtle change to the way the pop-up palette's buttons could potentially work, using an altered zoom button as a jumping-off point. It does two main things:
- This patch adds a new kind of button (KisMultiButton) to Krita which responds to a variety of clicks, including right-clicks and key-modifier clicks.
- The KisMultiButton is then used to change the behavior of the pop-up palette's "100% Zoom" button, which I'm now calling the "QuickZoom" button as it now supports zooming to other often-used zoom levels. Just like before, a single left-click on the quick zoom button will zoom the canvas to 100%. In addition, a right-click now quickly zooms the canvas to fit the page to help artists see the bigger picture, while a shift-left-click now zooms to 200% for detail work. (Appropriate tooltips have been created.)
Motivation:
This change was partially motivated by a feature request on the bug tracker a few weeks back asking for a fit-page button, as well as me personally wanting to explore the use of right-click and modifier-clicks within the pop-up palette to give even more control to tablet users without needing additional GUI elements. Without a doubt, the pop-up palette in its current incarnation is a great tool, especially for tablet users and GUI-minimalist types, and I think that improving the density of controls and supporting alternate clicks is at least one way of making the user experience better - more control in a smaller area which takes advantage of the types of inputs that tablet users have at their fingertips.
Notes:
- While this patch currently works, gives users more control, and is ready to be pulled, the main purpose of this diff is for other Krita developers to test out quickzoom and discuss the use of varied mouse input events to pack more features into the pop-up palette without adding more buttons. Please let me know if this type of thing would be a better fit for the mailing list or bug tracker.
- I made KisMultiButton as an example for this specific use-case, but I'm still pretty new to Krita's various widgets, so if there's already a widget that does something similar or if it would be preferable to add right/modified click functionality to an existing button, I'd be happy to do that instead.