Commit Graph

89 Commits

Author SHA1 Message Date
Cosimo Cecchi
23c5ebafce cellrendererpix: set the IMAGE style class when rendering an icon
This way, themes can change symbolic icon colors for views, by using a

.view.image {

}

CSS selector.

https://bugzilla.gnome.org/show_bug.cgi?id=680008
2012-07-16 09:35:07 -04:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Benjamin Otte
c5433e852b gtk: Add accessible types for cell renderers 2011-12-16 04:53:16 +01:00
Cosimo Cecchi
798413151f cellrendererpix: save the icon size locally instead of in the helper
We need to save the icon size locally for GtkCellRendererPixbuf, since
its properties are set again every time it's drawn (resetting the icon
size on the helper by means of _gtk_icon_helper_clear() each time).
2011-12-15 19:59:24 +01: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
35fdce68e1 cellrendererpix: make the icon render properly again
pix_rect was not initialized anymore, so the gdk_rectangle_intersect()
call would always fail.
2011-06-09 22:59:06 -04:00
Cosimo Cecchi
0198662d79 cellrendererpix: use gtk_render_icon() 2011-06-09 23:17:09 +02:00
Matthias Clasen
ea936d4237 GtkCellRendererPixbufPrivate: Improve struct packing 2011-04-12 12:30:36 -04:00
Javier Jardón
4a7400db99 Move documentation to inline comments: GtkCellRendererPixbuf 2011-04-11 23:07:41 +01:00
Carlos Garnacho
c59a05b0d4 Make GtkCellRendererPixbuf use GtkStyleContext 2011-01-27 20:57:13 +01:00
Carlos Garcia Campos
24e832187f GtkCellRendererPixbuf: Use gtk_widget_render_icon_pixbuf()
Instead of gtk_widget_render_icon() which is now deprecated.
2010-12-08 17:16:02 +01:00
Matthias Clasen
f0eed4a5b1 Use gtk_icon_info_load_symbolic_for_context
gtk_icon_info_load_symbolic_for_style is going to be deprecated.
2010-12-04 15:39:43 +01:00
Matthias Clasen
21eae6b6f3 Make GdkRectangle arguments in GtkCellRenderer use const consistently
https://bugzilla.gnome.org/show_bug.cgi?id=630900
2010-10-04 10:23:55 -04:00
Benjamin Otte
e31e77eeb8 API: Change cellrenderer->render vfunc to take a cairo_t
Also constify the rectangle arguments. They were const anyway.
2010-09-26 15:03:01 +02:00
Javier Jardón
1e5d7c0225 Use GtkFooPrivate instead GtkFooPriv 2010-08-27 04:48:23 +02:00
Javier Jardón
7b5656b492 gtk/gtkcellrendererpixbuf.c: use accessor functions to access GtkWidget 2010-08-22 22:56:15 +02:00
Javier Jardón
72f515a0f3 gtkcellrendererpixbuf: Move public members to private structure 2010-07-13 19:40:46 +02:00
Javier Jardón
db584abef3 Use accessor functions to access GtkCellRenderer 2010-07-13 19:40:45 +02:00
Javier Jardón
0a07e9733b gtk/: fully remove gtkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:51:26 +02:00
Matthias Clasen
e9fc660d7e Add a variant of gtk_icon_theme_load_symbolic that takes a style
As proposed by Owen in bug 621578 to reduce code duplication.
2010-06-14 23:46:46 -04:00
Matthias Clasen
6b939d57c7 Support 'symbolic' themed icons
Add gtk_icon_info_load_symbolic() to load symbolic icons, and
theme their background/foreground colours to match the
colours used in the theme.

Adds the gtk_icon_info_load_symbolic() function, explicit
support in GtkImage and GtkCellRendererPixbuf, and test cases
for those 2 widgets.

With help from Bastien Nocera <hadess@hadess.net>

https://bugzilla.gnome.org/show_bug.cgi?id=614711
2010-04-28 12:02:05 +01:00
Javier Jardón
32b9aeaadd Don't use GTK_WIDGET_STATE in internal code anymore
Use gtk_widget_get/set_state() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-09 02:40:17 +01:00
Javier Jardón
4232115e22 Deprecate widget flag: GTK_WIDGET_HAS_FOCUS
Use gtk_widget_has_focus() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 06:11:01 +01:00
Matthias Clasen
ed33a20b29 Bug 565317 - Resulting image of GtkCellRendererPixbuf depends on order of set properties
(gtk_cell_renderer_pixbuf_set_property): add back evil code that makes
sure that the current image is only unset if the new image was created
from the same property or the new property is not NULL.
2009-06-15 21:10:34 +02:00
Christian Persch
ca15f74ad2 Bug 557065 – gtkcellrendererpixbuf spams console over and over with
'could not load image' warnings

	* gtk/gtkcellrendererpixbuf.c:
	(gtk_cell_renderer_pixbuf_create_themed_pixbuf): Remove noisy
	g_warning.

svn path=/trunk/; revision=21715
2008-10-26 20:37:17 +00:00
Matthias Clasen
2377e48038 Bug 555779 – GtkCellRendererPixbuf crashed on failed GIcon lookup
2008-10-13  Matthias Clasen  <mclasen@redhat.com>

        Bug 555779 – GtkCellRendererPixbuf crashed on failed GIcon lookup

        * gtk/gtkcellrendererpixbuf
        (gtk_cell_renderer_pixbuf_create_themed_pixbuf): Don't crash
        if a GIcon is not present in the current theme. Patch by
        Alex Larsson.


svn path=/trunk/; revision=21650
2008-10-14 03:47:18 +00:00
Michael Natterer
b2d286d5bf examples/gtkdial/gtkdial.c gdk/gdkapplaunchcontext.c gdk/gdkpango.c
2008-08-12  Michael Natterer  <mitch@imendio.com>

	* examples/gtkdial/gtkdial.c
	* gdk/gdkapplaunchcontext.c
	* gdk/gdkpango.c
	* gtk/gtkcellrendererpixbuf.c
	* gtk/gtkcellrenderertext.c
	* gtk/gtkcellview.c
	* gtk/gtkcombobox.c
	* gtk/gtkfontsel.c
	* gtk/gtkinvisible.c
	* gtk/gtkliststore.c
	* gtk/gtktexttag.c
	* gtk/gtktexttagtable.c: remove dereferencing from some function
	pointers i missed before.


svn path=/trunk/; revision=21089
2008-08-12 09:51:16 +00:00
Kristian Rietveld
74984a5c24 Since s/2.16/2.14/ for the new gicon property.
2008-07-02  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_class_init):
	Since s/2.16/2.14/ for the new gicon property.


svn path=/trunk/; revision=20731
2008-07-02 09:34:24 +00:00
Johan Dahlin
d97cdbdf53 Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch and Tim


svn path=/trunk/; revision=20669
2008-06-22 14:28:52 +00:00
Johan Dahlin
a14ce91e91 Remove an unused prototype.
2008-06-19  Johan Dahlin  <jdahlin@async.com.br>

    * gtk/gtkcellrendererpixbuf.c: Remove an unused prototype.


svn path=/trunk/; revision=20461
2008-06-19 12:16:44 +00:00
Carlos Garnacho
6afb455e5a Bug 538519 – GtkCellRendererPixbuf doesn't allow unsetting the icon
2008-06-16  Carlos Garnacho  <carlos@imendio.com>

        Bug 538519 – GtkCellRendererPixbuf doesn't allow unsetting the icon
        anymore

        * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_set_property):
        Allow again setting any of the properties to render an image back to
        NULL.

svn path=/trunk/; revision=20395
2008-06-16 10:03:16 +00:00
Matthias Clasen
81d87d7b13 Add a gicon property
svn path=/trunk/; revision=20391
2008-06-15 04:54:20 +00:00
Michael Natterer
02fd7ba040 gtk/gtkcellrenderer.c gtk/gtkcellrendererpixbuf.c
2008-05-19  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkcellrenderer.c
	* gtk/gtkcellrendererpixbuf.c
	* gtk/gtkcellrenderertoggle.c
	* gtk/gtkimagemenuitem.c
	* gtk/gtkmenutoolbutton.c
	* gtk/gtkoptionmenu.c
	* gtk/gtkstatusbar.c
	* gtk/gtktextview.c: s/PROP_ZERO/PROP_0/g, remove LAST_PROP.


svn path=/trunk/; revision=20112
2008-05-19 14:15:34 +00:00
Matthias Clasen
82ce59cd0f Remove unnecessary NULL checks before g_free(). (#369666, Morten Welinder,
2007-03-09  Matthias Clasen <mclasen@redhat.com>

        * Everywhere: Remove unnecessary NULL checks before
        g_free().  (#369666, Morten Welinder, Djihed Afifi)

        * configure.in: Check for ftw.h



svn path=/trunk/; revision=17444
2007-03-09 21:57:37 +00:00
Kristian Rietveld
817d667da8 Make sure [xy]_offset are always being initialized, fix pixbuf renderer
2006-12-03  Kristian Rietveld  <kris@gtk.org>

	Make sure [xy]_offset are always being initialized, fix pixbuf
	renderer padding.  (#108235, Sven Neuman).

	* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size),
	(gtk_cell_renderer_pixbuf_render): add padding in _render instead
	of _get_size.

	* gtk/gtkcellrendererprogress.c (gtk_cell_renderer_progress_get_size):
	always initialize [xy]_offset.
	* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto.
	* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
	ditto.
2006-12-03 20:02:04 +00:00
Matthias Clasen
07e7719441 Apply a cleanup patch by Kjartan Maraas (#341812)
2006-10-08  Matthias Clasen  <mclasen@redhat.com>

	* Apply a cleanup patch by Kjartan Maraas  (#341812)
2006-10-08 05:07:55 +00:00
Matthias Clasen
113f364a37 More of the same 2006-05-14 04:25:34 +00:00
Matthias Clasen
f26aad1916 Boilerplate reduction 2006-05-02 23:56:43 +00:00
Michael Natterer
194e8daff9 Fix bug #319974:
2005-10-26  Michael Natterer  <mitch@imendio.com>

	Fix bug #319974:

	* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_set_property):
	make sure that setting any of pixbuf/stock-id/icon-name resets the
	others because they are mutually exclusive, and that unsetting any
	of them only resets the pixbuf and nothing else. Also added
	some missing g_object_notify().

	(gtk_cell_renderer_pixbuf_get_property): simplified calls to
	g_value_set_object().

	(gtk_cell_renderer_pixbuf_create_stock_pixbuf)
	(gtk_cell_renderer_pixbuf_create_named_icon_pixbuf): added
	g_object_notify ("pixbuf").
2005-10-27 13:16:23 +00:00
Matthias Clasen
938af0e4c3 Don't leak expander pixbufs. (#316946, Tommi Komulainen)
2005-09-23  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_finalize):
	Don't leak expander pixbufs.  (#316946, Tommi Komulainen)
2005-09-23 16:34:25 +00:00
Matthias Clasen
94eec04267 Intern some more strings.
2005-09-01  Matthias Clasen  <mclasen@redhat.com>

        * gdk/*.c: Intern some more strings.
        * gtk/gtkintl.h:
        * gtk/*.c: Define an I_() macro and use it instead of the
        bulky g_intern_static_string().
2005-09-01 05:11:46 +00:00
Matthias Clasen
c09cc89317 Intern type names in code generated by glib-mkenums, too.
2005-08-31  Matthias Clasen  <mclasen@redhat.com>

	* gdk/Makefile.am:
	* gtk/Makefile.am: Intern type names in code generated by
	glib-mkenums, too.

	* gtk/*.c:
	* gdk/x11/*.c:
	* gdk/*.c: Intern type names before registering the type to avoid
	unnecessary copies.
2005-08-31 16:53:43 +00:00
Matthias Clasen
9fe4bffd4f Support named icons in cells by adding a icon-name property. (#165777,
2005-05-18  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkcellrendererpixbuf.c: Support named icons in
	cells by adding a icon-name property. (#165777, Anders
	Carlsson)
2005-05-18 06:13:42 +00:00
Owen Taylor
dda40ca71a Use a GtkAlignment rather than a GtkDrawingArea to draw the swatch in to
2005-05-11  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcolorbutton.c: Use a GtkAlignment rather than a GtkDrawingArea
	to draw the swatch in to avoid having an extraneous window.

	* gtk/gtkcolorsel.c (color_sample_draw_sample): Actually se tthe
	color when !has_opacity.

2005-05-10  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkcairo.[ch] gdk/gdkcolor.[ch] gdk/Makefile.am: Add source
	files for Cairo convenience functionality.

	* gdk/gdkcairo.h (gdk_cairo_rectangle, gdk_cairo_region): Add a
	convenience functions to add GdkRectangle, GdkRegion to a cairo path.

	* gdk/gdkwindow.c gdk/gdkgc.c gtk/gtkcolorsel.c gtk/gtkiconview.c
	gtk/gtkstyle.c: Use gdk_cairo_rectangle/region().

	* gdk/gdkcairo.[ch] gdk/gdkdrawable.h gdk/gdkdraw.c: Rename
	gdk_drawable_create_cairo_context() to gdk_cairo_create().

	* gdk/gdkcairo.c gdk/gdkpixbuf.h gdk/gdkpixbuf-render.c:
	Rename gdk_pixbuf_set_as_cairo_source() to
	gdk_cairo_set_source_pixbuf().

	* gdk/gdkdraw.c gdk/gdkpango.c gtk/gtkcolorsel.c gtk/gtkhruler.c
	gtk/gtkhsv.c gtk/gtkiconview.c gtk/gtkstyle.c gtk/gtkvruler.c:
	Adjust for renames.

	* gdk/gdk.symbols: Update.

	* gtk/gtkwidget.c (gtk_widget_queue_shallow_draw): Fix
	coordinate system problem that was causing the wrong portions
	to be invalidated.

	* gtk/gtkcellrenderer.c (gtk_cell_renderer_render)
	gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_render)
	gtk/gtkcellrendererprogress.c (gtk_cell_renderer_progress_render)
	gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render)
	gtk/gtkcellview.c (gtk_cell_view_expose)
	gtk/gtkdnd.c (gtk_drag_highlight_expose)
	gtk/gtkentry.c (gtk_entry_draw_text)
	gtk/gtktextview.c (text_window_invalidate_rect): Some cairoization.

	* gtk/gtkcalendar.[ch]: Beat into something roughly resembling
	GTK+ style ... use instance-private data and standard names for
	private structure, etc. Move function docs inline.

	* gtk/gtkcalendar.[ch]: Switch to drawing everything in
	expose. Switch drawing to Cairo.

	* gtk/gtkcalendar.c (gtk_calendar_freeze): Deprecate
	gtk_calendar_freeze/thaw
2005-05-11 19:16:19 +00:00
Matthias Clasen
269d89c79c Define macros GTK_PARAM_READABLE, GTK_PARAM_WRITABLE, GTK_PARAM_READWRITE
2005-03-21  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkprivate.h: Define macros GTK_PARAM_READABLE,
	GTK_PARAM_WRITABLE, GTK_PARAM_READWRITE which are like
	their G_ counterparts, but also mark the name, nick
	and blurb as static.

	* gtk/*.c: Mark param spec strings as static, using
	the new macros.
2005-03-22 02:14:55 +00:00
Matthias Clasen
306cc2ed71 Fix typo 2005-03-21 06:05:18 +00:00
Matthias Clasen
b6c29a5f1a : Mark param spec strings as static. 2005-03-21 06:02:43 +00:00
Matthias Clasen
cca8dd6347 Make PLT-reduction work with gcc4, and don't include everything in
2005-03-20  Matthias Clasen  <mclasen@redhat.com>

	Make PLT-reduction work with gcc4, and don't include
	everything in gdkalias.h:

	* gtk/grk.symbols: Group symbols by header and source file.
	* gtk/makegtkalias.pl: Protect definitions by the same
	preprocessor symbols used to guard the headers. Move
	the alias declarations to a separate file which is
	produced when calling makegtkalias.pl -def
	* gdk/Makefile.am (gtkaliasdef.c): Add a rule to generate
	this file.
	* gtk/*.c: Include gtkalias.h after the other headers,
	include gtkaliasdef.c at the bottom.
	* gtk/*.h: Small cleanups.
2005-03-20 07:01:23 +00:00
Matthias Clasen
52711c24e8 More canonical property names. 2005-03-09 06:15:13 +00:00