/**
* GtkCellRendererText:alignment:
*
- * Specifies how to align the lines of text.
+ * Specifies how to align the lines of text with respect to each other.
+ *
+ * Note that this property describes how to align the lines of text in
+ * case there are several of them. The "xalign" property of #GtkCellRenderer,
+ * on the other hand, sets the horizontal alignment of the whole text.
*
* Since: 2.10
*/
/**
* GtkCellRendererText::edited
- * @renderer: the object which received the signal.
- * @path: the path identifying the edited cell.
- * @new_text: the new text.
+ * @renderer: the object which received the signal
+ * @path: the path identifying the edited cell
+ * @new_text: the new text
*
* This signal is emitted after @renderer has been edited.
+ *
+ * It is the responsibility of the application to update the model
+ * and store @new_text at the position indicated by @path.
*/
text_cell_renderer_signals [EDITED] =
g_signal_new (I_("edited"),
pango_font_description_free (celltext->font);
- if (celltext->text)
- g_free (celltext->text);
+ g_free (celltext->text);
if (celltext->extra_attrs)
pango_attr_list_unref (celltext->extra_attrs);
break;
case PROP_LANGUAGE:
- g_value_set_string (value, pango_language_to_string (priv->language));
+ g_value_set_static_string (value, pango_language_to_string (priv->language));
break;
case PROP_ELLIPSIZE:
switch (param_id)
{
case PROP_TEXT:
- if (celltext->text)
- g_free (celltext->text);
+ g_free (celltext->text);
if (priv->markup_set)
{
return;
}
- if (celltext->text)
- g_free (celltext->text);
+ g_free (celltext->text);
if (celltext->extra_attrs)
pango_attr_list_unref (celltext->extra_attrs);
{
pango_layout_set_width (layout, priv->wrap_width * PANGO_SCALE);
pango_layout_set_wrap (layout, priv->wrap_mode);
-
- if (pango_layout_get_line_count (layout) == 1)
- {
- pango_layout_set_width (layout, -1);
- pango_layout_set_wrap (layout, PANGO_WRAP_CHAR);
- }
}
else
{
else
layout = get_layout (celltext, widget, FALSE, 0);
- pango_layout_get_pixel_extents (layout, NULL, &rect);
+ pango_layout_get_extents (layout, NULL, &rect);
+ pango_extents_to_pixels (&rect, NULL);
if (height)
*height = cell->ypad * 2 + rect.height;
*y_offset = MAX (*y_offset, 0);
}
}
+ else
+ {
+ if (x_offset) *x_offset = 0;
+ if (y_offset) *y_offset = 0;
+ }
g_object_unref (layout);
}
{
GtkCellRendererTextPrivate *priv;
- GDK_THREADS_ENTER ();
-
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (data);
priv->entry_menu_popdown_timeout = 0;
if (!GTK_WIDGET_HAS_FOCUS (priv->entry))
gtk_cell_renderer_text_editing_done (GTK_CELL_EDITABLE (priv->entry), data);
- GDK_THREADS_LEAVE ();
-
return FALSE;
}
if (priv->entry_menu_popdown_timeout)
return;
- priv->entry_menu_popdown_timeout = g_timeout_add (500, popdown_timeout,
+ priv->entry_menu_popdown_timeout = gdk_threads_add_timeout (500, popdown_timeout,
data);
}
if (priv->in_entry_menu)
return FALSE;
- gtk_cell_renderer_text_editing_done (GTK_CELL_EDITABLE (entry), data);
+ GTK_ENTRY (entry)->editing_canceled = TRUE;
+ gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (entry));
+ gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (entry));
/* entry needs focus-out-event */
return FALSE;