Commit Graph

17241 Commits

Author SHA1 Message Date
Benjamin Otte
4ff9b07490 Raleigh: Improve the spinner animation
Make it closer to how it was previously.
2012-09-18 15:28:42 +02:00
Ryan Lortie
99a53112ec GtkAccelLabel: adjust recent accel changes
In the event that a GtkAccelKey was present for the closure but it
contained a keyval of 0 the previous code would show "".  After the
recent adjustments, "-/-" would be shown in this case.

It turns out to be a pretty common case, so fix the logic to stop using
'0' as a magic value to mean "don't have an accel" and add a separate
boolean for that purpose.
2012-09-18 08:57:53 -04:00
Benjamin Otte
8c3caae33f cssimage: Add a hack to get antialiased circles
We like to draw circles in themes, and as radial gradients are the only
okayish way to do that, at least make them antialiased.
2012-09-18 13:26:20 +02:00
Matthias Clasen
bf2cf23262 Force spinners to be square 2012-09-17 22:47:36 -04:00
Matthias Clasen
6210e7fb80 GtkSettings: Properly clean up style providers 2012-09-17 22:31:25 -04:00
Matthias Clasen
ab3d6a0b0a Revert "Bind the themes to the livecycle of the screen"
This reverts commit 1f5dea9eba,
since it was causeing noticable behaviour changes.

Previously, GTK_DATA_PREFIX=/ ./gtk3-demo would start
gtk3-demo with the Raleigh theme. With that change, it
was starting with no theme at all (i.e. all black).
2012-09-17 22:31:25 -04:00
Benjamin Otte
047b6b7194 css: Add a spinner animation to the default theme 2012-09-17 20:40:01 +02:00
Benjamin Otte
0cecf315fd cssanimation: Implement pausing the animation 2012-09-17 20:40:01 +02:00
Benjamin Otte
d74e1b9ac9 stylecontext: Always create animations
Even when there is no current values, do create animations. This ensures
that animations do exist for unmapped widgets when they get mapped
later.
2012-09-17 20:40:01 +02:00
Benjamin Otte
4a281edc87 stylecontext: Only create transitions conditionally
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.
2012-09-17 20:40:01 +02:00
Benjamin Otte
7712d41b5e stylecontext: Refactor the way animations are started and stopped
We now create animation objects unconditionally, but we only run the
animation loop when gtk_style_context_should_animate() return TRUE.
2012-09-17 20:40:01 +02:00
Benjamin Otte
13cbd22d17 stylecontext: Clear animations for values kept in cache 2012-09-17 20:40:01 +02:00
Benjamin Otte
37dac2a481 stylecontext: Remove leftover debugging
... 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.
2012-09-17 20:39:14 +02:00
Benjamin Otte
e2cc9f3afc csscomputedvalues: Handle starting animations differently 2012-09-17 20:39:14 +02:00
Benjamin Otte
bf19d89510 animation: Don't set the changed properties anymore
The code is not needed anymore. And it looked wrong, too, so I'm glad
it's gone.
2012-09-17 20:39:13 +02:00
Benjamin Otte
2147473131 csscomputedvalues: Compute the changes by animations ourselves
Instead of letting the animation set a bitmask unconditionally, actually
compare the before and after values for changes.
2012-09-17 20:39:13 +02:00
Benjamin Otte
ee6f886434 cssimage: Make cross-fade code safe for non-integer sizes
This includes sizes < 1px, which previously caused a SEGV.
2012-09-17 20:39:13 +02:00
Benjamin Otte
f77f6f3322 cssvalue: Fix out-of-bounds in array transition code 2012-09-17 20:39:13 +02:00
Cosimo Cecchi
ebf9e9db42 themingengine: animate spinners again
Using the animation specified with CSS by the theme.
2012-09-17 20:39:13 +02:00
Benjamin Otte
7cf2adfec4 cssvalue: Always consider values equal to themselves 2012-09-17 20:39:13 +02:00
Cosimo Cecchi
bdd64dc055 csseasevalue: fix wrong priority in steps easing transformation
We need to add parentheses around the ternary operator, or it will be
applied to the whole expression.
2012-09-17 20:39:13 +02:00
Benjamin Otte
eb6ad3562e cssimage: Implement (most of) current cross-fade syntax
The CSS4 spec adapted their cross-fade syntax again. Yay!
(The previous parser was completely broken anyway...)
2012-09-17 20:39:13 +02:00
Benjamin Otte
a7ec3ba53f csscomputedvalues: Get rid of animated values
Merge the animated values code into the computed values code. This
should get rid of various bugs related to animated->computed updating.
2012-09-17 20:39:12 +02:00
Benjamin Otte
7248c19037 csscomputedvalues: Store animated values here
Actually use the GtkCssComputedValues to store the computed values here
instead of putting them into the GtkCssAnimatedValues separately.
2012-09-17 20:39:12 +02:00
Benjamin Otte
94a3bd21e5 csscomputedvalues: Allow storing animated values here
It's not used yet, but that will come in the next patch(es). This is a
separate patch to make sure we didn't mess up anything.
2012-09-17 20:39:12 +02:00
Benjamin Otte
89d6d34bee csscomputedvalues: Inline function 2012-09-17 20:39:12 +02:00
Benjamin Otte
7224f897d6 animation: Add _gtk_style_animation_is_static()
This will be useful to not trigger updates all the time when nothing is
happening (ie due to animations being paused or due to them having
reached their final value).
2012-09-17 20:39:12 +02:00
Benjamin Otte
229b6fe17a css: Add animation support
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.
2012-09-17 20:39:12 +02:00
Benjamin Otte
206aa209ae widget: Use gtk_widget_queue_draw() for queueing redraws
This change is necessary because the old code did not accound for corner
cases (like translucent child windows), which could stop
gtk_widget_queue_resize() to not trigger redraws.
2012-09-17 20:39:12 +02:00
Benjamin Otte
554002028c stylecontext: Provide a function for getting the style provider
This will be necessary for creating the computed values for keyframes.
2012-09-17 20:39:12 +02:00
Benjamin Otte
e1e9dec1b2 window: Add the .background class to windows unconditionally 2012-09-17 20:39:11 +02:00
Benjamin Otte
854585e770 css: Implement 'animation' shorthand parsing 2012-09-17 20:39:11 +02:00
Benjamin Otte
c69e30d65a cssparser: Don't use a free'd string in error messages 2012-09-17 20:39:11 +02:00
Benjamin Otte
5510bef70a cssstyleproperty: Add animation properties 2012-09-17 20:39:11 +02:00
Benjamin Otte
0185e323db cssvalue: Add animation enum properties 2012-09-17 20:39:11 +02:00
Benjamin Otte
e6c951a303 styleprovider: Add query function for keyframes 2012-09-17 20:39:11 +02:00
Benjamin Otte
c4cdb33b32 cssprovider: Add parsing support for @keyframes 2012-09-17 20:39:10 +02:00
Ryan Lortie
3ee837564e gtk.symbols fixup 2012-09-17 12:34:33 -04:00
Ryan Lortie
dd143479fe gtkmodelmenu: simplify logic, expose bind API
Make the main (and only) entry-point to gtkmodelmenu.c the now-public
gtk_menu_shell_bind_model().

Move the convenience constructors (gtk_menu_new_from_model() and
gtk_menu_bar_new_from_model()) to their proper files.

Remove the private header file.

Simplify the code a bit by making the initial populate part of the
bind() call.

https://bugzilla.gnome.org/show_bug.cgi?id=682831
2012-09-17 12:31:22 -04:00
Ryan Lortie
778aa7ade0 GtkAccelLabel: add manual accel API
Add an API to GtkAccelLabel for hardcoding the accel key to be displayed
(ie: allowing us to bypass the GtkAccelGroup lookup).

Use that from the GMenuModel-based GtkMenu construction code instead of
passing around the accel group.

This makes accel labels work in bloatpad again.

This patch effectively removes any hope of automatic runtime accel
changes in GMenuModel-based menus without additional application
support but it leaves the door open for this to be supported again in
the future (if we decide that it's important).

https://bugzilla.gnome.org/show_bug.cgi?id=683738
2012-09-17 12:31:22 -04:00
Ryan Lortie
338b5f6c2d GtkModelMenuItem: add a submenu action attribute
Add support for a stateful action associated with a submenu.  The action
state is set to TRUE when the menu is shown and FALSE when it is
unshown.

This is useful to avoid unnecessary processing for menus that have
frequently-changing content.

A possible future feature is to add support for asynchronously filling
the initial state of the menu by waiting until the action actually emits
its state-change signal to TRUE before showing the menu.

A silly example has been added to Bloatpad to demonstrate the new
feature.

https://bugzilla.gnome.org/show_bug.cgi?id=682630
2012-09-17 12:31:21 -04:00
William Jon McCann
b05224b059 Add back gtk_css_provider_get_named
Was in the original patch but was not in 1f5dea9 probably due to
a bad rebase.

https://bugzilla.gnome.org/show_bug.cgi?id=683896
2012-09-17 09:54:26 -04:00
Cosimo Cecchi
e34467a375 menubutton: set DROPDOWN_MENU hint on the menu toplevel
Restore the behavior introduced in
598163e526, which regressed in commit
5a3442bf9c.
2012-09-17 09:50:03 -04:00
Ignacio Casal Quinteiro
50e5323e51 Do not introspect gtk_color_button_get_rgba.
This method is deprecated so it gets in the way of the
implemented gtk_color_chooser_get_rgba.
2012-09-17 14:52:08 +02:00
Matthias Clasen
70384941fb Preserve gtk_widget_get_default_style semantics
Make sure that we return a GtkStyle even if there's no screen yet.
2012-09-17 07:53:44 -04:00
Matthias Clasen
bc17073a25 Move the gtk_shadow_type check down to gtk_render_frame
In gtk_menu_bar_draw, the check for shadow type != none
disables rendering of the background instead of the frame.
The check should be moved down to gtk_render_frame.
Patch by Peter de Ridder,
http://bugzilla.gnome.org/show_bug.cgi?id=670390
2012-09-16 23:28:06 -04:00
Sébastien Granjoux
af5ecd77e3 button: Clear highlight when a button is removed from a container
A button is highlighted if the private variable in_button is TRUE.
This variable is set when the pointer is over the button and cleared when
it left the button. When a button is hidden while there is the pointer over
it, GTK generates a leave notification event, in_button is set to FALSE.
But when a button is removed from a container but not destroyed, it is
unrealized and loose its window. It cannot receive the leave notification
event and in_button stay TRUE. So when the button get a new parent it is still
highlighted.

https://bugzilla.gnome.org/show_bug.cgi?id=676890
2012-09-16 23:28:02 -04:00
Sébastien Granjoux
f9e435df43 GtkAssistant: bgo#658694 - Unable to change current page in prepare handler 2012-09-16 23:27:57 -04:00
William Jon McCann
e044676584 Destroy the legacy style with the screen
https://bugzilla.gnome.org/show_bug.cgi?id=683896
2012-09-16 21:36:18 -04:00
William Jon McCann
92ddf14457 Don't leak a ref to the tooltip window
https://bugzilla.gnome.org/show_bug.cgi?id=683896
2012-09-16 21:36:18 -04:00