Don't use the foreground color for selected cells, Don't use the
2004-11-16 Matthias Clasen <mclasen@redhat.com> * gtk/gtkcellrenderertext.c (get_layout): Don't use the foreground color for selected cells, Don't use the background color in unfocused selected cells. Also avoid creating two PangoLayouts per render call. (#154615, #154611, Billy Biggs)
This commit is contained in:

committed by
Matthias Clasen

parent
f0265b018e
commit
e23cf6361d
@ -1,3 +1,10 @@
|
|||||||
|
2004-11-16 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkcellrenderertext.c (get_layout): Don't use the foreground
|
||||||
|
color for selected cells, Don't use the background color
|
||||||
|
in unfocused selected cells. Also avoid creating two PangoLayouts
|
||||||
|
per render call. (#154615, #154611, Billy Biggs)
|
||||||
|
|
||||||
Mon Nov 15 19:02:07 2004 Manish Singh <yosh@gimp.org>
|
Mon Nov 15 19:02:07 2004 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
* gdk/abicheck.sh
|
* gdk/abicheck.sh
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2004-11-16 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkcellrenderertext.c (get_layout): Don't use the foreground
|
||||||
|
color for selected cells, Don't use the background color
|
||||||
|
in unfocused selected cells. Also avoid creating two PangoLayouts
|
||||||
|
per render call. (#154615, #154611, Billy Biggs)
|
||||||
|
|
||||||
Mon Nov 15 19:02:07 2004 Manish Singh <yosh@gimp.org>
|
Mon Nov 15 19:02:07 2004 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
* gdk/abicheck.sh
|
* gdk/abicheck.sh
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2004-11-16 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkcellrenderertext.c (get_layout): Don't use the foreground
|
||||||
|
color for selected cells, Don't use the background color
|
||||||
|
in unfocused selected cells. Also avoid creating two PangoLayouts
|
||||||
|
per render call. (#154615, #154611, Billy Biggs)
|
||||||
|
|
||||||
Mon Nov 15 19:02:07 2004 Manish Singh <yosh@gimp.org>
|
Mon Nov 15 19:02:07 2004 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
* gdk/abicheck.sh
|
* gdk/abicheck.sh
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2004-11-16 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkcellrenderertext.c (get_layout): Don't use the foreground
|
||||||
|
color for selected cells, Don't use the background color
|
||||||
|
in unfocused selected cells. Also avoid creating two PangoLayouts
|
||||||
|
per render call. (#154615, #154611, Billy Biggs)
|
||||||
|
|
||||||
Mon Nov 15 19:02:07 2004 Manish Singh <yosh@gimp.org>
|
Mon Nov 15 19:02:07 2004 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
* gdk/abicheck.sh
|
* gdk/abicheck.sh
|
||||||
|
@ -1258,7 +1258,8 @@ get_layout (GtkCellRendererText *celltext,
|
|||||||
* background_area not the PangoLayout area
|
* background_area not the PangoLayout area
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (celltext->foreground_set)
|
if (celltext->foreground_set
|
||||||
|
&& (flags & GTK_CELL_RENDERER_SELECTED) == 0)
|
||||||
{
|
{
|
||||||
PangoColor color;
|
PangoColor color;
|
||||||
|
|
||||||
@ -1324,17 +1325,17 @@ get_layout (GtkCellRendererText *celltext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_cell_renderer_text_get_size (GtkCellRenderer *cell,
|
get_size (GtkCellRenderer *cell,
|
||||||
GtkWidget *widget,
|
GtkWidget *widget,
|
||||||
GdkRectangle *cell_area,
|
GdkRectangle *cell_area,
|
||||||
gint *x_offset,
|
PangoLayout *layout,
|
||||||
gint *y_offset,
|
gint *x_offset,
|
||||||
gint *width,
|
gint *y_offset,
|
||||||
gint *height)
|
gint *width,
|
||||||
|
gint *height)
|
||||||
{
|
{
|
||||||
GtkCellRendererText *celltext = (GtkCellRendererText *) cell;
|
GtkCellRendererText *celltext = (GtkCellRendererText *) cell;
|
||||||
PangoRectangle rect;
|
PangoRectangle rect;
|
||||||
PangoLayout *layout;
|
|
||||||
GtkCellRendererTextPrivate *priv;
|
GtkCellRendererTextPrivate *priv;
|
||||||
|
|
||||||
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
|
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
|
||||||
@ -1378,7 +1379,10 @@ gtk_cell_renderer_text_get_size (GtkCellRenderer *cell,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
layout = get_layout (celltext, widget, FALSE, 0);
|
if (layout)
|
||||||
|
g_object_ref (layout);
|
||||||
|
else
|
||||||
|
layout = get_layout (celltext, widget, FALSE, 0);
|
||||||
|
|
||||||
pango_layout_get_pixel_extents (layout, NULL, &rect);
|
pango_layout_get_pixel_extents (layout, NULL, &rect);
|
||||||
|
|
||||||
@ -1430,6 +1434,20 @@ gtk_cell_renderer_text_get_size (GtkCellRenderer *cell,
|
|||||||
g_object_unref (layout);
|
g_object_unref (layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
gtk_cell_renderer_text_get_size (GtkCellRenderer *cell,
|
||||||
|
GtkWidget *widget,
|
||||||
|
GdkRectangle *cell_area,
|
||||||
|
gint *x_offset,
|
||||||
|
gint *y_offset,
|
||||||
|
gint *width,
|
||||||
|
gint *height)
|
||||||
|
{
|
||||||
|
get_size (cell, widget, cell_area, NULL,
|
||||||
|
x_offset, y_offset, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_cell_renderer_text_render (GtkCellRenderer *cell,
|
gtk_cell_renderer_text_render (GtkCellRenderer *cell,
|
||||||
GdkDrawable *window,
|
GdkDrawable *window,
|
||||||
@ -1450,8 +1468,7 @@ gtk_cell_renderer_text_render (GtkCellRenderer *cell,
|
|||||||
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
|
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
|
||||||
|
|
||||||
layout = get_layout (celltext, widget, TRUE, flags);
|
layout = get_layout (celltext, widget, TRUE, flags);
|
||||||
|
get_size (cell, widget, cell_area, layout, &x_offset, &y_offset, NULL, NULL);
|
||||||
gtk_cell_renderer_text_get_size (cell, widget, cell_area, &x_offset, &y_offset, NULL, NULL);
|
|
||||||
|
|
||||||
if (!cell->sensitive)
|
if (!cell->sensitive)
|
||||||
{
|
{
|
||||||
@ -1477,7 +1494,8 @@ gtk_cell_renderer_text_render (GtkCellRenderer *cell,
|
|||||||
state = GTK_STATE_NORMAL;
|
state = GTK_STATE_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (celltext->background_set && state != GTK_STATE_SELECTED)
|
if (celltext->background_set &&
|
||||||
|
(flags & GTK_CELL_RENDERER_SELECTED) == 0)
|
||||||
{
|
{
|
||||||
GdkColor color;
|
GdkColor color;
|
||||||
GdkGC *gc;
|
GdkGC *gc;
|
||||||
|
Reference in New Issue
Block a user