Re: CSS Transitions



On Fri, May 10, 2013 at 7:05 PM, Allan Day <allanpday gmail com> wrote:
Owen Taylor <otaylor redhat com> wrote:
I think you can quickly get into prohibitively heavy complexity here,
which is why, presumably, that CSS doesn't try to to have the idea of
start and end states.

Indeed.

Just out of curiosity... wouldn't it make sense to have the concept of
start and end states, if at least the start states could be wildcarded ?

This way one could specify:

  "pressed" -> "insensitive" (a custom transition to become insensitive)
  "*" -> "insensitive" (the default transition to become insensitive)

Anyway, if this is intentionally impossible by the CSS specification,
and if we are hell bent on following that specification to the letter,
then I suppose there is no argument... just seems a bit impractical
to define these intermediate states in code...

Cheers,
    -Tristan

If I was handling this on the web, I'd probably do something like,
in setup:

  $(button).transitionEnd(
       function() {
           $(this).removeClass('pressing');
       });

When pressed:

 $(button).addClass('pressed').addClass('pressing');

In CSS:

 .button.pressed { background: red; }
 .button.pressing { transition: background 1s; }

I think we possibly should do something similar here. We could do
something like:

 gtk_style_context_add_temporary_class(button,
GTK_STYLE_CLASS_PRESSING);

With the semantics of "temporary" meaning "removed when last transition
finishes". I don't think you'd need many of these style classes to allow
most of what the designers want.

If you want to get an idea of how many transitions there might be, I'd
be happy to write up what I'd like to happen in terms of behaviour.

Allan
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]