Commit Graph

178 Commits

Author SHA1 Message Date
Benjamin Otte
6055028c96 snapshot: Rename append APIs
Instead of having gtk_snapshot_append_foo_node(), just have
gtk_snapshot_append_foo(). Nobody needs to know that this internally
uses nodes.
2017-01-13 04:46:09 +01:00
Benjamin Otte
b58de2d16c snapshot: Redo pop() API
gtk_snapshot_pop() => removed
gtk_snapshot_pop_and_append() => gtk_snapshot_pop()

So now there is no way to get a rendernode out of the snapshotting API
until you gtk_snapshot_finish().
2017-01-13 03:38:36 +01:00
Benjamin Otte
c412a717f1 cellrenderertext: Implement snapshot() 2016-12-23 09:23:07 +01:00
Piotr Drąg
a2da4ddceb Use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772371
2016-12-19 15:08:10 -05:00
Timm Bäder
a5867ffe71 Remove some more GdkColor properties 2016-10-20 20:12:08 +02:00
Benjamin Otte
1518fe0a8f API: stylecontext: Remove state argument from getters
The argument must always be the current state.
2016-10-16 18:18:58 +02:00
Matthias Clasen
f53706b003 cell renderer text: Allow entries to shrink
Set a small max-width on entries used for editing cells, so they
adapt to small columns and don't overlap the next column.

https://bugzilla.gnome.org/show_bug.cgi?id=770374
2016-08-25 07:53:32 -04:00
Matthias Clasen
3c54fbd3ac Use stupid quotes instead of dumb quotes
Following a similar change in GLib a while ago.

'bla' may by stupid, but it looks less dumb than `bla'.
2015-09-23 07:01:16 -04:00
Matthias Clasen
65be0f5be9 text cell renderer: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:13:29 -04:00
Matthias Clasen
4453c4401f Support alpha in text cell renderer colors
This is easily possible, now that Pango supports alpha.
2015-08-15 11:24:55 -04:00
Sebastien Lafargue
43d6ebf9fb cellrenderertext: notify inverted
The notify for "size" and "size-points" properties
are inverted.

https://bugzilla.gnome.org/show_bug.cgi?id=742311
2015-01-04 12:48:14 +01:00
Matthias Clasen
c96f5b953a GtkCellRendererText: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:30:57 -04:00
Matthias Clasen
1139b21997 GtkCellRendererText: Use G_PARAM_EXPLICIT_NOTIFY for 'alignment' 2014-06-09 13:30:54 -04:00
Matthias Clasen
49cf5142ba Deprecate GdkColor
It has been replaced by GdkRGBA. Time to make it official.
http://bugzilla.gnome.org/show_bug.cgi?id=636695
2014-05-22 09:09:55 -04:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
Bastien Nocera
438cd857c4 all: Add names to timeouts
Add names to every timeout we setup, so it's easier to track their
usage, and debug possible misbehaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=710651
2013-10-23 13:31:18 +02:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
Benjamin Otte
16e902d20a API: Export gtk_cell_renderer_class_set_accessible_type()
This function is necessary to implement cell renderer accessibility
support.
2013-02-25 21:42:31 +01:00
Simon Feltman
283c974680 gtkcellrenderertext: Sink floating entry before using as signal argument
Sink the GtkEntry assigned to the private structure of GtkCellRendererText
before signals containing it as an argument are sent out. This keeps
language bindings from sinking the reference and then destroying the entry
when the signal closure is finished.

https://bugzilla.gnome.org/show_bug.cgi?id=693400
2013-02-11 17:46:33 -08:00
Benjamin Otte
055b5d83d5 gtk: Use gtk_style_context_get()
... instead of soon-to-be-deprecated gtk_style_context_get_font().
2012-12-06 02:57:18 +01:00
Benjamin Otte
7747910b9d gtk: Use context's font
Instead of using gtk_style_context_get_font() in
pango_context_get_metrics(), use pango_context_get_font_description().
The context contains the font description we are about to use after all.
2012-12-06 02:57:18 +01:00
Carlos Garcia Campos
a18f018d87 cellrenderertext: Add placeholder-text property
It works similar to placeholder text in a GtkEntry, if the cell renderer
is editable and it's empty, the placeholder text is displayed.
https://bugzilla.gnome.org/show_bug.cgi?id=645514
2012-05-03 23:35:34 -04:00
Matthias Clasen
050cba6a31 Fix malformed doc comments
Most of these are forgotten :'s and similar details
which gtk-doc now warns about.
2012-04-12 21:12:16 -04:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Cosimo Cecchi
dd2bbd1b85 cell-renderer-text: don't use gtk_entry_set_inner_border()
There's no need to, since now the theme can just tweak the padding like:

.cell.entry {
  padding: 12;
}
2012-01-31 10:04:26 -05:00
Javier Jardón
a3abc18858 Deprecate all the public API that is using GdkColor struct 2011-12-22 02:59:39 +00:00
Benjamin Otte
c5433e852b gtk: Add accessible types for cell renderers 2011-12-16 04:53:16 +01:00
Matthias Clasen
a6db55b774 GtkCellRendererTextPrivate: Improve struct packing 2011-04-12 12:31:28 -04:00
Carlos Garnacho
7c2f35d7c1 Make GtkCellRendererText use GtkStyleContext 2011-01-27 20:57:12 +01:00
Matthias Clasen
d9fcc4c630 Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 21:51:38 -05:00
Matthias Clasen
09bf05bd57 Fix alignment problems with text cell renderers
When set to PANGO_ALIGN_CENTER, text was rendered off-center
by the amount of 'free space' that the PangoLayout left (ie
the x returned by pango_layout_get_pixel_extents).
2011-01-22 23:23:46 -05:00
Tristan Van Berkom
9a80100e9a Fixed get_size() for GtkCellRendererText to clip to the input area
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.
2011-01-06 02:31:42 +09:00
Kristian Rietveld
9ab2786991 GtkCellRendererText: use PANGO_PIXELS_CEIL for text_width
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.
2010-12-23 18:41:23 +01:00
Kristian Rietveld
a28c11a27f Clip to cell_area when rendering cell content
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).
2010-12-16 00:07:08 +01:00
Tristan Van Berkom
2a41de70b1 Removing an unused variable from GtkCellRendererText->get_preferred_width() 2010-12-04 14:31:45 +09:00
Tristan Van Berkom
03a72118ad Merge branch 'master' into treeview-refactor
Conflicts:
	tests/Makefile.am
2010-12-02 13:58:02 +09:00
Emmanuele Bassi
1779ae79a1 rgba: Invert the arguments and improve bindability
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
2010-11-28 19:01:51 +00:00
Tristan Van Berkom
7fc7bd613b Changed GtkCellRendererText to request less than wrap-width if the text is smaller than the wrap-width (or width-chars). 2010-11-25 22:46:55 +09:00
Tristan Van Berkom
2dd2c7ce05 Added gtk_cell_renderer_get_aligned_area() and class vfunc.
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.
2010-11-25 17:41:26 +09:00
Garrett Regier
24c3b956f3 docs: Move documentation to inline comments: GtkCellRendererText
Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-11-08 11:31:02 +09:00
Garrett Regier
d5593dec9e docs: Move documentation to inline comments: GtkCellRendererText
Signed-off-by: Javier Jardón <jjardon@gnome.org>
2010-11-06 18:21:36 +01:00
Matthias Clasen
503698f587 Support resetting cell renderer colors with NULL again
This functionality was lost when GdkRGBA was introduced.

Bug 632936
2010-10-25 11:17:24 -04:00
Carlos Garnacho
d1140d0b1e GtkCellRendererText: Add [foreground|background]-rgba properties
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.
2010-10-22 20:14:57 +02: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
e66129015d cellrenderer: Merge GtkCellSizeRequest into GtkCellRenderer
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".
2010-09-26 15:11:45 +02:00
Benjamin Otte
d9c9259861 Move GtkSizeRequest into GtkWidget
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".
2010-09-26 15:11:45 +02:00
Benjamin Otte
1d3f6b30b0 API: Rename gtk_cairo_paint_*() to gtk_paint_*()
Large patch, but just renaming.
Indentation should still mostly be correct because I took care of
keeping the indentation for this function name.
2010-09-26 15:11:42 +02: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
b140884fec Use gtk_size_request_get_size() instead deprecated gtk_widget_size_request()
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>
2010-09-15 03:02:58 +02:00