Commit Graph

113 Commits

Author SHA1 Message Date
Matthias Clasen
c77e12a215 Make key themes work again
This was inadvertedly broken in commit
44ba5d253f.
Thanks to Matthew Francis for tracking this down and providing
a fix in https://bugzilla.gnome.org/show_bug.cgi?id=699901
2013-05-08 10:21:36 -04:00
Matthias Clasen
bdfd0d4638 Don't return FALSE from a non-boolean function
https://bugzilla.gnome.org/show_bug.cgi?id=696608
2013-03-26 23:30:10 -04:00
Alexander Larsson
366b4db791 css: Support opacity
https://bugzilla.gnome.org/show_bug.cgi?id=687842
2013-02-07 11:11:38 +01:00
Alexander Larsson
6dfee46cdb css: Add _gtk_css_style_property_affects_font
This checks if a style_update affects the font.
2012-12-06 21:14:02 +01:00
Benjamin Otte
5942099f00 cssvalue: Parse font sizes properly
As the last CSS property, font-size now is a proper number (when it's
not a keyword).
2012-12-01 16:27:45 +01:00
Benjamin Otte
0d9d576172 css: Add more features to font-size code
We now support the keywords (like xx-small, medium, larger, smaller...)
and I've changed the default value to be "medium".

This required some shuffling of the "get default font size" code. But
all is well now.
2012-12-01 14:00:24 +01:00
Benjamin Otte
0c12a6ffcb cssstyleproperty: Don't mark border width properties as NO_RESIZE
I was to overeager when marking properties in
66d22f101d apparently.
2012-11-30 20:41:58 +01:00
Benjamin Otte
66d22f101d styleproperty: Mark properties as not needing resizes 2012-11-30 20:10:23 +01:00
Benjamin Otte
87b351e6e6 styleproperty: Use _gtk_css_initial_value_get()
See previous commit(s).
2012-11-25 22:29:14 +01:00
Benjamin Otte
4f9a8e6b3d symboliccolor: Remove extra includes
That header was included in way too many places.
2012-11-25 02:59:15 +01:00
Benjamin Otte
bd31bd6d63 cssstyleproperty: Replace symbolic colors with GtkCssColorValue 2012-11-08 23:34:29 +01:00
Benjamin Otte
5510bef70a cssstyleproperty: Add animation properties 2012-09-17 20:39:11 +02:00
Benjamin Otte
912d5a5c23 cssvalue: Make the array parser no longer parse "none"
Arrays that support it, handle it themselves.
2012-09-03 12:54:14 +02:00
Benjamin Otte
44ba5d253f css: Redo bindings parsing
I want to get away from the ability to have 0-length arrays, all css
arrays are single element.
Even if the element is "none", it is still a "none" element.
2012-09-03 12:54:14 +02:00
Benjamin Otte
c9b918b70f cssstyleproperty: Don't set print or compute vfuncs anymore
Nobody does that these days.
2012-08-28 15:40:57 +02:00
Benjamin Otte
ec4c1e5682 cssstyleproperty: Remove all useless compute vfuncs
Now that we call _compute() by default, we don't need any special cases
anymore that do the same thing.
2012-08-28 15:40:57 +02:00
Benjamin Otte
c0df9067dc css: Move special case for 0px borders
This is in preparation for the next commits.
2012-08-28 15:40:56 +02:00
Benjamin Otte
09f9fd42b4 css: Fold color value computation into gtksymboliccolor.c
This gets rid of the public function
_gtk_css_rgba_value_compute_from_symbolic().
The fallback is now handled using a switch statement instead of letting
the caller pass the function.
2012-08-28 15:40:56 +02:00
Benjamin Otte
9b4ed66218 css: Pass property_id to compute function
This is a reorganization of how value computing should be done.
Previously the GtkCssStyleProperty.compute vfunc was supposed to take
care of special cases when it needed those for computation. However,
this proved to be very complicated in cases where values were nested and
only the last value (of a common type) needed to be special cased.

A common example for this was the fallback handling for unresolvable
colors.

Now, we pass the property's ID along with all compute functions so we
can do the special casing where it's necessary.
Note that no actual changes happen in this commit. This will happen in
follow-ups.
2012-08-28 15:40:56 +02:00
Benjamin Otte
9b953829fb css: Introduce _gtk_css_value_compute()
This commit is essentially a large reorganization. Instead of all value
subtypes having their own compute function, there is the general
_gtk_css_value_compute() function that then calls a vfunc on the
subtype.
2012-08-28 15:40:56 +02:00
Cosimo Cecchi
580b585fc9 styleproperty: make background-image an array value
This also requires having the GtkCssArrayValue parse func forward the
base GFile from the style property parse implementation.
2012-05-15 13:24:40 -04:00
Cosimo Cecchi
f65970b521 styleproperty: make background-size an array property 2012-05-15 13:24:40 -04:00
Cosimo Cecchi
9b04673392 styleproperty: make background-position an array property 2012-05-15 13:24:40 -04:00
Cosimo Cecchi
ed12be7e81 styleproperty: make background-repeat an array property 2012-05-15 13:24:40 -04:00
Cosimo Cecchi
f8e6e272a7 styleproperty: make background-clip and background-area array properties
Right now just make them arrays, but don't consider values after the
first.
2012-05-15 13:24:40 -04:00
Benjamin Otte
6ee237ea59 cssstyleproperty: Remove base argument
from parse functions.
2012-05-11 16:42:12 +02:00
Benjamin Otte
c9f01ffb43 cssimage: No need to pass base file anymore
The file is now part of the GtkCssParser
2012-05-11 16:42:12 +02:00
Benjamin Otte
2fec112422 styleproperty: Remove equal_func vfunc
Equality tests are done with _gtk_css_value_equal(). There is no need to
do it per-property, equal values will still be equal.

This essentially reverts 24f5d54329e028347bd76af42e86ed190c1229a2 and
92c7a7171e1240b6d961ee5b6f9ab6b596e98904.
2012-04-17 08:59:20 +02:00
Benjamin Otte
0111b9d507 symboliccolor: Treat it as a CssValue
.. now that it is one.
2012-04-17 08:59:20 +02:00
Benjamin Otte
51da8cb263 symboliccolor: Parse 'currentColor' everywhere 2012-04-17 08:59:20 +02:00
Benjamin Otte
04c5fdaca6 css: Remove old animation code
Deprecate public API where appropriate and make it no-ops.
Remove all calls to it.
Get rid of the 'transition' css property.

For now, this means spinners don't animate anymore.
2012-04-17 08:59:19 +02:00
Benjamin Otte
1170ecfd2e cssvalue: Convert border-image-width to border value 2012-04-17 08:59:19 +02:00
Benjamin Otte
56f79fecce cssvalue: Add a border value
.. and parse border-image-slice with it.
2012-04-17 08:59:18 +02:00
Benjamin Otte
cfc6462730 cssvalue: Add a cssvalue for background-size 2012-04-17 08:59:18 +02:00
Benjamin Otte
f785f7177c cssvalue: Add a custom value for repeats
In particular, that's background-repeat and border-image-repeat.

Also, fix up the border-image shorthand to allow any order.
2012-04-17 08:59:18 +02:00
Benjamin Otte
5377169ef3 cssvalue: Add a value for background-position 2012-04-17 08:59:18 +02:00
Benjamin Otte
aed7600425 cssvalue: Add a css value for engines 2012-04-17 08:59:18 +02:00
Benjamin Otte
4f63c1c7ca cssstyleproperty: Convert binding sets
Instead of keeping a custom GPtrArray, keep it as a GtkCssArrayValue of
GtkCssStringValue. This way, we gain equality comparisons and print
functions for free.
2012-04-17 08:59:18 +02:00
Benjamin Otte
edbc8e4f57 cssvalue: Add a value for border-radius corner properties
... and convert those properties to this value.
2012-04-17 08:59:18 +02:00
Benjamin Otte
05f2249d08 css: Make outline-offset a number property 2012-04-17 08:59:18 +02:00
Benjamin Otte
c366b5b8b7 shadow: Add equal and transition support
... and enable transitions for the shadow properties.
2012-04-17 08:59:18 +02:00
Benjamin Otte
ac6d61f6bb cssvalue: Add GtkCssShadowsValue
This is necessary because shadows get treated differently from other
lists when transitioning.
2012-04-17 08:59:18 +02:00
Benjamin Otte
ca17270187 cssvalue: Make GtkCssShadowValue only hold one shadow
All the properties now are a GtkCssArrayValue of GtkCssSadowValue.
GtkCssArrayValue already does everything we want, so no need to
duplicate its funtionality.
2012-04-17 08:59:17 +02:00
Benjamin Otte
b9ebe8c226 cssarrayvalue: Redo parsing arrays
Does 3 things:
1) Introduce a "none" array signleton
2) Get rid of memleaks in error paths
3) Reduce code in parse funcs
2012-04-17 08:59:17 +02:00
Benjamin Otte
a8efb784d7 cssstyleproperty: Mark all animatable properties
Only the ones that can be animated are marked of course. So more work is
needed.
This is important for
  transition-property: all;
because it'll just animate all the properties that can be.
2012-04-17 08:59:17 +02:00
Benjamin Otte
ed45a3c2f0 cssstyleproperty: Add _gtk_css_style_property_is_animated() 2012-04-17 08:59:17 +02:00
Benjamin Otte
9e4341f730 css: Move enum to the only source file using it 2012-04-17 08:59:17 +02:00
Benjamin Otte
41ce29767c cssstyleproperty: Add transition properties 2012-04-17 08:59:16 +02:00
Benjamin Otte
31565139ba stylecontext: Convert _gtk_style_context_peek_property()
Take the property id instead of the name.
2012-04-17 08:59:15 +02:00
Benjamin Otte
5d8789680e css: Add an enum for all the style properties
So instead of using
  _gtk_css_style_property_get_id (GTK_CSS_STYLE_PROPERTY
        (_gtk_style_property_lookup ("name")))
one can now use
  GTK_CSS_PROPERTY_NAME

Esaier, eh?
2012-04-17 08:59:15 +02:00