Commit Graph

47 Commits

Author SHA1 Message Date
Benjamin Otte
6c49ffe916 themingbackground: Outset shadows require border box
They are drawn relative to the border box, not relative to the padding
box.
2014-05-23 19:29:27 +02:00
Chris Cummins
f478f16dba cds: enable outset shadows
Adds conditional code paths to GdkCssShadowValue for painting outset
shadows, and allows shadows to be applied in two passes (first outset
then inset). This can be used to draw csd shadows in outer window
borders.

https://bugzilla.gnome.org/show_bug.cgi?id=695998
Signed-off-by: Rob Bradford <rob@linux.intel.com>
2013-04-09 12:52:47 +01:00
Benjamin Otte
2e287576b4 themingbackground: Remove struct members
... and put them in the only function they are used in.
2012-10-31 11:09:12 +01:00
Benjamin Otte
6821a8f7b2 themingbackground: Remove GtkThemingBackgroundLayer
The struct was just the index. So just pass the index around instead of
a full struct.
2012-10-31 11:09:11 +01:00
Benjamin Otte
5e7949c47b themingbackground: Use get_box() for background image size 2012-10-31 11:09:11 +01:00
Benjamin Otte
ba96c34787 themingbackground: Introduce gtk_theming_background_get_box()
to query the different clip boxes used by the background drawing code.
Use this function to query these boxes when clipping.
2012-10-31 11:09:11 +01:00
Benjamin Otte
12dec5279e themingbackground: Add content_box variable
... to go with border_box and padding_box.
2012-10-31 11:09:11 +01:00
Benjamin Otte
e9dbfc0e06 themingbackground: Get rid of flags variable 2012-10-31 11:09:11 +01:00
Benjamin Otte
0ccb7db245 themingbackground: Move image variable
... from the Layer struct onto the stack of the only function using it.
2012-10-31 11:09:11 +01:00
Benjamin Otte
ccaf1c2c67 themingbackground: Restructure code some more
Move variable initialization outside the first code with side effects.
This allows adding some more early returns, including one for code that
used to trigger g_return_if_fail() in certain corner cases.
2012-10-31 11:09:11 +01:00
Benjamin Otte
ce56248930 themingbackground: Restructure code
Make if statements encompassing the whole function into early returns.
The rest of the diff is reindenting.
2012-10-31 11:09:11 +01:00
Cosimo Cecchi
65166c36b9 themingbackground: fix drawing for repeating positioned images
When we determine the fill rectangle for an image layer, and the image
is not repeating, we should also position the rectangle according to the
values of background-position, or we will always fill a tiny slice at
the top/left of the clip box.

https://bugzilla.gnome.org/show_bug.cgi?id=677109
2012-05-30 12:16:11 -04:00
Cosimo Cecchi
403025f229 themingbackground: don't clear the window bg cairo surface
This is not needed anymore now that windows are transparent by default.
2012-05-24 15:10:19 -04:00
Cosimo Cecchi
9cdff6ed67 themingbackgorund: render all background layers
Now that background properties are arrays, use them in
GtkThemingBackground when rendering.
2012-05-15 13:24:40 -04: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
Cosimo Cecchi
20f8dd2309 themingbackground: fix copy/paste typo
We need to fetch the area value for the origin, not for the clip.
2012-04-30 12:10:45 -04: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
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
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
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
4ba9be5b97 cssvalue: Add GtkCssArea to the enum values
... and get rid of its GType.

This makes it non-queryable using gtk_style_context_get() but it used to
be a private struct anyway.
2012-04-17 08:59:15 +02:00
Benjamin Otte
8c49cd97a7 cssvalue: Add a cssvalue for images 2012-04-17 08:59:14 +02:00
Benjamin Otte
ec5c77a552 shadow: Rename to GtkCssShadowValue
I don't want to confuse css values with other stuff, so there.
2012-04-17 08:59:13 +02:00
Benjamin Otte
ccd443796c shadow: Make this a GtkCssValue 2012-04-17 08:59:13 +02:00
Benjamin Otte
281d094b42 theming: Use peek_property() calls to query shadows 2012-04-17 08:59:13 +02:00
Benjamin Otte
5bbf59b519 cssvalue: Constify a bunch of APIs 2012-04-17 08:59:10 +02:00
Alexander Larsson
e65a2709a3 css: Support background-position property 2012-03-17 05:13:22 +01:00
Alexander Larsson
7603e6e473 css: Use GtkCssValues instead of GValue in the css machinery
Also, in places where we're computing a new CssValue based on an
old one, make sure that if nothing changes we're returning a reference
to the old one, rather than creating a new identical instance.
2012-03-08 11:03:57 +01:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Cosimo Cecchi
46187037a3 themingbackground: make it based on GtkStyleContext
Instead of GtkThemingEngine. This will allow for the object to be also
used from inside e.g. a _draw() method.
2012-02-14 16:36:57 -05:00
Benjamin Otte
2434dbc10a themingbackground: Implement background-size support 2012-02-02 03:14:01 +01:00
Benjamin Otte
6100900e1a themingengine: Don't draw background image if no area
If the background positioning area is empty (width/height <=0), don't
attempt to draw the background image.
2012-01-11 15:48:54 +01:00
Benjamin Otte
bbf5fe179d background: Implement all options of background-repeat 2012-01-09 18:37:58 +01:00
Benjamin Otte
4b7ca9602d background: Simplify background-repeat
It used to be a struct, now it's just an enum
2012-01-09 18:37:58 +01:00
Benjamin Otte
52af00686b themingbackground: Convert to GtkCssImage
The conversion is incomplete and requires some work to account for
all the CSS crazies, like repeat modes and background-size.
2012-01-09 18:37:57 +01:00
Benjamin Otte
a35df38443 theme: Apply background merging code
It was unused and untested and did not do at all what the CSS spec says.
2012-01-09 18:37:56 +01:00
Benjamin Otte
9181282d88 style: Remove GtkStylePropertyContext again
We need to solve this differently. I have no idea yet how, but I'll
invent something later.

This only affects win32 theming and that's broken anyway.
2012-01-09 18:37:56 +01:00
Benjamin Otte
4da493402d css: 'none' is not a value background-repeat 2012-01-09 18:37:51 +01:00
Benjamin Otte
ab1699510e themingbackground: Avoid erroring cairo context 2011-12-23 22:30:45 +01:00
Cosimo Cecchi
a7f3a9ff74 themingengine: split a GtkThemingBackground object
Allows easier modification and general sanity of the CSS background
rendering code.
2011-12-12 12:46:52 +01:00