summaryrefslogtreecommitdiff
path: root/gtk/gtkstylecontext.c
Commit message (Collapse)AuthorAgeFilesLines
* stylecontext: Deprecate direction propertyBenjamin Otte2012-12-181-0/+12
| | | | | ... and the functions implementing it. Also deprecate the direction getter on GtkThemingEngine.
* stylecontext: Use state flags for directionBenjamin Otte2012-12-181-12/+39
| | | | | | | ... instead of using a custom direction member. And with that, GtkWidget doesn't need to call gtk_style_context_set_direction() anymore.
* stylecontext: Fix gtk_style_context_set_background()Benjamin Otte2012-12-171-8/+28
| | | | | | | | | | | | | This function is just a sophisitcated optimization. If we know the GDK window's background will be opaque, we mark it as opaque. This is so GDK can do all the optimizations it does for opaque windows and be fast. This is mainly used when scrolling. The previous code didn't get this right, in particular it didn't enforce a transparent background when it knew the background was not opaque.
* stylecontext: Deprecate gtk_style_context_get_font()Benjamin Otte2012-12-061-0/+3
| | | | | | | | | This is for a very simple reason: The getter is returning a const value and the font isn't const anymore. So we need to store the font description somewhere but we can't reuse it as it's changing all the time (yay animations, yay inherited values). Sucks. So keep the hack in here but deprecate the function.
* stylecontext: Always recompute fontBenjamin Otte2012-12-061-9/+6
| | | | | | | | This is necessary because values in a GtkCssComputedValues can change now. So if the font-size is inherited or animated, the cached value will be outdated. Fixes the fontchooser preview not updating.
* stylecontext: Remove unused private functionsBenjamin Otte2012-11-301-11/+0
|
* stylecontext: Expose a function to get at the current changesBenjamin Otte2012-11-301-0/+20
|
* stylecontext: Pass a bitmask to the changed valuesBenjamin Otte2012-11-301-6/+15
|
* deprecations: Move files into deprecated/ dirBenjamin Otte2012-11-251-2/+3
|
* symboliccolor: DeprecateBenjamin Otte2012-11-251-0/+4
| | | | | | | Symbolic colors are an implementation detail of the CSS engine and have been superceded by GtkCssColorValue. We don't want them clobbering the public API. In particular because the only use I could find in the public API is people using it to shade colors.
* styleprovider: Change function prototypeBenjamin Otte2012-11-251-7/+7
| | | | | | | Make _gtk_style_provider_private_get_color() return a GtkCssValue (a GtkCssColorValue to be exact) instead of GtkSymbolicColor. With this, the symbolic color usage inside GTK is minimized.
* symboliccolor: Implement using GtkCssValueBenjamin Otte2012-11-251-5/+6
|
* stylecontext: Split out a functionBenjamin Otte2012-11-181-12/+2
| | | | | The function is used in multiple places, so split it out. In particular because I'm about to change it.
* stylecontext: Add a flag to force style_updated() emissionBenjamin Otte2012-11-141-1/+1
| | | | | This is used in gtk_widget_reset_style() (via GTK_CSS_CHANGE_ANY) now, and that makes GtkSettings font related changes work again.
* Exit early in gtk_style_context_update_cache codepathsAlexander Larsson2012-11-091-1/+5
| | | | | | If lookup->missing is empty we don't need to continue looking. We short circuit in several places as this can happen after iteratively makeign lookup->missing smaller.
* stylecontext: Fix a memleakBenjamin Otte2012-11-081-0/+2
|
* stylecontext: Remove unused functionBenjamin Otte2012-11-081-19/+0
|
* stylecontext: Don't use bg image in gtk_style_context_set_background()Benjamin Otte2012-10-311-10/+0
| | | | | | | | | | Old code tried to use the "background-image" proeprty for setting the default image background. While this used to work in the early days of GTK3, today it is grossly misleading as the backgronud image may be resized, repositioned and semi-translucent which causes very weird artifacts when rendering. So we use the background-color only instead.
* gradient: Add a private header fileBenjamin Otte2012-10-021-0/+1
|
* stylecontext: Actually use superset matcherBenjamin Otte2012-10-011-3/+6
| | | | | | | ... when looking up the needed changes. This is what that matcher was actually written for, but it seems I never hooked it in.
* css: Huge refactoring to avoid computing wrong valuesBenjamin Otte2012-09-281-11/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Here's the shortest description of the bug I can come up with: When computing values, we have 3 kinds of dependencies: (1) other properties ("currentColor" or em values) (2) inherited properties ("inherit") (3) generic things from the theme (@keyframes or @define-color) Previously, we passed the GtkStyleContext as an argument, because it provided these 3 things using: (1) _gtk_style_context_peek_property() (2) _gtk_style_context_peek_property(gtk_style_context_get_parent()) (3) context->priv->cascade However, this makes it impossible to lookup values other than the ones accessible via _gtk_style_context_peek_property(). And this is exactly what we are doing in gtk_style_context_update_cache(). So when the cache updates encountered case (1), they were looking up the values from the wrong style data. So this large patch essentially does nothing but replace the context argument in all compute functions with new arguments for the 3 cases above: (1) values (2) parent_values (3) provider We apparently have a lot of computing code.
* symboliccolor: Change prototype of _gtk_symbolic_color_resolve_full()Benjamin Otte2012-09-281-17/+3
| | | | | We can juts pass a GtkStyleProviderPrivate, that one has the vfunc we want already. So no need to pass vfuncs anymore.
* stylecontext: Rebuild cached styles with correct classes/regionsBenjamin Otte2012-09-281-10/+8
| | | | | Previously, we were using the default classes and regions. That's obviously wrong.
* stylecontext: Always create animationsBenjamin Otte2012-09-171-14/+14
| | | | | | Even when there is no current values, do create animations. This ensures that animations do exist for unmapped widgets when they get mapped later.
* stylecontext: Only create transitions conditionallyBenjamin Otte2012-09-171-1/+22
| | | | | | | | | While regular animations should always be created, transitions should not. This patch allows to express this by passing NULL as the values to transition from. It also adds a gtk_style_context_should_create_transitions() function that returns TRUE when transitions should be created.
* stylecontext: Refactor the way animations are started and stoppedBenjamin Otte2012-09-171-64/+44
| | | | | We now create animation objects unconditionally, but we only run the animation loop when gtk_style_context_should_animate() return TRUE.
* stylecontext: Clear animations for values kept in cacheBenjamin Otte2012-09-171-0/+3
|
* stylecontext: Remove leftover debuggingBenjamin Otte2012-09-171-2/+0
| | | | | | | | ... that actually was both wrong, a performance failure and has been there since the original checkin. Updating the cached style data absolutely does not mean clearing all cached style data first. There's nothing to update then.
* csscomputedvalues: Handle starting animations differentlyBenjamin Otte2012-09-171-10/+13
|
* csscomputedvalues: Get rid of animated valuesBenjamin Otte2012-09-171-18/+12
| | | | | Merge the animated values code into the computed values code. This should get rid of various bugs related to animated->computed updating.
* css: Add animation supportBenjamin Otte2012-09-171-1/+2
| | | | | | | | | | | This adds the GtkCssAnimation class and the code needed to hook it into GtkStyleContext. It takes the values out of the CSS "animation" properties and does animations. See http://dev.w3.org/csswg/css3-animations/ for details. Note that the code for starting and stopping animations with widget visibility doesn't work yet.
* stylecontext: Provide a function for getting the style providerBenjamin Otte2012-09-171-0/+8
| | | | This will be necessary for creating the computed values for keyframes.
* stylecontext: fix a StyleData refleakCosimo Cecchi2012-09-131-2/+3
| | | | | | We were failing to unref the style data in some code paths. https://bugzilla.gnome.org/show_bug.cgi?id=683627
* css: Make color lookup handle dependenciesBenjamin Otte2012-08-281-10/+17
|
* stylecontext: Update computed values when dependencies changeBenjamin Otte2012-08-281-2/+39
| | | | | | | This fixes the longstanding bug where GTK would not update styles when parent styles would change. https://bugzilla.gnome.org/show_bug.cgi?id=672046
* stylecontext: Refactor some codeBenjamin Otte2012-08-281-30/+29
| | | | | | This just changes the arguments passed to build_properties() and moves that function around in the source file. No functional changes are happening.
* css: Pass relevant properties to css lookup codeBenjamin Otte2012-08-281-1/+1
| | | | This is not used yet in this patch.
* stylecontext: Compute correct changesBenjamin Otte2012-08-281-11/+19
| | | | | | | ... in the case where no change of the DOM tree actually happened. We don't do anything yet with that information, this patch just correctly computes it.
* stylecontext: Split out a function for simplicityBenjamin Otte2012-08-281-25/+38
|
* stylecontext: Pass the changes in the parent to validation functionBenjamin Otte2012-08-281-4/+5
| | | | This way, inherited properties can be updated.
* stylecontext: pass down the requested change type to invalidationCosimo Cecchi2012-06-131-1/+1
| | | | | | <Company>: cosimoc: yes, that totally makes sense <Company>: looks like a copy/paste error from when i factored out that function
* Clarify the gtk_style_context_add_provider docsMatthias Clasen2012-05-261-2/+5
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=643490
* stylecontext: Make queue_invalidate() always workBenjamin Otte2012-05-081-13/+10
| | | | | Handle both the case where a widget is set and also the case where a widget path is set.
* stylecontext: Disallow adding/removing GtkSettings style providersBenjamin Otte2012-05-021-0/+3
| | | | | Adding "system" providers like the GtkSettings object shouldn't be allowed at all, so ensure that it indeed is not.
* debug: Add GTK_DEBUG=no-css-cacheBenjamin Otte2012-05-021-0/+16
| | | | | | See inline comments for what it does. Its main use is figuring out if something has been caused by GTK's caching of CSS properties or if it's a different problem.
* cssmatcher: Handle case of empty widget pathBenjamin Otte2012-05-011-7/+9
| | | | This is tested by the stylecontext test, but doesn't appear in practice.
* container: Redo style validation handlingBenjamin Otte2012-04-171-1/+1
| | | | | | Instead of using 1 global queue for both resizes and style validation, use 2 queues. This makes the code a lot simpler and fixes a bug where we could accidentally stop restylying for very delayed restyles.
* stylecontext: Avoid style_context_save() callsBenjamin Otte2012-04-171-12/+20
| | | | Introduce style_data_lookup_for_state() that does this.
* stylecontext: Pull all the animation code togetherBenjamin Otte2012-04-171-8/+109
| | | | | | | We now animate the core style information (see comment in gtk_style_context_save()). A lot of widgets save + set custom style classes/states during drawing and so can't be animated. It does work for labels, menus and buttons though.
* stylecontext: Shuffle around codeBenjamin Otte2012-04-171-8/+13
| | | | | | | | | | This has two goals: 1) Move invalidation code out of a nested if branch. Invalidation is actually the most important thing this function does. 2) Have the changes bitmask available. It will needed for invalidate calls to children later.