Commit Graph

155 Commits

Author SHA1 Message Date
Dan Vrátil
4243c3a1e2 Fix a memory leak in GtkImage
https://bugzilla.gnome.org/show_bug.cgi?id=678175
2012-06-20 08:27:01 +02:00
Pavel Holejsovsky
7572325efb GtkImage: fix get_property('stock')
The code was trying to get icon's name instead of icon's stock-id.

https://bugzilla.gnome.org/show_bug.cgi?id=678407
2012-06-19 15:58:11 +02:00
Benjamin Otte
49c618c59c image: Don't add border twice
Failed to delete these lines in d40c496e6e
2012-06-15 03:30:52 +02:00
Benjamin Otte
d40c496e6e image: background and border should be drawn around the widget
... not around the contents. If you want the widget to not be larger
than the contents, don't use ALIGN_FILL.
2012-06-14 20:06:39 +02:00
Michael Vogt
19e55d620f GtkImage: Move g_clear_object() to gtk_image_finalize()
This moves the freeing of the icon_helper from the destory to the finalize
function to avoid segfaults when trying to access a destroyed object before it
is disposed. This often happens in signal handlers which get called
asynchronously after destroy.

https://bugzilla.gnome.org/show_bug.cgi?id=674050
2012-04-16 06:51:43 +02:00
Benjamin Otte
917ca6a802 gtk: Don't call gdk_window_process_updates() when scrolling
This can cause lagging when scrolling as it causes us to repaint
on every scroll event. This wasn't historically a great problem,
but with smooth scrolling we get a lot more events, so this
now creates visible lagging on slower machines.
2012-04-05 15:48:51 +02:00
Cosimo Cecchi
e24fd5f463 image: handle PROP_STORAGE_TYPE in get_property()
Fallout from GtkIconHelper transition.
2012-03-02 12:48:52 -05:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Matthias Clasen
4c2e53a468 Silence a compiler warning 2012-01-24 00:41:26 -05:00
Paolo Borelli
1326466309 Render background of a GtkImage
Useful to e.g. style the bg color of a symbolic icon
2012-01-23 21:03:05 +01:00
Paolo Borelli
e34589ddea Factor out _gtk_misc_get_padding_and_border
The new semi-private function will allow to implement support for css
padding and border in widgets inheriting from GtkMisc.
Use the new function for GtkLabel, GtkArrow and GtkImage.
2012-01-22 13:36:47 +01:00
Benjamin Otte
a213b0b33e image: Fix gcc warnings 2012-01-16 18:39:52 +01:00
Alexander Larsson
622b78c000 Add GtkImage constructors from resources
Atm you can't read back the resource path like
you can with filenames. Maybe we should add that.
2012-01-16 14:19:18 +01:00
Rui Matos
e3d38708ab image: Stop setting state flags on the style context for drawing 2011-12-19 19:21:16 +00:00
Cosimo Cecchi
1e23a74a95 image: take misc padding into account when calculating x/y draw coords
This fixes the misc-alignment.ui reftest.
2011-12-12 12:30:27 +01:00
Cosimo Cecchi
b215aeacc8 image: add gtk_image_get_preferred_size()
Add a function to query the preferred size of the GtkImage, and use it
in the get_preferred_width/height implementations.
2011-12-12 12:29:21 +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
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
f085dde830 image: port to GtkIconHelper
Use newly introduced GtkIconHelper to render pixbufs in GtkImage.
2011-11-30 16:39:59 -05:00
Matthias Clasen
2152424541 Convert GailImage to GtkImageAccessible 2011-07-05 16:08:53 -04:00
Juan A. Suarez Romero
c903ece96b image: Initialize variable 2011-06-14 09:49:23 +00:00
Javier Jardón
bf0d8402f5 gtk: Use const instead G_CONST_RETURN 2011-06-10 13:07:54 +01:00
Cosimo Cecchi
e6a3257b55 image: use gtk_render_icon() 2011-06-09 23:17:09 +02:00
Colin Walters
b90e8cfc36 gtkdnd: Add API that takes GIcon
This will be useful for me to port gnome-panel to gnome-menus 4, which
uses GAppInfo, which in turn returns icon references as GIcon.

https://bugzilla.gnome.org/show_bug.cgi?id=649295
2011-05-03 12:53:46 -04:00
Matthias Clasen
a65e25df83 GtkImagePrivate: Improve struct packing 2011-04-12 12:33:45 -04:00
Benjamin Otte
1483145806 API: image: Move private struct definitions into private header
They weren't privatized because the dnd code used them, too. But a
private header can allow the dnd code to be nasty, so go dnd code!
2011-02-08 08:58:49 +01:00
Matthias Clasen
beb8c290d1 Always chain up in ::style-updated
This was not handled consistently, but the default handler
does useful things, so we should always chain up.
2011-02-07 07:30:37 -05:00
Pavel Holejsovsky
6d5cdad56e [GI] Annotate strings holding file paths as (type filename) 2011-01-18 17:29:40 +01:00
Bastien Nocera
714d9bc407 GtkImage: Add "use-fallback" property
So that icon-name and GIcon type of GtkImages can use automatic
fallback names.
2011-01-18 16:14:05 +00:00
Carlos Garnacho
18502518f3 Make GtkImage use GtkStyleContext 2011-01-10 03:50:00 +01:00
Matthias Clasen
98440ad031 Remove gtktypeutils altogether
Based on patches by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 14:51:19 -05:00
Carlos Garcia Campos
2dde04140d GtkImage: Use gtk_widget_render_icon_pixbuf()
Instead of gtk_widget_render_icon() which is now deprecated.
2010-12-08 17:13:43 +01:00
Matthias Clasen
53c2114356 Deprecate gtk_icon_info_load_symbolic_for_style
We might end removing it altogether since it is a bit silly to have
Since: 3.0
Deprecated: 3.0
2010-12-04 15:39:45 +01:00
Matthias Clasen
4ca87168d4 Remove size_reuqest from GtkImage 2010-10-26 23:16:40 -04:00
Javier Jardón
eac1959d2c Move destroy signal to GtkWidget
Also make GtkWidget derive from GInitiallyUnowned
2010-09-26 22:18:18 -04:00
Benjamin Otte
18e489fedd image: Fix up draw function
The previous port to the draw function was a tiny bit incomplete. This
patch should fix the remaining issues and remove unused variables.
2010-09-26 17:51:05 +02:00
Benjamin Otte
8929321cba image: Add a default case to switch statement to avoid gcc warnings 2010-09-26 15:11:42 +02:00
Benjamin Otte
7121ec2880 image: Port to draw vfunc 2010-09-26 15:11:35 +02:00
Benjamin Otte
c76221426a image: Always render the whole image
Otherwise effects like blur etc will have funny seams on repaints.
Oh, and also, the draw vfunc doesn't have an equivalent to event->area
;)
2010-09-26 15:11:35 +02:00
Benjamin Otte
b370cb0d4c API: image: Remove ability to set image from a pixmap 2010-09-26 15:11:11 +02:00
Javier Jardón
a48d28848e gtk/gtkimage.c: use accessor functions to access GtkWidget 2010-09-08 21:13:03 +02:00
Tristan Van Berkom
9934007420 Completely removed requisition cache from GtkWidget instance structure.
Since we have a new mechanism for requesting sizes: GtkSizeRequestIface;
it makes no sense to maintain this cache on the GtkWidget structure...
removing the requisition cache however does not break the old "size-request"
signal which is there for backwards compatability reasons.

In any case widget->requisition should not have been accessed,
gtk_widget_get_child_requisition() would have been the correct way
to consult the cache.

This commit also deprecates the newly added gtk_widget_get_requisition()
API and makes it fallback on gtk_size_request_get_size().
2010-09-08 18:50:24 +02:00
Tor Lillqvist
4491bdbb9d Drop Win32 DLL ABI compatibility cruft
No need for that any longer as we are changing DLL name.
2010-08-30 14:57:48 +03:00
Javier Jardón
1e5d7c0225 Use GtkFooPrivate instead GtkFooPriv 2010-08-27 04:48:23 +02:00
Benjamin Otte
24a867f8da image: remove GdkImage as a possible image type
GdkImage is about to be deprecated.
2010-08-10 21:02:25 +02:00
Benjamin Otte
8f6a014de4 image: Use Cairo instead of gdk_draw_drawable() 2010-07-26 16:42:46 +02:00
Benjamin Otte
847d401df3 image: replace gdk_draw_pixbuf() call with Cairo equivalent 2010-07-26 16:42:46 +02:00
Javier Jardón
978a031b76 Use accessor functions to access GtkMisc 2010-07-13 19:40:49 +02:00
Javier Jardón
86f0bd5cc9 GtkImage: move public members to private structure 2010-07-13 19:40:48 +02:00