Follow-up Comment #4, bug #18574 (project mypaint):

Absolutely no objection if you want to refactor this code.

The stategroups code confuses me too (and I introduced it...), but I do like
many of the ways of interaction that are implemented with them. But maybe I
used a single concept for too many different things here.

Exiting a stategroup is hairy, but IIRC it also abstracts (or was meant to
abstract) some common functionality (eg. do we have a mouse grab active or was
it activated by keyboard, do we have an active timeout handler that we must
remove...). The idea was to seperate how the state is entered or left from the
setup/teardown code that is state-specific.

At some point, my idea was to put all mutually exclusive states into a single
stategroup, so they can cancel each other (maybe not a good idea; a stack
might work better?). And somewhere interweaved with all this code lives the
unification of "mouse buttons" and "keyboard buttons" into the same "button
state" concept, so you can use the same color picker code by either holding a
mouse button or by holding a key. And also the concept of a pop-up timeout,
and so on...

Some thought input:

What I miss in your list (maybe intentional?) is the "layerblink",
"layersolo" and "strokeblink" states. Layersolo at least is a persistent state
at the moment (but maybe it should not be a state? but I like to enter it
"spring-loaded" by holding a key down sometimes), working mostly independent
of things like color picker and brush modes. Talking about independence, the
timeout of the "blink" states should not prevent the user from doing an
action; but they can be either independent of other states, or they can be
canceled whenever the user does something else.

OK I'm done babbling now :-)

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?18574>

_______________________________________________
  Nachricht geschickt von/durch Gna!
  http://gna.org/


_______________________________________________
Mypaint-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/mypaint-bugs

Reply via email to