Commit Graph

17499 Commits

Author SHA1 Message Date
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