summaryrefslogtreecommitdiff
path: root/gtk/gtkcellrenderertext.c
Commit message (Collapse)AuthorAgeFilesLines
* Fixed get_size() for GtkCellRendererText to clip to the input areaTristan Van Berkom2011-01-061-6/+9
| | | | | | | | | | For ellipsize cells it's important to clip the result of get_size() so that the returned required rectangle is indeed less than or equal to the input rectangle... this is done so that GtkCellArea can accurately paint focus on cells by calling gtk_cell_renderer_get_aligned_area(). Patch also adds assertions to gtk_cell_renderer_get_aligned_area() to ensure this keeps working correctly.
* GtkCellRendererText: use PANGO_PIXELS_CEIL for text_widthKristian Rietveld2010-12-231-5/+5
| | | | | | | | | | | Usually pango_layout_get_pixel_extents() is used, which uses PANGO_PIXELS_CEIL on the rectangle's width. This commit makes the new function gtk_cell_renderer_text_get_preferred_width() consistent with this. This fixes rounding errors on Mac OS X, where we were seeing tree views with a double height for a single line of text, while the usual single row height would have been sufficient.
* Clip to cell_area when rendering cell contentKristian Rietveld2010-12-161-0/+7
| | | | | | | | | | | | | | | | | | | This fixes a GTK+ 3.0 regression. In GTK+ 2, the render method on GtkCellRenderer had a expose_area parameter, typically set to cell_area. This parameter was used for clipping cell content to be rendered to the cell area (and thus clipping to within the focus rectangle). During the rendering clean up this parameter was removed and no clipping put back into place. Since expose_area was usually equal to cell_area anyway, it does not make sense to reintroduce the expose_area parameter. Instead, we do clipping at two levels: - in gtk_cell_renderer_render() we clip to background_area. We cannot clip to cell_area here because we want to allow cell renderers to render in the background area (e.g. background color/effect). - cell renderers should clip to clip_area when rendering cell content individually (as they had to individually clip to expose_region before).
* Removing an unused variable from GtkCellRendererText->get_preferred_width()Tristan Van Berkom2010-12-041-6/+2
|
* Merge branch 'master' into treeview-refactorTristan Van Berkom2010-12-021-2/+2
|\ | | | | | | | | Conflicts: tests/Makefile.am
| * rgba: Invert the arguments and improve bindabilityEmmanuele Bassi2010-11-281-2/+2
| | | | | | | | | | | | | | | | Since parse() is a method of the Gdk.RGBA class, the GdkRGBA pointer should be the first argument, and the string the second one, to allow a more natural binding. https://bugzilla.gnome.org/show_bug.cgi?id=635879
| * docs: Move documentation to inline comments: GtkCellRendererTextGarrett Regier2010-11-061-0/+14
| | | | | | | | Signed-off-by: Javier Jardón <jjardon@gnome.org>
* | Changed GtkCellRendererText to request less than wrap-width if the text is ↵Tristan Van Berkom2010-11-251-3/+5
| | | | | | | | smaller than the wrap-width (or width-chars).
* | Added gtk_cell_renderer_get_aligned_area() and class vfunc.Tristan Van Berkom2010-11-251-23/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | Since a cell renderer might use more space than the natural size when recieving expand space it's impossible to know how much space is actually used to render content. Adding this virtual method to allow text renderers to implement it, the base default method uses height-for-width apis and aligns the cell assuming the renderer uses a fixed size. This commit removes the similar code from gtkcellarea and subclasses.
* | docs: Move documentation to inline comments: GtkCellRendererTextGarrett Regier2010-11-081-0/+14
|/ | | | Signed-off-by: Javier Jardón <jjardon@gnome.org>
* Support resetting cell renderer colors with NULL againMatthias Clasen2010-10-251-10/+28
| | | | | | This functionality was lost when GdkRGBA was introduced. Bug 632936
* GtkCellRendererText: Add [foreground|background]-rgba propertiesCarlos Garnacho2010-10-221-37/+99
| | | | | | These properties use GdkRGBA to render the cell renderer's content. Note that Pango attributes are used to render the foreground color, so the alpha value is currently ignored.
* Make GdkRectangle arguments in GtkCellRenderer use const consistentlyMatthias Clasen2010-10-041-13/+13
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=630900
* cellrenderer: Merge GtkCellSizeRequest into GtkCellRendererBenjamin Otte2010-09-261-44/+35
| | | | | | | | | | | | | | | | | | | | | | | | | This mostly goes to keep consistency with the changes to GtkSizeRequest in the last patch, as GtkCellSizeRequest requires GtkCellRenderer and GtkCellRenderer implements GtkCellSizeRequest there's no use in keeping them separate. This patch renames the functions: gtk_cell_size_request_get_request_mode() => gtk_cell_renderer_get_request_mode() gtk_cell_size_request_get_width() => gtk_cell_renderer_get_preferred_width() gtk_cell_size_request_get_height() => gtk_cell_renderer_get_preferred_height() gtk_cell_size_request_get_size() => gtk_cell_renderer_get_preferred_size() gtk_cell_size_request_get_width_for_height() => gtk_cell_renderer_get_preferred_width_for_height() gtk_cell_size_request_get_height_for_width() => gtk_cell_renderer_get_preferred_height_for_width() ... and moves the corresponding vfuncs to GtkCellRenderer. The patch also renames the implementations of these functions in cell renderers to include the word "preferrred".
* Move GtkSizeRequest into GtkWidgetBenjamin Otte2010-09-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't make sense to keep them separate as GtkSizeRequest requires a GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have one without the other. It also makes the code a lot easier because no casts are required when calling functions. Also, the names would translate to gtk_widget_get_width() and people agreed that this would be a too generic name, so a "preferred" was added to the names. So this patch moves the functions: gtk_size_request_get_request_mode() => gtk_widget_get_request_mode() gtk_size_request_get_width() => gtk_widget_get_preferred_width() gtk_size_request_get_height() => gtk_widget_get_preferred_height() gtk_size_request_get_size() => gtk_widget_get_preferred_size() gtk_size_request_get_width_for_height() => gtk_widget_get_preferred_width_for_height() gtk_size_request_get_height_for_width() => gtk_widget_get_preferred_height_for_width() ... and moves the corresponding vfuncs to the GtkWidgetClass. The patch also renames the implementations of the vfuncs in widgets to include the word "preferrred".
* API: Rename gtk_cairo_paint_*() to gtk_paint_*()Benjamin Otte2010-09-261-1/+1
| | | | | | Large patch, but just renaming. Indentation should still mostly be correct because I took care of keeping the indentation for this function name.
* API: Change cellrenderer->render vfunc to take a cairo_tBenjamin Otte2010-09-261-31/+18
| | | | Also constify the rectangle arguments. They were const anyway.
* Use gtk_size_request_get_size() instead deprecated gtk_widget_size_request()Javier Jardón2010-09-151-3/+8
| | | | | | | Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629598 Signed-off-by: Javier Jardón <jjardon@gnome.org> Signed-off-by: Tristan Van Berkom <tristanvb@openismus.com>
* Use GtkFooPrivate instead GtkFooPrivJavier Jardón2010-08-271-22/+22
|
* gtk/gtkcellrenderertext.c: use accessor functions to access GtkWidgetJavier Jardón2010-08-221-4/+9
|
* Added GtkCellRendererText::max-width-chars propertyTristan Van Berkom2010-08-201-7/+56
| | | | | Added a property to limit the minimum/natural size request of a text cell renderer.
* Added/Implemented GtkCellSizeRequestIfaceTristan Van Berkom2010-08-181-35/+190
| | | | | | | | This patch adds height-for-width geometry management for cell renderers while still responding to the old gtk_cell_renderer_get_size() apis with virtual return values (obtained by soliciting the new height-for-width cell renderer apis).
* Bug 596125 — Property string fixesPhilip Withnall2010-08-101-1/+1
|
* gtkcellrenderertext: Move public members to private structureJavier Jardón2010-07-131-195/+212
|
* Use accessor functions to access GtkCellRendererJavier Jardón2010-07-131-25/+44
|
* gtk/: fully remove gtkalias hacksJavier Jardón2010-07-101-4/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=623845
* Don't use GTK_WIDGET_STATE in internal code anymoreJavier Jardón2010-03-091-2/+2
| | | | | | Use gtk_widget_get/set_state() instead https://bugzilla.gnome.org/show_bug.cgi?id=69872
* Deprecate widget flag: GTK_WIDGET_HAS_FOCUSJavier Jardón2010-03-011-2/+2
| | | | | | Use gtk_widget_has_focus() instead https://bugzilla.gnome.org/show_bug.cgi?id=69872
* Use g_value_dup_string instead.Hiroyuki Ikezoe2009-12-181-1/+1
| | | | | g_value_get_string and g_strdup should be replaced by g_value_dup_string.
* Use GtkCellEditable::editing-canceledJavier Jardón2009-12-041-4/+10
| | | | | | | | GtkCellEditable::editing-canceled property was added in 2.19 cycle, so we should make the code that currently uses entry->editing_canceled directly go through the property Fixes https://bugzilla.gnome.org/show_bug.cgi?id=599213
* examples/gtkdial/gtkdial.c gdk/gdkapplaunchcontext.c gdk/gdkpango.cMichael Natterer2008-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | 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
* gtk/gtkaboutdialog.c gtk/gtkcellrendereraccel.c gtk/gtkcellrenderercombo.cSven Neumann2008-08-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-08-11 Sven Neumann <sven@gimp.org> * gtk/gtkaboutdialog.c * gtk/gtkcellrendereraccel.c * gtk/gtkcellrenderercombo.c * gtk/gtkcellrendererspin.c * gtk/gtkcellrenderertext.c * gtk/gtkclipboard.c * gtk/gtkcolorsel.c * gtk/gtkcombo.c * gtk/gtkcombobox.c * gtk/gtkdnd-quartz.c * gtk/gtkdnd.c * gtk/gtkentry.c * gtk/gtkentrycompletion.c * gtk/gtkfilechooserbutton.c * gtk/gtkfilechooserdefault.c * gtk/gtkfilechooserentry.c * gtk/gtkfontsel.c * gtk/gtkinputdialog.c * gtk/gtkmenutoolbutton.c * gtk/gtkpathbar.c * gtk/gtktooltip.c: use canonical signal names in g_signal_connect(). svn path=/trunk/; revision=21060
* Include "config.h" instead of <config.h> Command used: find -nameJohan Dahlin2008-06-221-1/+1
| | | | | | | | | | | | 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
* Bug 511163 – Remove pango_extents_to_pixels() callsMatthias Clasen2008-05-261-2/+1
| | | | | | | | | | | | * gtk/gtkcellrenderertext.c (get_size): Use pango_layout_get_pixel_extents. * configure.in: Bump Pango requirement to 1.20 * INSTALL.in: Update required versions svn path=/trunk/; revision=20171
* Fix the default value for the wrap-mode and font-scale properties.Matthias Clasen2007-12-281-1/+3
| | | | | | | | | | | 2007-12-27 Matthias Clasen <mclasen@redhat.com> * gtk/gtkcellrenderertext.c: Fix the default value for the wrap-mode and font-scale properties. svn path=/trunk/; revision=19256
* Add more documentation.Matthias Clasen2007-07-121-3/+6
| | | | svn path=/trunk/; revision=18453
* transform the ink_rect using pango_extents_to_pixels to avoid roundingKristian Rietveld2007-05-311-1/+2
| | | | | | | | | | | 2007-06-01 Kristian Rietveld <kris@gtk.org> * gtk/gtkcellrenderertext.c (get_size): transform the ink_rect using pango_extents_to_pixels to avoid rounding errors. (Fixes #430218, Shlomi Israel). svn path=/trunk/; revision=17996
* Don't copy PangoLanguage. (#340031, Morten Welinder)Matthias Clasen2007-03-121-1/+1
| | | | | | | | | | | 2007-03-12 Matthias Clasen <mclasen@redhat.com> * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_property): Don't copy PangoLanguage. (#340031, Morten Welinder) svn path=/trunk/; revision=17489
* Remove unnecessary NULL checks before g_free(). (#369666, Morten Welinder,Matthias Clasen2007-03-091-6/+3
| | | | | | | | | | | | | 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
* be a little more helpful with the docs on GtkCellRendererText:alignment.Mariano Suárez-Alvarez2007-02-021-1/+5
| | | | | | | | | | | | 2007-02-02 Mariano Suárez-Alvarez <mariano@gnome.org> * gtk/gtkcellrenderertext.c(gtk_cell_renderer_text_class_init): be a little more helpful with the docs on GtkCellRendererText:alignment. Bug #403409. svn path=/trunk/; revision=17250
* Use word wrapping by default, and center multiline labels. (#318763, RossMatthias Clasen2006-12-291-6/+0
| | | | | | | | | | 2006-12-28 Matthias Clasen <mclasen@redhat.com> * gtk/gtkiconview.c: Use word wrapping by default, and center multiline labels. (#318763, Ross Burton) * gtk/gtkcellrenderertext.c (get_layout): Remove a special case for single-line layouts.
* Replace a lot of idle and timeout calls by the new gdk_threads api.Matthias Clasen2006-12-221-5/+1
| | | | | | | 2006-12-22 Matthias Clasen <mclasen@redhat.com> * *.c: Replace a lot of idle and timeout calls by the new gdk_threads api.
* Undo bogus commit.Benjamin Berg2006-12-141-4/+1
|
* - Remove unused code/options from the code. Warn about their usage whileBenjamin Berg2006-12-131-1/+4
| | | | | | | | | | | | | | | | | | | | | 2006-12-13 Benjamin Berg <benjamin@sipsolutions.net> * engines/clearlooks/src/clearlooks_rc_style.c: (clearlooks_rc_style_init), (clearlooks_gtk2_rc_parse_dummy), (clearlooks_rc_style_parse), (clearlooks_rc_style_merge): * engines/clearlooks/src/clearlooks_rc_style.h: * engines/clearlooks/src/clearlooks_style.c: (clearlooks_style_draw_box), (clearlooks_style_init_from_rc), (clearlooks_style_copy): * engines/clearlooks/src/clearlooks_style.h: * engines/clearlooks/src/clearlooks_types.h: - Remove unused code/options from the code. Warn about their usage while parsing. * themes/Clearlooks/gtk-2.0/gtkrc: - Remove options that don't have any effect.
* cancel editing (ie. don't accept changes) when the entry loses focus.Kristian Rietveld2006-12-101-1/+3
| | | | | | | | 2006-12-10 Kristian Rietveld <kris@gtk.org> * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_focus_out_event): cancel editing (ie. don't accept changes) when the entry loses focus. (Fixes #164494, reported by Chris Rouch).
* Make sure [xy]_offset are always being initialized, fix pixbuf rendererKristian Rietveld2006-12-031-0/+5
| | | | | | | | | | | | | | | | | 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.
* add gtk-doc blurb on GtkCellRendererText::edited (#376094)Mariano Suárez-Alvarez2006-11-161-0/+8
| | | | | | | 2006-11-16 Mariano Suárez-Alvarez <mariano@gnome.org> * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_class_init): add gtk-doc blurb on GtkCellRendererText::edited (#376094)
* actually add align-set property to the API (left-over patch from #157439).Kristian Rietveld2006-09-241-1/+15
| | | | | | | | 2006-09-24 Kristian Rietveld <kris@gtk.org> * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_class_init), (gtk_cell_renderer_text_[sg]et_property): actually add align-set property to the API (left-over patch from #157439).
* add align_set field to keep track whether the align property was set byKristian Rietveld2006-07-191-1/+16
| | | | | | | | | | 2006-07-19 Kristian Rietveld <kris@imendio.com> * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_init), (gtk_cell_renderer_text_[gs]et_property), (get_layout): add align_set field to keep track whether the align property was set by the user, if not we will use the alignment by looking at the direction of the widget. (#157439)
* oooops.Kristian Rietveld2006-07-181-2/+19
| | | | | | | 2006-07-18 Kristian Rietveld <kris@imendio.com> * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_start_editing): oooops.