Commit Graph

15939 Commits

Author SHA1 Message Date
Benjamin Otte
7a76694780 styleproperty: Use _gtk_style_property_get_name() 2012-01-09 18:37:52 +01:00
Benjamin Otte
2128b356b2 shorthand: Add a property for all subproperties 2012-01-09 18:37:52 +01:00
Benjamin Otte
4383701e25 styleproperty: unconstify
GtkStyleProperty is a real GObject now, so treat it like one and don't
use const.
2012-01-09 18:37:52 +01:00
Benjamin Otte
a3a580d53e styleproperty: Remove unuse args from register()
Those arguments are only relevant for shorthands.
2012-01-09 18:37:52 +01:00
Benjamin Otte
927b922208 styleproperty: Add custom registration func for shorthands 2012-01-09 18:37:52 +01:00
Benjamin Otte
d4344164ac styleproperty: Move shorthand declarations to new file 2012-01-09 18:37:52 +01:00
Benjamin Otte
6b386dc574 styleproperty: border image is not a generic conversion thingy 2012-01-09 18:37:52 +01:00
Benjamin Otte
4e79ed7f4f styleproperty: Add a name property
And move the properties array to GtkStylePropertyClass.
Also add some docs.
2012-01-09 18:37:52 +01:00
Benjamin Otte
81b2bb0ade styleproperty: Get rid of _gtk_style_property_is_shorthand()
Use GTK_IS_CSS_SHORTHAND_PROPERTY() instead now that we have it.
2012-01-09 18:37:51 +01:00
Benjamin Otte
f9485241b1 styleproperty: Split into shorthand and real style properties 2012-01-09 18:37:51 +01:00
Benjamin Otte
78dc75a350 styleproperty: Make this an object 2012-01-09 18:37:51 +01:00
Benjamin Otte
3e24b5dbbe styleproperty: Add _gtk_style_property_query()
This way, we only need to export one function, not 3.
2012-01-09 18:37:51 +01:00
Benjamin Otte
2573e72f49 styleproperties: Add _gtk_style_properties_peek_property() 2012-01-09 18:37:51 +01:00
Benjamin Otte
38e1c0a2d6 styleproperties: Remove unused function from private header
_gtk_style_properties_resolve_property() was added erroneously in
c09148ca09 but was never implemented.
2012-01-09 18:37:51 +01:00
Benjamin Otte
4da493402d css: 'none' is not a value background-repeat 2012-01-09 18:37:51 +01:00
Benjamin Otte
6fdf6ba68f css: Remove generic 'none' handling
Includes updated tests.
Who could have thought that our tests were broken. Ooops.
2012-01-09 18:37:51 +01:00
Benjamin Otte
7d353fbccf win32: Fix CSS for 'none' value going away
We want colors to be 'transparent' and not 'none'.
2012-01-09 18:37:51 +01:00
Benjamin Otte
c77dba2767 styleproperty: Add custom 'none' handling
The generic 'none' handling needs to go, because 'none' is not a valid
value most of the time.
2012-01-09 18:37:51 +01:00
Benjamin Otte
57379adb3c css: Add generic support for 'inherit' and 'initial'
CSS3 says they work for every property, so here we go.
2012-01-09 18:37:51 +01:00
Benjamin Otte
a6ac53e2a9 css: Change prototype of _gtk_css_selector_matches()
Passing the length of the widget path that is relevant is not necessary
anymore, it was only useful for inheritance. Instead, we now pass the
state flags and let the selector do the state matching for us.
2012-01-09 18:37:50 +01:00
Benjamin Otte
a3225fdd42 cssprovider: Remove has_inherit flag from rulesets
It's not used anymore
2012-01-09 18:37:50 +01:00
Benjamin Otte
40a7618d2a cssprovider: Don't do inheritance anymore
Its' done in GtkCssLookup with the help of GtkStyleContext::parent now.
2012-01-09 18:37:50 +01:00
Benjamin Otte
fbedcdaf7d css: Make CSS resolving work according to spec
See inline code comments taken from
  http://dev.w3.org/csswg/css3-cascade/#cascade

This now respects the special values "inherit" and "initial" properly.
Note that those values cannot be parsed yet. This will be added in a
future commit.
2012-01-09 18:37:50 +01:00
Benjamin Otte
5a815e2159 styleproperty: Add _gtk_style_property_get_initial_value() 2012-01-09 18:37:50 +01:00
Benjamin Otte
242893a031 css: Pass the parent context to _gtk_css_lookup_resolve()
This way, we can resolve inherit properties.
2012-01-09 18:37:50 +01:00
Benjamin Otte
0ac519e8a1 widget: Set parent style context 2012-01-09 18:37:50 +01:00
Benjamin Otte
b50d2b74d7 API: Add GtkStyleContext::parent
We need this for proper support of CSS inherit.
2012-01-09 18:37:50 +01:00
Benjamin Otte
aa4925480d styleproperty: Pass initial value explicitly 2012-01-09 18:37:50 +01:00
Benjamin Otte
4d15186e67 css: Add GtkCssSpecialValue 2012-01-09 18:37:50 +01:00
Benjamin Otte
6dd50c6cca css: Add some docs to GtkCssLookup
In particular, document which parts of the CSS value querying we're
doing here.
2012-01-09 18:37:50 +01:00
Benjamin Otte
ba5e7012b1 css: Redo StyleProvider interface
We now use the GtkStleProviderPrivate interface, which hopefully is
faster and more conformant to CSS. Long term, it definitely should be
both.

I would have liked to split this up into multiple commits, but couldn't
find a way.
2012-01-09 18:37:50 +01:00
Benjamin Otte
38a9b28a0e styleproperties: Add a hacky function to redirect color lookups
This will soon be necessary.
FIXME: Make sure this gets removed again.
2012-01-09 18:37:49 +01:00
Benjamin Otte
c048aac1d9 symboliccolor: Add _gtk_symbolic_color_resolve_full() 2012-01-09 18:37:49 +01:00
Benjamin Otte
899a381d31 stylecontext: Separate properties by states
We don't want to mix states the wrong way. And the current approach does
that.
2012-01-09 18:37:49 +01:00
Benjamin Otte
a488d2184a stylecontext: Pass state to style data lookup function 2012-01-09 18:37:49 +01:00
Benjamin Otte
cdb3f05bf1 css: Add _gtk_style_property_get_count() 2012-01-09 18:37:49 +01:00
Benjamin Otte
54d2b9dbc2 cssprovider: Keep a bitmask for the properties
That way we can easily tell wich properties are in use.
2012-01-09 18:37:49 +01:00
Benjamin Otte
eb38591c91 css: Add _gtk_style_property_get_id() 2012-01-09 18:37:49 +01:00
Benjamin Otte
f6cf447cad styleproperty: Assign a unique id to every styleproperty 2012-01-09 18:37:49 +01:00
Benjamin Otte
eddd36d1d9 tests: Add tests for GtkBitmask 2012-01-09 18:37:49 +01:00
Benjamin Otte
45b9193290 gtk: Add GtkBitmask
The CSS code likes to have that very much.
2012-01-09 18:37:49 +01:00
Stefan Sauer
f7d3ca46f7 gtkscale: fix bogus compare func
The GtkScaleMark values are gdouble, a simple a-b compare func would fail for
values with the same integer value. This breaks the sorting and causes random
marker label placement.
2012-01-09 18:33:11 +01:00
Rui Matos
052c6e0681 scrolledwindow: Render the background so that it can be styled 2012-01-09 16:45:44 +00:00
Rui Matos
09979513b2 window: Stop setting state flags on the style context for drawing
This also removes setting the FOCUSED state flag when
gtk_window_has_toplevel_focus() since this effect can now be done with the new
WINDOW_UNFOCUSED flag instead which actually works better regarding X grabs
and modal windows.
2012-01-09 16:45:44 +00:00
Rui Matos
440663f3fe treeview: Use the widget state flags as a base for drawing expanders 2012-01-09 16:45:44 +00:00
Rui Matos
2972236fdb treeview: Stop setting state flags on the style context for drawing 2012-01-09 16:45:44 +00:00
Rui Matos
76485b8670 trayicon-x11: Stop setting state flags on the style context for drawing 2012-01-09 16:45:44 +00:00
Rui Matos
8bb0773535 toolitemgroup: Use the widget state flags as a base for drawing 2012-01-09 16:45:44 +00:00
Rui Matos
4011326388 toolbar: Stop setting state flags on the style context for drawing 2012-01-09 16:45:44 +00:00
Rui Matos
a1f72eb06c Revert "button: Stop setting state flags on the style context for drawing"
Setting state flags is actually needed here since this function is called by
GtkButton subclasses which add their specific state flags as a parameter.

This reverts commit e868b8d6ea.
2012-01-09 16:45:44 +00:00