Diffusion Krita 2a1ee0f2e11c

Let the unitParseSpinBox use document relative units (px, vw, vh for the…

Authored by jospin on Sep 2 2016, 7:21 PM.

Description

Let the unitParseSpinBox use document relative units (px, vw, vh for the Lenght. s and % for the time).

The main problem that was faced in the process is that the function to reach the corrent view (thus current document and image) are in the ui lib, which is unreachable from widgets.
The solution is to transform the KisSpinBoxUnitManager to some kind of abstract interface. Then subclass it in ui instead of widget.

The only problem then, is that when you create you spinbox (in a place that can probably use kritaui), you need to attach the proper KisSpinBoxUnitManager to it, because it can't be done internally.

The advantage is that, by subclassing KisSpinBoxManager, one can create a lots of different behaviour for different usecases, and the UnitParseSpinBox can more easily be re-used outside of Krita.

Details

Committed
jospinSep 2 2016, 8:15 PM
Parents
R37:84e696c2758e: Let the user change the active unit on the fly for unitboxes.
Branches
Unknown
Tags
Unknown