395db3afb6
themingbackground: Use fill() instead of clip() + paint()
...
It's simpler code and I believe it's faster, too.
2014-10-08 05:23:11 +02:00
a3d68af950
themingbackground: Add a quick exit for default case
...
In the case where the background is completely transparent, exit the
rendering functions before doing any expensive calculations.
2014-10-08 05:20:31 +02:00
14d166145a
themingbackground: Call shadow function directly
...
... instead of having a custom function for it.
2014-10-08 05:20:31 +02:00
5cdb9752a7
themingbackground: Don't store (almost) unused variables
...
Instead, parse them directly to the one function that uses them.
2014-10-08 05:20:31 +02:00
6e68237191
themingbackground: Don't store bg_color in struct
...
Instead, keep it as a separate variable.
2014-10-08 05:20:31 +02:00
8abf82fcf4
themingbackground: Use an array instead of 3 separate members
...
Simplifies code
2014-10-08 05:20:31 +02:00
05460f4982
render: Make rendering the background a single function
2014-10-08 05:20:30 +02:00
c543ddab3a
theming: Use gtk_style_context_peek_property()
...
instead of outdated accessors.
2014-10-03 06:18:06 +02:00
5e8d3d533f
themingbackground: Remove initializer that takes a GtkThemingEngine
...
With the unification to use style contexts everywhere, make that
initializer the only one to use.
Also rename it appropriately.
2014-08-16 19:39:44 +02:00
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
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
2e287576b4
themingbackground: Remove struct members
...
... and put them in the only function they are used in.
2012-10-31 11:09:12 +01:00
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
5e7949c47b
themingbackground: Use get_box() for background image size
2012-10-31 11:09:11 +01:00
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
12dec5279e
themingbackground: Add content_box variable
...
... to go with border_box and padding_box.
2012-10-31 11:09:11 +01:00
e9dbfc0e06
themingbackground: Get rid of flags variable
2012-10-31 11:09:11 +01:00
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
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
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
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
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
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
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
f65970b521
styleproperty: make background-size an array property
2012-05-15 13:24:40 -04:00
9b04673392
styleproperty: make background-position an array property
2012-05-15 13:24:40 -04:00
ed12be7e81
styleproperty: make background-repeat an array property
2012-05-15 13:24:40 -04:00
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
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
cfc6462730
cssvalue: Add a cssvalue for background-size
2012-04-17 08:59:18 +02:00
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
5377169ef3
cssvalue: Add a value for background-position
2012-04-17 08:59:18 +02:00
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
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
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
31565139ba
stylecontext: Convert _gtk_style_context_peek_property()
...
Take the property id instead of the name.
2012-04-17 08:59:15 +02:00
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
8c49cd97a7
cssvalue: Add a cssvalue for images
2012-04-17 08:59:14 +02:00
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
ccd443796c
shadow: Make this a GtkCssValue
2012-04-17 08:59:13 +02:00
281d094b42
theming: Use peek_property() calls to query shadows
2012-04-17 08:59:13 +02:00
5bbf59b519
cssvalue: Constify a bunch of APIs
2012-04-17 08:59:10 +02:00
e65a2709a3
css: Support background-position property
2012-03-17 05:13:22 +01:00
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
9d0febc9a6
Change FSF Address
2012-02-27 17:06:11 +00:00
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
2434dbc10a
themingbackground: Implement background-size support
2012-02-02 03:14:01 +01:00
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
bbf5fe179d
background: Implement all options of background-repeat
2012-01-09 18:37:58 +01:00
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