Commit Graph

17304 Commits

Author SHA1 Message Date
Benjamin Otte
1cecaf6d7e blur: Take the radius as a double parameter
It's only ever used like that
2012-09-20 02:45:41 +02:00
Andrea Cimitan
43673dafdc Add code for blurring (original code from Unico, copyright fine for Gtk+) 2012-09-20 02:45:41 +02:00
Cosimo Cecchi
2d5fa78528 spinbutton: fix style context path for internal buttons
We were adding one child too much to the style context path when
generating it for the internal buttons, which in turn caused sibling
selectors from the theme such as :first-child to apply to both buttons
under certain circumstances. Spotted by Lapo Calamandrei.
2012-09-19 15:41:19 -04:00
Cosimo Cecchi
67e44e6a4e Revert "levelbar: start filling from the bottom"
This reverts commit 4b3ed75f7d.

I didn't see https://bugzilla.gnome.org/show_bug.cgi?id=684288 - it
makes more sense to properly fix this for the next cycle.
2012-09-19 15:23:43 -04:00
Stefano Facchini
4b3ed75f7d levelbar: start filling from the bottom
As long as we don't have an API for explicitly inverting the bar, it
makes more sense for the progress in vertical orientation to fill from
the bottom.
2012-09-19 15:18:45 -04:00
Benjamin Otte
6696aa2128 cssprovider: Remove another path that can't be reached
... because the return value of a function is always TRUE.
2012-09-19 15:32:38 +02:00
Benjamin Otte
697ed544dd docs: Clarify GtkCssProvider loading return values 2012-09-19 15:30:21 +02:00
Benjamin Otte
ee91f22086 cssprovider: Get rid of return value
... that is always TRUE.
2012-09-19 15:18:51 +02:00
Murray Cumming
1c366eb75e GtkSettings: Fix small typo in docs. 2012-09-19 09:54:47 +02:00
Matthias Clasen
b46ef0eb87 Fix distcheck
A mention of gtkmodelmenu.h was leftover in Makefile.am.
2012-09-18 15:10:55 -04:00
Matthias Clasen
e0f2492ce8 Avoid an unintented export
GtkStyleCascade is entirely private, so don't leak any symbols.
2012-09-18 13:54:22 -04:00
Cosimo Cecchi
5addd8cbe6 mountoperation: fix previous commit
We don't want to call this method if there's no shell agent.
2012-09-18 13:48:07 -04:00
Cosimo Cecchi
a67e885531 mountoperation: don't timeout proxied mount operation dialogs
When we proxy mount operation dialogs to the Shell agent, don't use a
timeout for the remote calls, since we will be waiting on user
interaction.
2012-09-18 13:46:14 -04:00
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
William Jon McCann
9bd408a58f Destroy the icon factory with the screen
https://bugzilla.gnome.org/show_bug.cgi?id=683896
2012-09-16 21:35:58 -04:00
William Jon McCann
8a9a3949dd Don't leak a ref to the settings
https://bugzilla.gnome.org/show_bug.cgi?id=683896
2012-09-16 20:21:06 -04:00
William Jon McCann
1f5dea9eba Bind the themes to the lifecycle of the screen
https://bugzilla.gnome.org/show_bug.cgi?id=683896
2012-09-16 20:20:44 -04:00
William Jon McCann
5debed5ae2 Shut down a11y when an app shuts down
https://bugzilla.gnome.org/show_bug.cgi?id=684076
2012-09-16 19:31:23 -04:00
Colomban Wendling
5b8d67a0aa fontchooserwidget: scroll to the currently selected row
Scroll to the selection when setting it so the selected font is
visible on screen.  This is especially useful if an initial font is
set for the user to see it.

https://bugzilla.gnome.org/show_bug.cgi?id=684156
2012-09-16 19:09:45 -04:00
Ignacio Casal Quinteiro
909873bc6f Load settings.ini also from XDG_CONFIG_DIRS
https://bugzilla.gnome.org/show_bug.cgi?id=683874
2012-09-16 19:04:14 -04:00
Matthias Clasen
e64317f8e1 Add missing argument in GTK_SPINNER_GET_CLASS 2012-09-16 19:02:29 -04:00
Ignacio Casal Quinteiro
f981fb08b3 gtkoverlay: fix get-child-position annotation 2012-09-16 19:03:14 +02:00
Matthias Clasen
01cfe1b595 Plug a leak 2012-09-16 00:49:04 -04:00
Matthias Clasen
78c44d31d3 Small tweaks to the DND docs
As pointed out by Columban Wendling in
https://bugzilla.gnome.org/show_bug.cgi?id=684096,
the GtkWidget DND docs were referring to several drag context
members that are private, nowadays.
2012-09-15 16:17:03 -04:00
Matthias Clasen
98ca019c74 Fix a memory leak in GtkCssStringValue 2012-09-15 16:17:03 -04:00
Benjamin Otte
ea9081ae3b cssimage: Make cross-fades cross-fade properly
We need to use OPERATOR_SOURCE to properly fade out the start image
when the end image contains transparency.
2012-09-14 17:33:02 -04:00
Juan Pablo Ugarte
2064987e31 Added GtkActionGroup:accel-group property.
Fixes bug #671786 "Glade XML files cannot set an ImageMenuItem accelerator key from an Action"
2012-09-14 17:58:51 -03:00
Cosimo Cecchi
52ea721551 togglebutton: always set PRELIGHT state when in_button = TRUE
Previously, we would avoid setting the prelight state flag when
button_down was TRUE and draw_indicator = FALSE, which is the normal
case of a GtkToggleButton during a mouse press.
It looks like this behavior was introduced a long time ago with commit
b94e6c0a80. I believe the reason was that
a widget in GTK2 couldn't have more than a single state (e.g.
hover+active) at a given moment.

https://bugzilla.gnome.org/show_bug.cgi?id=684038
2012-09-14 13:38:15 -04:00
Cosimo Cecchi
f57778e71e stylecontext: fix a StyleData refleak
We were failing to unref the style data in some code paths.

https://bugzilla.gnome.org/show_bug.cgi?id=683627
2012-09-13 17:00:20 -04:00
Matthias Clasen
ba2e43111e Plug a small memory leak 2012-09-13 00:14:16 -04:00
Matthias Clasen
357db76c62 Fix doc comment
The setting was only introduced in 3.6.
2012-09-13 00:10:50 -04:00
Alejandro Piñeiro
5ff328d21f a11y: Solved leak on gtk_widget_accessible_get_description
https://bugzilla.gnome.org/show_bug.cgi?id=643611
2012-09-12 21:15:59 +02:00
Adrian Johnson
dd7e8e9414 Don't rotate pdf landscape output 2012-09-12 15:38:37 +02:00
Stefano Facchini
fb18145c06 box: Fix typo
https://bugzilla.gnome.org/show_bug.cgi?id=683718
2012-09-11 21:40:46 +02:00
Kristian Rietveld
64324a5da0 Implement gtk-primary-button-warps-slider GtkSetting
Make GtkRange honor the setting and implement it in the
quartz backend, it proxies the "click in the scroll bar to"
property from the OS X PrefPane.
2012-09-11 11:19:09 +02:00
Cosimo Cecchi
143a600466 menubutton: clear arrow_widget on remove()
So that we clear its pointer also in case somebody else calls
gtk_container_remove() on the button.
Fixes criticals at startup in e.g. Nautilus.
2012-09-04 09:38:28 -04:00
Cosimo Cecchi
d05191a010 entry: fix requisition width/height to use the current pango layout
This way, we can ensure that width/height changes due to the use of
gtk_entry_set_attributes() are correctly reflected in the size request.

https://bugzilla.gnome.org/show_bug.cgi?id=683168
2012-09-03 11:45:51 -04:00
Paolo Borelli
afd99d3579 Make spinbutton orientable
https://bugzilla.gnome.org/show_bug.cgi?id=683168
2012-09-03 11:45:51 -04:00
Carlos Garnacho
81045779f6 Improve CSS styling of touch text selection handles
Don't hook on the widget style context and set up instead
a widget path for itself. Also use a common style class
for both handles, with an extra top/bottom class for each
handle.
2012-09-03 17:08:02 +02:00
Benjamin Otte
260b587c9c cssvalue: Implement transitioning arrays
Or rather: Implement it for backgrounds, as the animation rules for
arrays vary by property.
2012-09-03 12:54:14 +02:00
Benjamin Otte
e3fc081c5d cssvalue: Pass property ID to transition function
This is to allow animating arrays properly. I'm not really thrilled
about this solution (we leak propertys into the values again...), but
it's the best I can come up with - I prefer it to having N different
array types...
2012-09-03 12:54:14 +02:00
Benjamin Otte
fd7668bfb5 cssvalue: Don't allow empty arrays anymore
CSS arrays aren't empty, even the ones that appear empty contain one
"none" element.
2012-09-03 12:54:14 +02:00
Benjamin Otte
912d5a5c23 cssvalue: Make the array parser no longer parse "none"
Arrays that support it, handle it themselves.
2012-09-03 12:54:14 +02:00
Benjamin Otte
44ba5d253f css: Redo bindings parsing
I want to get away from the ability to have 0-length arrays, all css
arrays are single element.
Even if the element is "none", it is still a "none" element.
2012-09-03 12:54:14 +02:00
Claudio Saavedra
21d0db8254 gtkliststore: fix documentation typo 2012-09-03 11:00:15 +03:00
Matthias Clasen
8c3a668d52 Add a way to test touch features
The GTK_TEST_TOUCHSCREEN envvar is now checked in entries
and textviews to allow testing of text handles with other
kinds of devices.
2012-09-03 00:19:46 -04:00
Carlos Garnacho
5bda3a001d Implement touch text selection in GtkTextView
GtkTextHandle is used to indicate both the cursor position
and the selection bound, dragging the handles will modify
the selection and scroll if necessary.

Backwards text selection is also blocked for touch devices,
so the handles don't get inverted positions and possibly
obscure portions of the selected text.
2012-09-03 00:19:46 -04:00
Carlos Garnacho
d38efb1713 Implement touch text selection in GtkEntry
GtkTextHandle is used to indicate both the cursor position
and the selection bound, dragging the handles will modify
the selection and scroll if necessary.

Backwards text selection is also blocked for touch devices,
so the handles don't get inverted positions (This is more
important though on GtkTextView, as inverted handles may
obscure portions of the selected text, good for consistence
though)
2012-09-03 00:19:46 -04:00
Carlos Garnacho
1f7e375c33 Add GtkTextHandle
This is a helper object to allow text widgets to implement
text selection on touch devices. It allows for both cursor
placement and text selection, displaying draggable handles
on/around the cursor and selection bound positions.

Currently, this is private to GTK+, and only available to
GtkEntry and GtkTextView.
2012-09-03 00:19:03 -04:00
Carlos Garnacho
8c632417c4 scrolledwindow: don't capture events meant for non-child windows
GtkTextHandle creates temporary override redirect windows, but still
hook to the text widget for events, so those are effectively captured
by GtkScrolledWindow if a text widget is within it
2012-09-02 20:30:53 -04:00
Matthias Clasen
95f64a4d4d Revert "menubutton: make it work with custom content in .ui file"
This reverts commit 6e6487b461.
2012-08-31 23:10:30 -04:00