forked from AuroraMiddleware/gtk
add a single-paragraph-mode property, use private instance data. (Fixes
Thu Dec 18 00:24:32 2003 Kristian Rietveld <kris@gtk.org> * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_class_init), (gtk_cell_renderer_text_get_property), (gtk_cell_renderer_text_set_property), (get_layout): add a single-paragraph-mode property, use private instance data. (Fixes #114943, reported by Morten Welinder).
This commit is contained in:
parent
4891296311
commit
62a15f2ae1
@ -1,3 +1,11 @@
|
|||||||
|
Thu Dec 18 00:24:32 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_class_init),
|
||||||
|
(gtk_cell_renderer_text_get_property),
|
||||||
|
(gtk_cell_renderer_text_set_property), (get_layout): add a
|
||||||
|
single-paragraph-mode property, use private instance data.
|
||||||
|
(Fixes #114943, reported by Morten Welinder).
|
||||||
|
|
||||||
Thu Dec 18 00:07:01 2003 Kristian Rietveld <kris@gtk.org>
|
Thu Dec 18 00:07:01 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
* gtk/gtktreemodel.h (gtk_tree_path_new_root),
|
* gtk/gtktreemodel.h (gtk_tree_path_new_root),
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
Thu Dec 18 00:24:32 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_class_init),
|
||||||
|
(gtk_cell_renderer_text_get_property),
|
||||||
|
(gtk_cell_renderer_text_set_property), (get_layout): add a
|
||||||
|
single-paragraph-mode property, use private instance data.
|
||||||
|
(Fixes #114943, reported by Morten Welinder).
|
||||||
|
|
||||||
Thu Dec 18 00:07:01 2003 Kristian Rietveld <kris@gtk.org>
|
Thu Dec 18 00:07:01 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
* gtk/gtktreemodel.h (gtk_tree_path_new_root),
|
* gtk/gtktreemodel.h (gtk_tree_path_new_root),
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
Thu Dec 18 00:24:32 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_class_init),
|
||||||
|
(gtk_cell_renderer_text_get_property),
|
||||||
|
(gtk_cell_renderer_text_set_property), (get_layout): add a
|
||||||
|
single-paragraph-mode property, use private instance data.
|
||||||
|
(Fixes #114943, reported by Morten Welinder).
|
||||||
|
|
||||||
Thu Dec 18 00:07:01 2003 Kristian Rietveld <kris@gtk.org>
|
Thu Dec 18 00:07:01 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
* gtk/gtktreemodel.h (gtk_tree_path_new_root),
|
* gtk/gtktreemodel.h (gtk_tree_path_new_root),
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
Thu Dec 18 00:24:32 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_class_init),
|
||||||
|
(gtk_cell_renderer_text_get_property),
|
||||||
|
(gtk_cell_renderer_text_set_property), (get_layout): add a
|
||||||
|
single-paragraph-mode property, use private instance data.
|
||||||
|
(Fixes #114943, reported by Morten Welinder).
|
||||||
|
|
||||||
Thu Dec 18 00:07:01 2003 Kristian Rietveld <kris@gtk.org>
|
Thu Dec 18 00:07:01 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
* gtk/gtktreemodel.h (gtk_tree_path_new_root),
|
* gtk/gtktreemodel.h (gtk_tree_path_new_root),
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
Thu Dec 18 00:24:32 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_class_init),
|
||||||
|
(gtk_cell_renderer_text_get_property),
|
||||||
|
(gtk_cell_renderer_text_set_property), (get_layout): add a
|
||||||
|
single-paragraph-mode property, use private instance data.
|
||||||
|
(Fixes #114943, reported by Morten Welinder).
|
||||||
|
|
||||||
Thu Dec 18 00:07:01 2003 Kristian Rietveld <kris@gtk.org>
|
Thu Dec 18 00:07:01 2003 Kristian Rietveld <kris@gtk.org>
|
||||||
|
|
||||||
* gtk/gtktreemodel.h (gtk_tree_path_new_root),
|
* gtk/gtktreemodel.h (gtk_tree_path_new_root),
|
||||||
|
@ -71,6 +71,7 @@ enum {
|
|||||||
PROP_TEXT,
|
PROP_TEXT,
|
||||||
PROP_MARKUP,
|
PROP_MARKUP,
|
||||||
PROP_ATTRIBUTES,
|
PROP_ATTRIBUTES,
|
||||||
|
PROP_SINGLE_PARAGRAPH_MODE,
|
||||||
|
|
||||||
/* Style args */
|
/* Style args */
|
||||||
PROP_BACKGROUND,
|
PROP_BACKGROUND,
|
||||||
@ -113,6 +114,15 @@ static guint text_cell_renderer_signals [LAST_SIGNAL];
|
|||||||
|
|
||||||
#define GTK_CELL_RENDERER_TEXT_PATH "gtk-cell-renderer-text-path"
|
#define GTK_CELL_RENDERER_TEXT_PATH "gtk-cell-renderer-text-path"
|
||||||
|
|
||||||
|
#define GTK_CELL_RENDERER_TEXT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_CELL_RENDERER_TEXT, GtkCellRendererTextPrivate))
|
||||||
|
|
||||||
|
typedef struct _GtkCellRendererTextPrivate GtkCellRendererTextPrivate;
|
||||||
|
struct _GtkCellRendererTextPrivate
|
||||||
|
{
|
||||||
|
guint single_paragraph : 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
GType
|
GType
|
||||||
gtk_cell_renderer_text_get_type (void)
|
gtk_cell_renderer_text_get_type (void)
|
||||||
{
|
{
|
||||||
@ -192,6 +202,15 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
|
|||||||
_("A list of style attributes to apply to the text of the renderer"),
|
_("A list of style attributes to apply to the text of the renderer"),
|
||||||
PANGO_TYPE_ATTR_LIST,
|
PANGO_TYPE_ATTR_LIST,
|
||||||
G_PARAM_READWRITE));
|
G_PARAM_READWRITE));
|
||||||
|
|
||||||
|
g_object_class_install_property (object_class,
|
||||||
|
PROP_SINGLE_PARAGRAPH_MODE,
|
||||||
|
g_param_spec_boolean ("single_paragraph_mode",
|
||||||
|
_("Single Paragraph Mode"),
|
||||||
|
_("Whether or not to keep all text in a single paragraph"),
|
||||||
|
FALSE,
|
||||||
|
G_PARAM_READWRITE));
|
||||||
|
|
||||||
|
|
||||||
g_object_class_install_property (object_class,
|
g_object_class_install_property (object_class,
|
||||||
PROP_BACKGROUND,
|
PROP_BACKGROUND,
|
||||||
@ -421,6 +440,7 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
|
|||||||
G_TYPE_STRING,
|
G_TYPE_STRING,
|
||||||
G_TYPE_STRING);
|
G_TYPE_STRING);
|
||||||
|
|
||||||
|
g_type_class_add_private (object_class, sizeof (GtkCellRendererTextPrivate));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -468,6 +488,9 @@ gtk_cell_renderer_text_get_property (GObject *object,
|
|||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
GtkCellRendererText *celltext = GTK_CELL_RENDERER_TEXT (object);
|
GtkCellRendererText *celltext = GTK_CELL_RENDERER_TEXT (object);
|
||||||
|
GtkCellRendererTextPrivate *priv;
|
||||||
|
|
||||||
|
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (object);
|
||||||
|
|
||||||
switch (param_id)
|
switch (param_id)
|
||||||
{
|
{
|
||||||
@ -479,6 +502,10 @@ gtk_cell_renderer_text_get_property (GObject *object,
|
|||||||
g_value_set_boxed (value, celltext->extra_attrs);
|
g_value_set_boxed (value, celltext->extra_attrs);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_SINGLE_PARAGRAPH_MODE:
|
||||||
|
g_value_set_boolean (value, priv->single_paragraph);
|
||||||
|
break;
|
||||||
|
|
||||||
case PROP_BACKGROUND_GDK:
|
case PROP_BACKGROUND_GDK:
|
||||||
{
|
{
|
||||||
GdkColor color;
|
GdkColor color;
|
||||||
@ -801,6 +828,9 @@ gtk_cell_renderer_text_set_property (GObject *object,
|
|||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
GtkCellRendererText *celltext = GTK_CELL_RENDERER_TEXT (object);
|
GtkCellRendererText *celltext = GTK_CELL_RENDERER_TEXT (object);
|
||||||
|
GtkCellRendererTextPrivate *priv;
|
||||||
|
|
||||||
|
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (object);
|
||||||
|
|
||||||
switch (param_id)
|
switch (param_id)
|
||||||
{
|
{
|
||||||
@ -851,6 +881,10 @@ gtk_cell_renderer_text_set_property (GObject *object,
|
|||||||
celltext->extra_attrs = attrs;
|
celltext->extra_attrs = attrs;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_SINGLE_PARAGRAPH_MODE:
|
||||||
|
priv->single_paragraph = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
|
||||||
case PROP_BACKGROUND:
|
case PROP_BACKGROUND:
|
||||||
{
|
{
|
||||||
@ -1102,6 +1136,9 @@ get_layout (GtkCellRendererText *celltext,
|
|||||||
PangoAttrList *attr_list;
|
PangoAttrList *attr_list;
|
||||||
PangoLayout *layout;
|
PangoLayout *layout;
|
||||||
PangoUnderline uline;
|
PangoUnderline uline;
|
||||||
|
GtkCellRendererTextPrivate *priv;
|
||||||
|
|
||||||
|
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (celltext);
|
||||||
|
|
||||||
layout = gtk_widget_create_pango_layout (widget, celltext->text);
|
layout = gtk_widget_create_pango_layout (widget, celltext->text);
|
||||||
|
|
||||||
@ -1110,6 +1147,8 @@ get_layout (GtkCellRendererText *celltext,
|
|||||||
else
|
else
|
||||||
attr_list = pango_attr_list_new ();
|
attr_list = pango_attr_list_new ();
|
||||||
|
|
||||||
|
pango_layout_set_single_paragraph_mode (layout, priv->single_paragraph);
|
||||||
|
|
||||||
if (will_render)
|
if (will_render)
|
||||||
{
|
{
|
||||||
/* Add options that affect appearance but not size */
|
/* Add options that affect appearance but not size */
|
||||||
|
Loading…
Reference in New Issue
Block a user