Commit Graph

12 Commits

Author SHA1 Message Date
Benjamin Otte
1116914ea0 css: Move scale to GtkStyleProviderPrivate
This way, we can remove it as a separate argument from
gtk_css_value_compute() and allow computation to only depend on one
thing: the style provider.
2015-02-06 11:26:31 +01:00
Benjamin Otte
9645daf48f cssstyle: Move function from vfunc to static func
compute_dependencies() is only used internally by GtkCssStaticStyle,
so there's no need to have it elsewhere.
2015-01-07 14:26:47 +01:00
Benjamin Otte
b7be202089 stylecontext: Refactor update_properties()
It now always returns a new instance.
2015-01-07 14:26:47 +01:00
Benjamin Otte
7493e814a9 cssanimatedstyle: Apply animation values after creation
This makes GtkCssAnimatedStyle immutable.
2015-01-07 14:26:47 +01:00
Benjamin Otte
a3bf910585 cssanimatedstyle: Make advancing the style return a new style
This is another step towards making CssStyles immutable.
2015-01-07 14:26:47 +01:00
Benjamin Otte
f3f021106d cssanimatedstyle: Avoid creating animation
... when no animation exists.

This makes the function name kinda wrong, but I'm not sure what else to
call it.
2015-01-07 14:26:47 +01:00
Benjamin Otte
682abc345f cssanimatedstyle: Remove unused function 2015-01-07 14:26:47 +01:00
Benjamin Otte
980923c761 cssanimatedstyle: Merge two functions 2015-01-07 14:26:47 +01:00
Benjamin Otte
79f7392109 stylecontext: Make static styles static
Instead of keeping an animated style everywhere, we replace it with the
static style when nothing gets animated.

Apart from making the code cleaner, this gets rid of a bunch of animated
style values that do nothing but wrap a static style.
2015-01-07 14:26:47 +01:00
Benjamin Otte
270e73bfcc stylecontext: Always pass the static style
... to build_properties.
There is always one available, so we can insist on that one.

This simplifies a bunch of code.
2015-01-07 14:26:47 +01:00
Benjamin Otte
ac215ffc8f cssstyle: Add GtkCssStaticStyle
For now, this is only an implementation detail of the animated style.

The idea is to use GtkCssStaticStyle as the result of CSS queries and
then put a GtkCssAnimatedStyle on top that manages the animations. The
neat thing about this is that you can cache the static values.
2015-01-07 14:26:47 +01:00
Benjamin Otte
4168e0385e cssstyle: Split into GtkCssStyle and GtkCssAnimatedStyle
GtkCssStyle is the base class to be used for all types of styles that do
exist.

GtkCssAnimatedStyle is the only implementation so far, that is exactly a
copy/paste of the old GtkCssStyle code.
2015-01-07 14:26:46 +01:00