Commit Graph

29720 Commits

Author SHA1 Message Date
Cosimo Cecchi
d80ff7b5f1 stylecontext: always add the ARROW style class when rendering an arrow
When gtk_render_arrow() is called, always add an ARROW style class to
the GtkStyleContext before rendering, so themes can specify a different
color for it.

https://bugzilla.gnome.org/show_bug.cgi?id=665420
2011-12-05 09:37:21 -05:00
Cosimo Cecchi
c538fb8f64 stylecontext: add GTK_STYLE_CLASS_ARROW
For e.g. submenu items arrow in GtkMenuItems.

https://bugzilla.gnome.org/show_bug.cgi?id=665420
2011-12-05 09:30:57 -05:00
Cosimo Cecchi
2e01dc1b7a statusicon: port to GtkIconHelper
Just always render the pixbuf ourselves and set it on the GtkImage in
the X11 case.
Code for other backends was already rendering the pixbuf manually before
translating it into a native type, so this greatly simplifies the code.

https://bugzilla.gnome.org/show_bug.cgi?id=665409
2011-12-05 09:09:43 -05:00
Alexander Larsson
c47ef89aca Merge branch 'transparent-windows' 2011-12-05 14:24:28 +01:00
Alexander Larsson
93c086ec80 Make window handle transparent
Instead of painting the window background on the grip_window we now
only paint it on the GtkWindow->window, and we make the grip_window
have a transparent background.

We can't really make transparent window handle background optional
via css atm, because the handle color is actually based on the
background color, so if that is set to transparent we won't draw
anything.
2011-12-05 12:51:55 +01:00
Alexander Larsson
4597f1ea6a gdk: gdk_window_get_update_area don't remove alpha covered areas
gdk_window_get_update_area is supposed to get the area where things
need painting, and remove them from the update areas. However, if
some area is covered by other windows with an alpha background we
can't just expect whatever the app choses to render in the update
area as correct, so we don't actually remove these areas, meaning
they will get correctly rendered when we get to the expose handlers.
2011-12-05 12:18:22 +01:00
Alexander Larsson
65ef15812b gdk: gdk_window_move_region
gdk_window_move_region doesn't move children, so we can't copy
transparent child window regions with copyarea, so we remove these
from the copy region.
2011-12-05 12:16:55 +01:00
Alexander Larsson
76ea768316 gdk: Fix alpha window background paintings on non-implicit paints 2011-12-05 11:40:30 +01:00
Alexander Larsson
68843a3e93 gdk: Remove unused _gdk_window_calculate_full_clip_region 2011-12-05 10:59:07 +01:00
Alexander Larsson
f00cfe1fac Handle has_alpha_background for parent-relative backgrounds 2011-12-05 10:55:55 +01:00
Cosimo Cecchi
2bf765ab49 entry: avoid a mismatched cairo_save/restore
Leftover from GtkIconHelper migration.
2011-12-04 19:58:28 -05:00
Paolo Borelli
5a471fefdb Remove unused alignment from GtkTooltip. 2011-12-04 19:20:23 +01:00
Paolo Borelli
7c779a0bee Plug tiny leak in the css parser 2011-12-03 17:52:24 +01:00
Kristian Høgsberg
0dd1f7edbc wayland: Update to recent API changes 2011-12-02 05:41:43 -05:00
Claudio Saavedra
f9c24e8f03 GtkIconView: fix a memory corruption in the drag-n-drop code
You shall free with g_slice_free() what you allocate with
g_slice_new().

https://bugzilla.gnome.org/show_bug.cgi?id=665338
2011-12-01 22:56:43 +01:00
Alexander Larsson
7a263c68a0 gdk: Fix repaint of layered region during move_region 2011-12-01 22:08:00 +01:00
Alexander Larsson
8e28f53a1d gdk: Fix repaint of layered region during scroll 2011-12-01 22:08:00 +01:00
Alexander Larsson
f0c8c4a94b gdk: Fix repaint of layered region during raise 2011-12-01 22:07:59 +01:00
Alexander Larsson
0f6784a919 gdk: Make sure we don't copy to/from layered regions when moving a window 2011-12-01 22:07:59 +01:00
Alexander Larsson
46d5b89830 gdk: Track the layered area
We track the areas that have alpha coverage so that we can
avoid using these as sources when copying window contents.
We also don't remove such areas from the clipping regions so
that they are painted both by parent and child.
2011-12-01 22:06:44 +01:00
Alexander Larsson
f51482e283 gdk: Track wether windows have alpha in the background
This will let us handle such windows differently in the
drawing machinery
2011-12-01 22:03:51 +01:00
Alexander Larsson
30ad4e676f testwindows: Add a button to cause a repaint
This makes it easy to find various kinds of repaint bugs
2011-12-01 22:03:51 +01:00
Alexander Larsson
9613e6ae19 testwindows: Test transparent backgrounds 2011-12-01 22:03:51 +01:00
Alexander Larsson
7fd225c766 gdk: Expose bottommost windows first
This cleans up the expose handling a bit by using the existing
clip regions, and it allows us later to use painters algorithm
to do transparent windows.
2011-12-01 13:42:09 +01:00
Alexander Larsson
45df163e9d gdk: Remove now unused region tags completely 2011-12-01 13:38:04 +01:00
Cosimo Cecchi
58b1f24d6d image: use the default icon size if no icon size is provided
If no icon size is provided (e.g. when setting icon-name or stock-id
using the GObject property directly), use the default icon size. This
matches the previous GtkImage behavior.
2011-11-30 19:47:52 -05:00
Cosimo Cecchi
0c68227270 image: minor cleanup 2011-11-30 19:47:52 -05:00
Paolo Borelli
2ef5844bac Introduce gtk_render_insertion_cursor
The new function provides an API that takes the PangoLayout and index
as input params, this way it handles strong and weak cursors internally
factoring out all code duplicated in the widgets that need to render
cursors.

https://bugzilla.gnome.org/show_bug.cgi?id=640317
2011-12-01 01:22:39 +01:00
Paolo Borelli
3c6842222a Use the split-cursor setting for textview cursors
Explicitely check the split-cursor setting when drawing the textview
insertion cursor instead of relying on the cursor_direction set in the
textlayout. This makes the cursor drawin code more uniform with other
widgets in preparation to refactoring the cursor drawing code in a
shared function.

https://bugzilla.gnome.org/show_bug.cgi?id=640317
2011-12-01 01:22:39 +01:00
Paolo Borelli
0bff1af7a2 Rework GtkTextView cursor code.
Move the handling of primary/secondary cursors to gtktextdisplay, which
makes code simpler and more consistent to how GtkLabel and GtkEntry
draw cursors, which is useful in preparation to further refactoring.

https://bugzilla.gnome.org/show_bug.cgi?id=640317
2011-12-01 01:22:39 +01:00
Paolo Borelli
b3f850e6b9 Tiny cleanup.
https://bugzilla.gnome.org/show_bug.cgi?id=640317
2011-12-01 01:22:38 +01:00
Paolo Borelli
f18bbdff53 Remove draw_insertion_cursor in label and entry
Remove the the draw_insertion_cursor wrapper which just converts from
GtkTextDir to PangoDirection

https://bugzilla.gnome.org/show_bug.cgi?id=640317
2011-12-01 01:22:38 +01:00
Cosimo Cecchi
772459979f image: simplify code
We can unconditionally call into the icon helper methods now that we
removed the g_return_val_if_fail() checks.
2011-11-30 19:06:38 -05:00
Cosimo Cecchi
d47e82ffdd entry: simplify code
We can unconditionally call into the icon helper methods now that we
removed the g_return_val_if_fail() checks.
2011-11-30 19:05:34 -05:00
Cosimo Cecchi
864c5610f8 icon-helper: remove useless checks
When we change storage type, we always clear the rest of the object, so
these checks do not add any safety.
2011-11-30 19:04:17 -05:00
Cosimo Cecchi
d300ddc5e4 icon-helper: don't warn out when the icon size is GTK_ICON_SIZE_INVALID
We can call ensure_icon_size() for an empty image; don't warn out in
that case, but just return a zero width.
2011-11-30 18:32:01 -05:00
Cosimo Cecchi
e37c55aa3e icon-helper: don't reset pixel_size when clearing the helper
Don't reset the pixel size when clearing the helper; pixel-size is e.g a
property of GtkImage, which is stable unless explicitly set.
2011-11-30 18:15:05 -05:00
Cosimo Cecchi
5224302a30 entry: always prepare the style context when using it for entry icons
Make sure to always prepare the entry's style context for the entry icon
style when passing it to GtkIconHelper.
2011-11-30 16:39:59 -05:00
Cosimo Cecchi
126651f889 cellrendererpix: make sure to select the default helper as a fallback
If we don't have expander pixbufs, select the default helper to render
the icon, even if the cell is an expander. This mimics what the old code
did.
2011-11-30 16:39:59 -05:00
Cosimo Cecchi
0304cc04d3 cellrendererpix: port to GtkIconHelper 2011-11-30 16:39:59 -05:00
Cosimo Cecchi
a4d6505cb3 entry: port to GtkIconHelper 2011-11-30 16:39:59 -05:00
Cosimo Cecchi
adbfbb7278 dnd: port to GtkIconHelper 2011-11-30 16:39:59 -05:00
Cosimo Cecchi
f085dde830 image: port to GtkIconHelper
Use newly introduced GtkIconHelper to render pixbufs in GtkImage.
2011-11-30 16:39:59 -05:00
Cosimo Cecchi
b5d8d2c4a8 icon-helper: add GtkIconHelper private object
GtkIconHelper is a helper object to easily obtain a pixbuf from
different icon sources (e.g. a GIcon, an icon name, a stock id, ...).

Code is ported from GtkImage, which will be adapted in the next commit.
2011-11-30 16:39:59 -05:00
Stef Walter
d462f86aad GtkCssProvider: don't segfault when CSS file is not found
* Fix null dereference in gtk_css_provider_take_error()
 * And another in gtk_css_provider_emit_error()

https://bugzilla.gnome.org/show_bug.cgi?id=664537
2011-11-30 00:23:07 -05:00
Matthias Clasen
9b967ab8af XI2: Push error traps around XIQueryDevice calls
This may help against the crashes at resume time that some
people have been hitting when input devices mysteriously
disappear.
2011-11-30 00:16:43 -05:00
Federico Mena Quintero
830bc4304c [GtkFileChooserDefault] Don't destroy and re-create the filename entry
This is a leftover from the big rework to remove the expanded/collapsed mode
in Save mode.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-11-29 15:11:56 -06:00
Federico Mena Quintero
463c98a9d7 [GtkPathBar] Remove unused error argument
It used to be that _gtk_path_bar_set_file() would return an error if
it wasn't able to switch to the specified file, but that hasn't been
the case for a long while now, since the file chooser became async.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-11-29 15:11:54 -06:00
Paolo Borelli
58d247d7ae Avoid shadowing a variable
Move bg_color variable to an inner scope.
2011-11-29 21:28:30 +01:00
Federico Mena Quintero
7fb00c919e [path-bar] Add some comments to explain the async recursion on an I/O callback
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-11-29 14:17:04 -06:00