Commit Graph

140 Commits

Author SHA1 Message Date
Benjamin Otte
7f8de66c0a css: text-decoration-style is not inherited 2015-07-08 05:48:59 +02:00
Paolo Borelli
1eb1481bdf css: support text-decoration-style
The support is limited to underline single, double and wavy, which
is what pango has today.
2015-07-06 20:06:20 +02:00
Paolo Borelli
a57e6731c4 css: support text-decoration-color 2015-07-06 00:04:06 +02:00
Paolo Borelli
384df61c90 css: add support for text-decoration-line 2015-07-06 00:04:06 +02:00
Paolo Borelli
a19331f231 label: add support for CSS letter-spacing property
Support letter-spacing CSS property on GtkLabel.
Reftest is included.
2015-07-06 00:04:05 +02:00
Benjamin Otte
295b8aab0c css: Implement animations for font-weight property 2015-02-16 23:57:03 +01:00
Benjamin Otte
89f635fee1 css: Add -gtk-dpi CSS property hack
This property is necessary to ensure widgets automatically update after
the text scale factor is changed desktop-wide.

And if I'm already doing a property like this, I can make it
overridable. So now you can override the dpi per-widget with CSS like
GtkSwitch {
  -gtk-dpi: 48;
}
if you want to debug things.

Long-term, we want to get rid of this property and insist on dpi being
96 everywhere and people can change the font size to get larger fonts.
2015-02-05 18:57:29 +01:00
Benjamin Otte
ffff7b055b css: Remove GtkCssStyleProperty::affects-size
... and GtkCssStyleProperty::affects-font properties. Code now uses
GtkCssStyleProperty::affects instead.
2015-01-27 05:04:34 +01:00
Benjamin Otte
c0650057c1 css: Add GtkCssStyleProperty::affects property 2015-01-27 05:04:34 +01:00
Benjamin Otte
11d70f1ac3 css: Add a -gtk-icon-theme CSS property
The property is useless to set (it only allows 'initial', 'inherit' and
'unset' as values), but it is used to track changes to the icon theme.
And as such, it can ensure that widgets can track when they need to
reload icons.

https://bugzilla.gnome.org/show_bug.cgi?id=743341
2015-01-27 05:04:34 +01:00
Benjamin Otte
9ce8ce1198 css: Move icon properties to the end
The order in which properties are defined depends on the order in which
they are computed. And that means that properties can only depend on
other properties that are defined before them.

The next patches will need this reordering.
2015-01-20 06:30:19 +01:00
Matthias Clasen
31f502a9ae css: Handle font-size changes properly
Changing font size does not cause widgets to update their size
properly anymore, since we forgot an invalidation flag. The
problem can be observed e.g. by running gtk3-demo and calling

gsettings set org.gnome.desktop.interface font-name "Cantarell 22"
2014-12-23 21:11:00 -05:00
Benjamin Otte
433c20e59d styleproperties: Remove header where it's not used 2014-10-24 21:31:40 +02:00
Benjamin Otte
8abc6e06b2 css: Add "-gtk-icon-source: builtin"
... and make it the default. This takes over the meaning from "none" for
this property in that it draws the fallback builtin image.
"none" now literally means no image will be drawn.
2014-10-21 05:53:19 +02:00
Benjamin Otte
e683e915b8 css: Queue resize for properties that affect clip
This fixes shadows that are animated not updating the clip of the widget
they are drawn on. An example of this are the buttons in the CSS shadows
example in gtk-demo.

Reftest included
2014-10-03 06:18:04 +02:00
Benjamin Otte
f7ee61c833 css: Have finer-grained definitions for effects of CSS props
This adds the GtkCssAffects enum and implements it for all style
properties.
So far, this is not exposed outside of the implementation file.
2014-10-03 06:18:04 +02:00
Matthias Clasen
e014b89310 Move gtkthemingengine to deprecated directory
This is the place for wholly-deprecated sources.
2014-08-29 16:35:37 -04:00
Emmanuele Bassi
5ad60caa3c css: Implement font-stretch
The font-stretch CSS property is defined in the Level 3 CSS Fonts
module, available at:

  http://dev.w3.org/csswg/css-fonts/#propdef-font-stretch

It allows defining a normal, condensed, or expanded face to the font
description. Pango already supports it, so this is literally just the
CSS parser machinery needed to bridge our CSS to the FontDescription
API.

https://bugzilla.gnome.org/show_bug.cgi?id=735593
2014-08-28 13:41:40 +01:00
Benjamin Otte
b59e6f1948 themingengine: Deprecate 2014-08-16 19:39:44 +02:00
Benjamin Otte
3759190c26 css: Parse text-shadow values properly
We used to accept the same syntax for text-shadow and icon-shadow as
we accept for box-shadow. However, box-shadow does accept a spread and
the inset keyword while the others should not.
2014-06-10 01:07:57 +02:00
Benjamin Otte
f5b1e75d93 widget: Include box-shadow in the clip
This allows all widgets that implement clip to use box shadows.
2014-05-24 16:12:21 +02:00
Benjamin Otte
434f91feff spinner: Implement clip
We now allow you to gtk-icon-transform() the spinner outside of the
spinners allocation.
2014-05-24 16:12:20 +02:00
Benjamin Otte
109fcb987b css: Add a -gtk-icon-style property
The values can be:
  "requested" - the style as requested
  "regular"   - use a regular full-color icon
  "symbolic"  - use a symbolic icon

The property defaults to "requested", so no changes should be seen
unless CSS overrides it.
It is also inherited, so that using this CSS
  .toolbar { -gtk-icon-style: symbolic; }
is enough to force the whole toolbar to use symbolic icons.
2014-05-14 04:28:34 +02:00
Benjamin Otte
f56ba8378b css: Add -gtk-icon-transform property
This property allows transforming icons and is mainly intended to be
used for spinner animations.
2014-05-14 04:28:33 +02:00
Benjamin Otte
226e1cd2b2 css: Add -gtk-icon-source property
This is to be used for rendering icon content via CSS, such as spinners
or checkboxes.
2014-05-14 04:28:33 +02:00
Cosimo Cecchi
e8cbbedbb2 css: add properties for outline-radius
Both a shorthand and individual properties. This is not officially part
of the CSS standard, but there's precedence for it at least in Mozilla:
https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-outline-radius
2014-05-01 18:14:49 +02:00
Cosimo Cecchi
736b350d7a css: Add a GtkCssValue for GtkCssImageEffect
This will allow us to use the CSS machinery to apply a highlight or dim
effect when images are prelit or insensitive.

https://bugzilla.gnome.org/show_bug.cgi?id=705443
2013-08-20 02:50:40 +02:00
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