Commit Graph

17623 Commits

Author SHA1 Message Date
Paolo Borelli
5830363787 gtkmenubutton: set menu to NULL in dispose.
Prevent menu to be detached multiple times.
2012-11-04 17:12:14 +01:00
Benjamin Otte
7f870abf17 sizerequest: Restructure code
Make the compute_size_request() function take into account size groups
itself instead of doing a weird "bump_requisition" call.
2012-11-04 16:10:20 +01:00
Benjamin Otte
7501f9770f sizerequest: Move sizegroups function to different source file 2012-11-04 16:02:14 +01:00
Benjamin Otte
8bdff7a564 sizegroup: Construct the set of sizegroup peers as a hash table
This way we don't need a marker on GtkWidgetParivate that needs to be
unset later, so we have all our data in the same place and can avoid
problems with reentrancy and shenanigans like that.

But the main reason I wrote that is cleaner code.
2012-11-04 15:47:03 +01:00
Benjamin Otte
dd6931d1ba sizegroup: Use _gtk_widget_compute_size_for_orientation()
With this function now available, we can do size computation in 2
ways:
(1) Compute size with size groups
(2) Compute size without size groups

And have (1) use (2) instead of setting flags on widgets. This patch
does exactly that.
2012-11-04 15:28:43 +01:00
Benjamin Otte
c3148a81d2 sizerequest: Move optimization
With size groups now doing hfw, doing the optimization for CONSTANT_SIZE
was done too early. Size groups need to know that it's a hfw request, so
the other widgets in the size group get the correct behavior.
2012-11-04 15:28:43 +01:00
Benjamin Otte
aba0c5cc3b label: Redo get_preferred_width/height()
This is important for size groups mostly, but also has some small fixes.
The label-sizing reftest as been updated accordingly.
2012-11-04 15:28:43 +01:00
Benjamin Otte
f55fe7e20b label: Fix ellipsize and wrap being set
The label code assumed that Pango treats this as "wrap to as much space
as possible and then ellipsize all the lines", but for Pango, ellipsize
takes precedence over wrap. So do the same thing in GtkLabel.

Also updated is the reftest that checked this behavior.
2012-11-04 15:28:43 +01:00
Benjamin Otte
02bc589583 sizerequest: Export _gtk_widget_compute_size_for_orientation()
and add an "ignore_size_groups" flag to it. This way we can use it for
size group shenanigans.
2012-11-04 15:24:18 +01:00
Benjamin Otte
1d6e896fef sizegroup: Move GtkSizeGroupMode to gtkenums.h
This is in preparation for the next patch, which would otherwise lead to
conflicts.
2012-11-04 15:24:18 +01:00
Benjamin Otte
62f5414742 sizerequest: Cache sizes without size groups
We compute on-demand for size groups anyway, so we can (in theory, this
patch doesn't do that yet) get around costly cache blowing when
invalidating single widgets of a size group this way.
2012-11-04 15:24:17 +01:00
Benjamin Otte
be1bde9111 sizegroups: Use is_visible() instead of get_mapped() for visibility
The current approach of using gtk_widget_get_mapped() is broken:
The usual steps taken when showing a window are:
(1) request the sizes
(2) allocate the sizes
(3) show the window in the allocated size

Showing the window with a random size between steps (1) and (2) would of
course
result in extra work and potential flickering when the widgets get
resized to
their proper sizes.

However, as GtkSizeGroup::ignore-hidden uses gtk_widget_get_mapped() to
determine visibility for a widget, the following will happen:
(1) the widget will request a 0 size
(2) the widget will be allocated a 0 size
(3) the widget will be too small when it is shown

gtk_widget_get_visible() however is set in advance. Note that toggling
visibility also causes a gtk-widget_queue_resize() call already so we
take care of changes in here automatically.
2012-11-04 15:24:17 +01:00
Benjamin Otte
48ff2fc7ed API: Add gtk_widget_is_visible()
This is a recursive gtk_widget_get_visible(): Returns TRUE if the widget
and all its parents are visible.
2012-11-04 15:24:17 +01:00
Benjamin Otte
9f6067a804 sizegroup: Handle hfw in size groups 2012-11-04 15:24:17 +01:00
Benjamin Otte
c8f2328337 sizegroup: Add a function for clarity
... and restructure code to accomodate that function.
2012-11-04 15:24:17 +01:00
Benjamin Otte
dbbdefe4e0 sizegroup: Don't keep groups around everywhere
The code is only interested in the actual widgets that belong together,
not in the groups. So just don't return the groups.
2012-11-04 15:24:17 +01:00
Benjamin Otte
dfea266e1f sizegroup: Check ignore_hidden flag when adding groups
Instead of only checking the ignore_hidden flag when getting the
preferred sizes, respect it already when constructing the list of
widgets. This way, widgets don't queue resizes for groups they're
ignored in anyway.
2012-11-04 15:24:17 +01:00
Benjamin Otte
a1f6887f17 sizegroup: Use for loops
For loops to loop over lists look nicer and actually do the right thing
with "break" and "continue" statements. So they are vastly preferred to
while loops.
2012-11-04 15:24:17 +01:00
Benjamin Otte
8796fe6d1c sizegroups: Restructure code
This way, we do the checks at the start of the effected function, not
before calling it.
2012-11-04 15:24:16 +01:00
Benjamin Otte
8710d97945 sizegroup: Don't cache the sizes anymore
This simplifies code and because sizes are cached by the widgets
themselves, it's not a large performance problem (unless people use huge
amounts of widgets in a single size group, but who does that?
2012-11-04 15:24:16 +01:00
Federico Mena Quintero
9c6e560819 Merge branch 'bgo687196-filesystemmodel-crash' 2012-11-02 14:13:02 -06:00
Federico Mena Quintero
ea3a750f13 bgo#687196 - Fix model corruption during file removal
The main problem is that we were emitting the row-deleted signal for the model in the middle
of the process that actually deletes the row from the model (remove the row from the array,
update the model->file_lookup hash table, etc.).  In the model's caller, one of the row-deleted
callbacks was requesting an iter, which caused the model to revalidate itself - but it did
this while it was in an inconsistent state.  This led to an assertion failure later when the
model resorted itself.

The fix in remove_file() is like this:

* The filteredness/visibility of the deleted node is not updated.  The
  node will simply be gone; we don't need to update those values at
  all.

* We invalidate just the node that is being deleted.

* The model->file_lookup hash table is not completely nuked; instead,
  we carefully adjust its indices.

* The row-deleted signal is only emitted at the very end, when
  deletion is complete and the model is consistent.

Many thanks to William Hua for doing the detective work on this bug!

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-11-02 14:09:01 -06:00
Federico Mena Quintero
94e3d7faf1 Make freeze_updates() and thaw_updates() static functions
They were in the semi-public API of GtkFileSystemModel, but never actually used outside of it.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-11-01 17:21:47 -06:00
Federico Mena Quintero
1cee5ff0dd Comments on how the filtering and sorting processes work
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-11-01 17:19:10 -06:00
Benjamin Otte
0306278145 sizegroup: Always at least use widget's size
When widgets were hidden, they were otherwise assigned a 0 size.
2012-11-01 20:22:35 +01:00
Benjamin Otte
4067a45aff settings: Reset all styles when the enable-animations settings changes
https://bugzilla.gnome.org/show_bug.cgi?id=686021
2012-11-01 12:27:31 +01:00
Benjamin Otte
625f8a6dd3 Raleigh: Fix spinners with disabled animations
When animations are disabled, active and inactive spinners should look
different.

https://bugzilla.gnome.org/show_bug.cgi?id=686021
2012-11-01 12:27:31 +01:00
Benjamin Otte
0bfbf39306 cssimage: Implement some equal functions 2012-11-01 12:27:31 +01:00
Federico Mena Quintero
f39f574914 Remove argument to _gtk_file_system_model_update_file() that should not be part of the internal API
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-10-31 20:54:02 -06:00
Federico Mena Quintero
281c592ea9 Rename gtk_tree_path_new_from_node() to tree_path_new_from_node()
This is a function internal to the file system model; let's not pollute the gtk_tree_path namespace.

Also, make the 'i' variable into 'r' as it refers to a row index, not a file-array index (for
consistency with the docs and the rest of the code).

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2012-10-31 20:21:47 -06:00
Cosimo Cecchi
86ecf54139 icon-theme: support loading symbolic GFileIcons from generic URIs
Right now we support loading and recoloring symbolic GFileIcons, but
only if the underlying GFile has a local path. This breaks when the
GFileIcon is loaded from a GResource, which is a reasonable option for an
application that wants to ship a custom symbolic icon.

This patch changes GtkIconInfo to store a GFile together with the file
path, and changes the symbolic icon lookup code to use the GFile URI,
which transparently makes the code work also for GResources.

https://bugzilla.gnome.org/show_bug.cgi?id=687059
2012-10-31 11:53:50 -04: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
fd73c1f8d9 themingengine: Draw fradctional border sizes 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
Benjamin Otte
016647edb1 cssimage: Add a warning for drawing empty images
width and height of an image must be > 0 for the image to get drawn.
It's up to the code further up to ensure that this is not happening.
2012-10-31 11:09:10 +01:00
Benjamin Otte
67302c5ee0 cssvalue: Compute "background-size: 0 0" properly
Previously a computed value of 0 was treated as "auto", which is wrong.
2012-10-31 11:09:10 +01:00
Benjamin Otte
16677bb85a stylecontext: Don't use bg image in gtk_style_context_set_background()
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.
2012-10-31 11:09:10 +01:00
Benjamin Otte
c13efbf8b0 cssimage: Add an equal vfunc
No implementations for it exist yet.
2012-10-31 11:09:10 +01:00
Benjamin Otte
73fe9a2acf menuitem: Draw background unconditionally 2012-10-31 11:09:10 +01:00
Benjamin Otte
b1ad5c8abc settings: Use _gtk_css_provider_load_named()
This way we create one provider per settings object instead of stuffing
it into a global unchanging never-deleting hash table.
Also, we now reload the theme when instructed instead of keeping the old
loaded (and possibly stale) data forever.

https://bugzilla.gnome.org/show_bug.cgi?id=683896
2012-10-31 11:09:10 +01:00
Benjamin Otte
b41215bdea cssprovider: Move fallback code into _gtk_css_provider_load_named()
This makes sure the full theme loading logic resides in one function and
isn't scattered around.

As a side-effect, the hash table kept by gtk_css_provider_get_named()
will now be populated with fallback themes. This will not be a problem
after the next commit though.
2012-10-31 11:09:09 +01:00
Benjamin Otte
738b453c66 cssprovider: Export gtk_css_provider_load_named) function
... and document it.
For now, the function is only exported internally.
2012-10-31 11:09:09 +01:00
Benjamin Otte
9c9d82f1a9 cssprovider: Split out theme loading function
Split maintaining the global themes hash table and the theme loading
code into two functions.
This also fixes leaking the provider when loading a theme from a builtin
resource.
2012-10-31 11:09:09 +01:00
Hib Eris
99e194e7cc Fix compiling for win32
https://bugzilla.gnome.org/show_bug.cgi?id=687066
2012-10-29 09:36:41 +01:00
Carlos Garnacho
63c75a2384 texthandles: Add an extra style class to the cursor-mode handle
Themes may want to render handles differently depending on whether
the widget is in selection mode (2 handles enclosing a selection) or
cursor mode (one handle pointing out the insertion cursor).
2012-10-26 18:38:38 +02:00
Carlos Garnacho
0eb09ac0f2 texthandles: set input shape on handles' window
This improves both interaction and theming, as it allows
arbitrary handle shapes while just being draggable from
the visible areas.

This way themes can set up handles with the hotspot visually
displaced from the horizontal center, as long as the hotspot
lies centered in the image/svg asset.
2012-10-26 18:35:24 +02:00
Carlos Garnacho
f6952ceb82 texthandle: Fix shape setup on non-composited environments
The check on the handle to be drawn on the mask was based on the yet to
be set priv->windows pointers, pass explicitly the handle position to
have the shape correctly initialized on non-composited environments
2012-10-26 17:46:40 +02:00
Matthias Clasen
bec6b260b4 Be robust against unrealized windows in GtkWindowAccessible
Based on a patch by Albert Astals Cid,
https://bugzilla.gnome.org/show_bug.cgi?id=686152
2012-10-22 19:42:41 -04:00
Matthias Clasen
c51157d437 Forgotten fixup
This was meant to be included in the previous commit :-(
2012-10-22 19:41:14 -04:00
Stefano Facchini
4e42bd055d treeview: Add support for styling the dragged header
https://bugzilla.gnome.org/show_bug.cgi?id=684980
2012-10-22 19:05:00 -04:00
Stefano Facchini
f67273c579 treeview: Move the dragged header in the headers window
https://bugzilla.gnome.org/show_bug.cgi?id=684980
2012-10-22 19:04:12 -04:00
Matthias Clasen
5a497e9fb8 Use named union for _GtkSymbolicColor in gtk/gtksymboliccolor.c
Patch by Richard Lloyd,
https://bugzilla.gnome.org/show_bug.cgi?id=686366
2012-10-22 18:59:42 -04:00
Cosimo Cecchi
288ed1f920 scrollbar: remove unused variable
My bad.
2012-10-22 18:41:00 -04:00
Cosimo Cecchi
852d4d618c notebook: return TRUE for drag-motion event when over tabs
The GtkNotebook drag-motion event handler may install a timeout when
hovering over a tab, in order to switch to it.
On the other hand it's desirable for applications to use the empty tab
area as a drop target, so the drag-motion handler returns FALSE
(also in case it installs the switch tab timeout), as explained in
https://bugzilla.gnome.org/show_bug.cgi?id=350665.

Unfortunately, applications can use the tab label widget (or a child
of it) as a different drop target area, and install their own
drag-motion handler there.
In this scenario, the timeout will still be installed by GtkNotebook's
handler, but since it returns FALSE, it will never get the matching
drag-leave event, causing it to trigger also when the mouse pointer
moved elsewhere before it expired.

Fix this by returning TRUE from drag-motion when the event is over a
tab. Note that this makes automatic tab switching not work anymore when
drag and drop is handled in the tab label widget; applications are
expected to also handle tab switching if desired in such a case.

https://bugzilla.gnome.org/show_bug.cgi?id=684415
2012-10-22 18:39:37 -04:00
Cosimo Cecchi
42da600eb1 notebook: consolidate code to remove the switch tab timer
https://bugzilla.gnome.org/show_bug.cgi?id=684415
2012-10-22 18:37:47 -04:00
Cosimo Cecchi
ad22a1faf6 scale: update style properties on GtkRange at init
Same fix as in ef027c93d4, but for
the GtkScale subclass of GtkRange.

https://bugzilla.gnome.org/show_bug.cgi?id=686280
2012-10-22 13:13:11 -04:00
Cosimo Cecchi
ef027c93d4 scrollbar: update style properties on GtkRange at init
GtkScrollbar used to rely on style-updated being emitted every time
after the widget was created in order to set the right values from its
style properties on GtkRange.
Nowadays we try to be smarter and avoid emitting style-updated at
creation time, so we need to manually initialize the GtkRange values.

This fixes a regression from 35e36b9fe5.

https://bugzilla.gnome.org/show_bug.cgi?id=686280
2012-10-22 11:48:04 -04:00
Matthias Clasen
eda0d9ba10 Fix duplicate columns in filechooser entry completion
This partically reverts commit
331bba1ad6, which broke documented
behaviour.
2012-10-17 21:27:26 -04:00
Cosimo Cecchi
15fe3038be menubutton: don't refer to the non-existant menu property
7c6454246e removed the property, but
forgot to change the name in a g_object_notify().
2012-10-17 17:05:22 -04:00
Stefano Facchini
fa2ed6b8a2 level-bar: Fix typo 2012-10-17 16:09:22 +02:00
Cosimo Cecchi
4c9db15212 scrolledwindow: set GDK_EXPOSURE_MASK on the overshoot window
Currently we use gtk_style_context_set_background() when the state flags
change in order to propagate the background color to the overshoot
window, but this is actually only needed because the window doesn't get
expose events, since we always draw a full background in draw().
This also fixes some problems when the GdkWindow of the scrolled
window's child is composited, as seen in oxygen-gtk3.

https://bugzilla.gnome.org/show_bug.cgi?id=686265
2012-10-17 09:56:49 -04:00
Stefano Facchini
5e55bf1d53 level-bar: add support for RTL locales
https://bugzilla.gnome.org/show_bug.cgi?id=684288
2012-10-17 14:12:57 +02:00
Stefano Facchini
e5de18cbf9 level-bar: add an "inverted" property like GtkProgressBar
https://bugzilla.gnome.org/show_bug.cgi?id=684288
2012-10-17 14:12:57 +02:00
Ignacio Casal Quinteiro
7c6454246e GtkMenuButton: remove menu property as it is replaced by popup.
See that it was already announced to be removed before 3.6.0
but we forgot.
2012-10-17 14:07:31 +02:00
Cosimo Cecchi
a021b72c71 cssshadowsvalue: handle gtk_css_value_transition returning NULL
The implementation of transition for GtkCssShadowValue can return NULL
at least when the two values have a different inset; all other parts of
the GTK/CSS machinery (e.g. GtkCssArrayValue) handle this by returning
NULL too. Instead, GtkCssShadowsValue was returning an invalid value,
where "len" was set, but some values in the array were NULL, which would
lead to a segfault when this value is later evaluated by the compute
function.

Fix this by making GtkCssShadowsValue return NULL if a shadow transition
fails, like GtkCssArrayValue does.

https://bugzilla.gnome.org/show_bug.cgi?id=686013
2012-10-16 14:22:24 -04:00
Cosimo Cecchi
17760bd2eb cssshadow: plug a cairo_surface_t leak
We were never destroying the cairo surface we use for blurring, which
would lead to a huge leak.

https://bugzilla.gnome.org/show_bug.cgi?id=686209
2012-10-16 13:07:51 -04:00
Cosimo Cecchi
97f49c681b csskeyframes: unref GtkCssValues when free-ing
We assume a reference to all the GtkCssValues we store, so we need to
release it when free-ing.
2012-10-16 13:07:51 -04:00
Cosimo Cecchi
6fb66261ca gradient: plug a GtkCssValue refleak
Since _gtk_symbolic_color_resolve_full() returns a reference to a
GtkCssValue.
2012-10-16 13:07:51 -04:00
Cosimo Cecchi
3b7e390484 csscomputedvalues: plug a refleak
_gtk_css_keyframes_compute() returns a reference to a GtkCssKeyframes,
and _gtk_css_animation_new() takes another reference.
2012-10-16 13:07:50 -04:00
Matthias Clasen
4e09e180e4 Fix css parser tests
Parsing a shorthand background property was running into unexpected
errors when trying position values where there were none. To fix this,
introduce a try_parse variant of the position parse function that
silently returns NULL.
2012-10-16 06:02:03 -04:00
Matthias Clasen
f9dae1d526 Fix 'make check' 2012-10-16 06:02:03 -04:00
Cosimo Cecchi
84922d3317 appchooserwidget: check for g_app_info_should_show()
This ensures NoDisplay=true or NotShowIn/OnlyShowIn values in the
desktop file are respected.
2012-10-15 18:45:49 -04:00
Cosimo Cecchi
9208588771 a11y: fix private strict regression
Commit 0bbfcc2491 added a private struct
for GtkImageAccessible, but forgot to call g_type_class_add_private().
2012-10-15 17:09:04 -04:00
Cosimo Cecchi
10ead8a9d7 a11y: fix the build
Fix a typo introduced in 0ad379708f
2012-10-15 11:32:56 -04:00
Matthias Clasen
5465d89380 Add private structs to all remaining headers
These are not used currently. Just put them in now in
case we need them in the future.
2012-10-15 06:25:01 -04:00
Matthias Clasen
d83294d313 GtkWidgetAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
This also required removing access to GtkWidgetAccessible innards
from several accessible implementations.
2012-10-15 06:04:11 -04:00
Matthias Clasen
19fc090354 GtkTreeViewAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-15 05:56:41 -04:00
Matthias Clasen
dad727d41c GtkToplevelAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
This also required removing access to GtkToplevelAccessible innards
from the GtkWindowAccessible implementation.
2012-10-15 05:52:04 -04:00
Matthias Clasen
f1594c39be GtkTextViewAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-15 05:31:09 -04:00
Matthias Clasen
d13b70f779 GtkTextCellAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 21:21:34 -04:00
Matthias Clasen
8b667e006a GtkRendererCellAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
This also required removing access to GtkRendererCellAccessible innards
from various cell accessible implementations.
2012-10-14 21:07:46 -04:00
Matthias Clasen
06542b2b59 GtkRadioMenuItemAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 20:48:30 -04:00
Matthias Clasen
8b6e962811 GtkRadioButtonAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 20:18:57 -04:00
Matthias Clasen
0ea0293356 GtkNotebookPageAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 20:15:28 -04:00
Matthias Clasen
c86628b41e GtkNotebookAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 20:09:58 -04:00
Matthias Clasen
f44c9dff3d GtkMenuItemAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 20:01:37 -04:00
Matthias Clasen
9a41636988 GtkLinkButtonAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 19:55:59 -04:00
Matthias Clasen
b8e4543ff3 GtkLabelAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 19:51:14 -04:00
Matthias Clasen
1ea3979864 GtkImageCellAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 19:43:47 -04:00
Matthias Clasen
0bbfcc2491 GtkImageAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 19:38:08 -04:00
Matthias Clasen
538c241951 GtkIconViewAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 16:06:08 -04:00
Matthias Clasen
4745adaeff GtkEntryAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 15:59:58 -04:00
Matthias Clasen
0ad379708f GtkContainerCellAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
This also required removing access to GtkContainerCellAccessible
innards from the GtkCellAccessible implementation.
2012-10-14 15:56:51 -04:00
Matthias Clasen
978f336aa4 GtkContainerAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
This also required removing access to GtkContainerAccessible innards
from the GtkMenuItemAccessible implementation.
2012-10-14 15:56:46 -04:00
Stefano Facchini
95f3fadcbd Remove leftover from commit 7264a996fe 2012-10-14 11:57:58 +02:00
Matthias Clasen
1dc4d2c621 GtkComboBoxAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 02:47:22 -04:00
Matthias Clasen
5226327e11 GtkBooleanCellAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 02:40:20 -04:00
Matthias Clasen
7264a996fe GtkArrowAccessible: add a private struct
Move instance fields to a private struct, in preparation
for installing a11y headers.
2012-10-14 02:39:32 -04:00
Benjamin Otte
a81ccff4f5 cssvalue: Print an error when failing to parse background-position
... in the case where a completely invalid value was used.
2012-10-12 17:45:45 +02:00
Cosimo Cecchi
a5ddbaf1f8 toolbar: don't forget to set orientable style classes
So that themes can select for vertical toolbars.
2012-10-10 11:37:16 -04:00
Benjamin Otte
588ee411ad cssimage: Fix gradient start/end computation
This computation is only supposed to happen for repeating gradients, not
for all of them.
2012-10-06 15:56:08 -04:00
Benjamin Otte
b454fc50ed animations: Start transitions from the current value
... instead of from the intrinsic value. This way, we respect running
animations.

Note that the concept of "reversing" transitions is not implemented yet.
2012-10-06 15:55:53 -04:00
Benjamin Otte
55ade04e11 animations: Don't set animated values for finished transitions
Otherwise, that value will never get reset and remain frozen in time.
This is problematic for example when the value is inherited and the
parent changes the value.
2012-10-06 15:55:31 -04:00
Cosimo Cecchi
1a1361c4b3 scrolledwindow: fix wrong allocation of padding and borders
When positioning the scrollbar we were doing several miscalculations
when accounting for CSS paddings and borders. This also fixes a number
of problems with RTL and when scrollbars-within-bevel is FALSE.

https://bugzilla.gnome.org/show_bug.cgi?id=685449
2012-10-04 09:19:30 -04:00
Benjamin Otte
1037398041 gtk/tests: Fix for -Wmissing-declarations
I'm adding a bunch of fixes for gcc complaining about
-Wmissing-declarations after finding a bunch of cases today where I
had forgotten to make functions static in the CSS code.

This patch fixes the tests in gtk/tests.

After this last patch, the gtk/ subdir should now compile without
warnings when this flag is enabled.
2012-10-02 19:32:53 +02:00
Benjamin Otte
03f5ff20de cssimage: Add transition code for linear-gradient()
This ensures feature-parity with the CSS spec and the -gtk-gradient()
notation.
2012-10-02 19:32:52 +02:00
Benjamin Otte
dd99577691 gtk: Put private functions in headers and include those
This is part of a bunch of fixes for gcc complaining about
-Wmissing-declarations.

It puts functions into headers and includes those headers both where the
functions are defined and where they function are used.
2012-10-02 19:32:52 +02:00
Benjamin Otte
101c6a05a9 gtk: Move gtk_menu_is_empty() function to only user
The function was private and only used by gtkmenuitem.c.

Part of a bunch of fixes for gcc complaining about
-Wmissing-declarations.
2012-10-02 19:32:51 +02:00
Benjamin Otte
12683da8f7 gtk: Make functions static that don't need to be non-static
Also remove the starting underscore from function names where
appropriate, as those functions are static now and not exported anymore.

This is part of a bunch of fixes for gcc complaining about
-Wmissing-declarations.
2012-10-02 19:32:51 +02:00
Benjamin Otte
48c6b3b4f4 gtk: Add get_type() function declarations for private objects
I'm adding a bunch of fixes for gcc complaining about
-Wmissing-declarations.

This set of patches makes private classes in gtk/*.c that use
G_DEFINE_TYPE() safe by adding definitions for the get_type() function
that can't be made static.
2012-10-02 19:32:38 +02:00
Benjamin Otte
9e486139ca a11y: Fix for -Wmissing-declarations
I'll add a bunch of fixes for gcc complaining about
-Wmissing-declarations after finding a bunch of cases today where I had
forgotten to make functions static in the CSS code.

A thorn in those patches is G_DEFINE_TYPE() which doesn't allow making
the get_type() function static, so I added definitions for that function
above the G_DEFINE_TYPE().

After those patches, GTK should compile without warnings when this flag
is enabled.
2012-10-02 19:32:38 +02:00
Benjamin Otte
eddac4911f tests: Remove gdk-pixbuf hacks
The code used to check for uninstalled gdk-pixbuf. Since gdk-pixbuf is
an external library these days, those checks aren't necessary anymore.
2012-10-02 19:32:37 +02:00
Rui Matos
1b5dabac8b window: Delay showing auto mnemonics on focus in
Just as in ed7a417dcb we don't want to
show auto mnemonics immediately but only after a short delay. In
particular this allows to capture screenshots without visible
mnemonics.

https://bugzilla.gnome.org/show_bug.cgi?id=684517
2012-10-02 16:41:40 +02:00
Tristan Van Berkom
8705c59f8c Amended documentation for gtk_widget_set_size_request().
It seems we missed updating this since GTK+3, widgets cannot be
allocated less than the size they requested in thier request
phase, and explicit sizes are used only to grow the size request.
2012-10-02 23:11:39 +09:00
Benjamin Otte
4f6a55d689 cssimage: Implement proper cross-fades for gradients
This is intended mainly to speed up the current situation with spinners
on debug kernels. Because we now don't use a cross-fade to draw the
transition but instead have a real gradient that we draw, we don't need
to use the slow cross-fade code.

https://bugzilla.gnome.org/show_bug.cgi?id=684639
2012-10-02 14:16:37 +02:00
Benjamin Otte
046d004725 gradient: Add a private header file 2012-10-02 14:16:36 +02:00
Benjamin Otte
a67bf5fde4 cssimage: Only create fades if we are actually fading 2012-10-02 14:16:36 +02:00
Benjamin Otte
558ffc24c2 cssimage: Make image transition a vfunc 2012-10-02 14:16:36 +02:00
Benjamin Otte
25271fe781 css: Move special case code for border widths
We need to store the border widths independant of them being set to 0 by
border styles, because otherwise we'd need to track that dependency and
recompute on changes, and I don't want to add more entries to
GtkCssDependencies just for this special case.

By moving the code that does the setting to 0 from the compute stage to
the query stage, we can achieve this.

Now we need to just be aware that the actual value stored is not set to
0 when we use gtk_css_computed_values_get_value().
2012-10-02 14:16:35 +02:00
Matthias Clasen
307a1dc638 Trivial typo fix 2012-10-01 22:12:06 -04:00
Benjamin Otte
1e0fe40560 widget: Move style context update out of vfunc
Otherwise the evil widgets that don't chain up their map and unmap
vfuncs will not get updated style contexts. This is in particular true
for GtkWindow and the CSS Theming / animated backgrounds demo in
gtk-demo.
2012-10-01 15:53:17 +02:00
Benjamin Otte
4943cc4c12 stylecontext: Actually use superset matcher
... when looking up the needed changes.

This is what that matcher was actually written for, but it seems I never
hooked it in.
2012-10-01 14:23:15 +02:00
Benjamin Otte
a31d5379a0 css: Add forgotten enum value
This broke compilation in a7d2138544.
2012-10-01 13:11:11 +02:00
Benjamin Otte
9138fc11cf cssanimation: Don't store the end value in a CSS transition
Instead, query the intrinsic value at runtime.
2012-10-01 13:09:49 +02:00
Benjamin Otte
a7d2138544 treeview: Invalidate children properly
GtkTreeView still uses regions (yay!), so we need to invalidate the
regions when hiding/showing children, and not their siblings.
2012-10-01 11:54:18 +02:00
Benjamin Otte
f1ad9051bd treeview: Fix computing child paths
We were adding the GtkButton class twice.
2012-10-01 11:48:50 +02:00
Benjamin Otte
2f89505b54 csscomputedvalues: Unset the section when setting a new value
Otherwise we end up with the wrong section if no new one is specified.
2012-10-01 10:32:59 +02:00
Cosimo Cecchi
a2bef8ca51 symboliccolor: fix a critical warning
This was introduced in 0cc32eae62
2012-09-28 12:49:22 -04:00
Benjamin Otte
1454ba15ba css: Huge refactoring to avoid computing wrong values
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.
2012-09-28 18:27:49 +02:00
Benjamin Otte
0cc32eae62 symboliccolor: Change prototype of _gtk_symbolic_color_resolve_full()
We can juts pass a GtkStyleProviderPrivate, that one has the vfunc we
want already. So no need to pass vfuncs anymore.
2012-09-28 18:27:49 +02:00
Benjamin Otte
448cdb0737 css: Move declaration
... for future changes. This is just to check that compilation still
succeeds.
2012-09-28 18:27:49 +02:00
Benjamin Otte
e2ec13c5d2 cssvalue: Remove unnecessary include 2012-09-28 18:27:49 +02:00
Benjamin Otte
5c4fc16cd4 css: Don't crash when printing gradients
... in the fallback code. Instead print a FIXME.
2012-09-28 18:27:49 +02:00
Benjamin Otte
94c0c1542b cssvalue: Don't crash when printing NULL strings
A NULL string should be printed as "none".
2012-09-28 18:27:49 +02:00
Benjamin Otte
5e1ae36b2f section: Add _gtk_css_section_to_string()
Mostly for debugging pruposes, but use it for printing CSS errors in
GtkCssProvider, too.
2012-09-28 18:27:49 +02:00
Benjamin Otte
fbb4c61665 stylecontext: Rebuild cached styles with correct classes/regions
Previously, we were using the default classes and regions. That's
obviously wrong.
2012-09-28 18:27:48 +02:00
Alexander Larsson
ecd84fac48 iconview: Render focus even in non-selected items
This is needed for the SELECTION_NONE mode where nothing is ever
selected, but its also needed for CTRL-<key> keynav that moves the
focus without changing the selection.

https://bugzilla.gnome.org/show_bug.cgi?id=684984
2012-09-27 19:43:50 +02:00
Stefano Facchini
3c7a6581dc treeview: fix size of the dragged column header
Currently the GdkWindow used for dragging is created once when
the first drag starts, and the reused identical each time.
Instead, just recreate it for each drag, with the correct size.
2012-09-27 17:09:55 +02:00
Alexander Larsson
f9d77959a4 Don't create GdkWindows with NULL parents
This is not multi-display safe, you always need to pick the right
parent based on which screen your widget is at.
2012-09-27 13:46:26 +02:00
Matthias Clasen
4b5db54fa7 Remove gtk_menu_button_[sg]et_menu
These functions were never in a stable release, and have
been renamed to gtk_menu_button_[sg]et_popup.
2012-09-24 00:08:30 -04:00
Matthias Clasen
0b11e08f87 Straigthen includes in gtkmenubutton.[hc]
Don't include gtk.h, but just include whats needed.
2012-09-24 00:01:39 -04:00
Matthias Clasen
31698e718c Fix the build 2012-09-23 23:57:34 -04:00
Matthias Clasen
f9ed513361 Add a missing GDK_AVAILABLE_IN annotation 2012-09-23 23:38:04 -04:00
Matthias Clasen
563a874f0f Typo fix 2012-09-23 23:37:46 -04:00
Matthias Clasen
cfb6da9b55 Document gtk_application_get_window_by_id 2012-09-23 21:15:27 -04:00
Matthias Clasen
1bfa58951c Remove empty doc comments
These confuse gtk-doc. All these functions are documented
in gtkclipboard.c
2012-09-23 21:14:46 -04:00
Matthias Clasen
d03ceb8b2c GtkMenuButton: improve rtl support
Show the menu at the side the arrow points to,
also in rtl locales.
https://bugzilla.gnome.org/show_bug.cgi?id=684606
2012-09-21 23:53:11 -04:00
Matthias Clasen
72d8deb606 GtkSearchEntry: add rtl support
Flip the clear icon in rtl locales.
https://bugzilla.gnome.org/show_bug.cgi?id=684607
2012-09-21 23:41:28 -04:00
Benjamin Otte
cca8cd2b21 Revert "blur: Use recording surface for capturing things to blur"
This reverts commit f2cb8f1270.

The patch actually didn't work for at least text. I currently have no
clue why, but I suspect it requires investigating Cairo code and
recording surfaces, and I'll not do that right now.
2012-09-21 18:51:46 +02:00
Pavel Vasin
71d2b68da0 GtkMenuItem: fix leaked action_helper 2012-09-20 15:17:20 -04:00
Ryan Lortie
85700627aa gtkapplication: fix some crashing "leak fixes"
https://bugzilla.gnome.org/show_bug.cgi?id=684258
2012-09-20 14:22:52 -04:00
Ignacio Casal Quinteiro
d39977878e colobutton: skip set_rgba as it is already in the choosercolor interface 2012-09-20 12:51:10 +02:00
Benjamin Otte
f2cb8f1270 blur: Use recording surface for capturing things to blur
This gets around clipping issues quite nicely and provides us with a
(mostly theoretical) performance boost.
2012-09-20 02:45:42 +02:00
Andrea Cimitan
3377271ef0 shadow: add blur to icon-shadow (spinner) 2012-09-20 02:45:42 +02:00
Andrea Cimitan
10e2684870 shadow: add blur to icon-shadow (icon) 2012-09-20 02:45:42 +02:00
Andrea Cimitan
7c3864ba79 shadow: add blur to box-shadow 2012-09-20 02:45:42 +02:00
Andrea Cimitan
59eb3ef30e shadow: add blur to text-shadow 2012-09-20 02:45:41 +02:00
Cosimo Cecchi
b609686133 shadow: add code to render blurred shadows
Split out the blurred shadow rendering in three steps:
- creation of a surface of the appropriate size - we use the clip
  rectangle as a good measurement for the size, since we won't render
  out of it anyway
- painting the unblurred shape on the surface - this is responsibility
  of the single shadow implementations
- blur the surface and compose the result back on the original cairo_t

This means we can share code between the implementations for the first
and third steps; it also makes the code independent of the rendered
size, so we can avoid passing down a cairo_rectangle_t with e.g. the
icon coordinates.
2012-09-20 02:45:41 +02:00
Benjamin Otte
a239f2e8b0 blur: Do the same thing for rows and cols 2012-09-20 02:45:41 +02:00
Benjamin Otte
502a2bf625 blur: Use rowstride 2012-09-20 02:45:41 +02:00
Benjamin Otte
65ba8901aa blur: Simplify code
It's always the same code, so there's no need for switch statements.
2012-09-20 02:45:41 +02:00
Benjamin Otte
267d1793c6 blur: Fix pixel sizes
The code accesses pixels in a chunks of 4 bytes, so we must only support
formats where the size of a single pixel is 4 bytes.
Fix RGB24 to be 4 bytes (the alpha channel is ignored) and disallow A8.
2012-09-20 02:45:41 +02:00
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