Diffusion Krita 65fa65a97d56

A HUGE refactoring of KisPaintOpBox

Authored by dkazakov on Jul 25 2016, 8:44 AM.

Description

A HUGE refactoring of KisPaintOpBox

This patch introduces a lot of things:

  1. Implements a proper model-view-controller design for all the paintop preset-based properties, such as opacity, flow and size:

    Model --- KisPaintOpSettings Controller --- KoResourceManager (also tracks dependencies among the preset and its derived properties, such as opacity, size, flow, composite op) View --- KisPaintOpBox.

    Basically, it means that KisPaintOpBox doesn't write to the settings directly anymore. Instead, it uses KoResourceManager for that.
  1. Well, there are still a couple of flaws in the MVC design. E.g. the settings widgets still write directly into the settings bypassing the resource managers. To overcome this issue see the next bullet about KisResourceUpdateMediator. There is also a bigger problem, the size of the brush is still fetched through the access to the GUI elements, or, more precisely m_optionsWidget. I don't think it can be solved atm :(
  1. Adds KisResourceUpdateMediator. This is a special class that allows the resource manager to track the changes in complex resources, such as KisPaintOpPreset. When such resource changes internaly, all the derived resources get notification, and if they are also changed, a corresponding signal is emitted.

There are still two regressions present:

  1. Locked Settings functionality doesn't work
  2. Resizing of the brush using Shift+Gesture is slow again :(

Details

Committed
dkazakovJul 25 2016, 8:44 AM
Parents
R37:183f82b7d1be: Merge remote-tracking branch 'origin/master' into krita-hud-kazakov
Branches
Unknown
Tags
Unknown
abrahams added a subscriber: abrahams.

When I began working on the eraser I realized this really REALLY needed to be done. Awesome.