[gimp] app: use pango_cairo_show_layout() instead of a GdkPangoRenderer
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: use pango_cairo_show_layout() instead of a GdkPangoRenderer
- Date: Wed, 20 Oct 2010 17:25:23 +0000 (UTC)
commit 7cfda8cc3335237bd720a1fe45d457eb09473561
Author: Michael Natterer <mitch gimp org>
Date: Wed Oct 20 19:25:03 2010 +0200
app: use pango_cairo_show_layout() instead of a GdkPangoRenderer
app/widgets/gimptagpopup.c | 38 +++++++++++---------------------------
1 files changed, 11 insertions(+), 27 deletions(-)
---
diff --git a/app/widgets/gimptagpopup.c b/app/widgets/gimptagpopup.c
index 3a3d879..11ea794 100644
--- a/app/widgets/gimptagpopup.c
+++ b/app/widgets/gimptagpopup.c
@@ -747,7 +747,6 @@ gimp_tag_popup_list_expose (GtkWidget *widget,
GdkWindow *window = gtk_widget_get_window (widget);
GtkStyle *style = gtk_widget_get_style (widget);
cairo_t *cr;
- PangoRenderer *renderer;
PangoAttribute *attribute;
PangoAttrList *attributes;
gint i;
@@ -759,12 +758,6 @@ gimp_tag_popup_list_expose (GtkWidget *widget,
cairo_set_line_width (cr, 1.0);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
- gdk_cairo_set_source_color (cr, &popup->combo_entry->selected_item_color);
-
- renderer = gdk_pango_renderer_get_default (gtk_widget_get_screen (widget));
- gdk_pango_renderer_set_gc (GDK_PANGO_RENDERER (renderer),
- style->black_gc);
- gdk_pango_renderer_set_drawable (GDK_PANGO_RENDERER (renderer), window);
for (i = 0; i < popup->tag_count; i++)
{
@@ -800,6 +793,9 @@ gimp_tag_popup_list_expose (GtkWidget *widget,
if (tag_data->state == GTK_STATE_SELECTED)
{
+ gdk_cairo_set_source_color (cr,
+ &popup->combo_entry->selected_item_color);
+
cairo_rectangle (cr,
tag_data->bounds.x - 1,
tag_data->bounds.y - popup->scroll_y,
@@ -828,23 +824,14 @@ gimp_tag_popup_list_expose (GtkWidget *widget,
cairo_translate (cr, -0.5, -0.5);
}
- pango_renderer_draw_layout (renderer, popup->layout,
- (tag_data->bounds.x +
- GIMP_TAG_POPUP_PADDING) * PANGO_SCALE,
- (tag_data->bounds.y -
- popup->scroll_y +
- GIMP_TAG_POPUP_PADDING) * PANGO_SCALE);
-
-#if 0
- gtk_paint_layout (style, window,
- tag_data->state,
- TRUE,
- &event->area, widget, NULL,
- tag_data->bounds.x + GIMP_TAG_POPUP_PADDING,
- tag_data->bounds.y - popup->scroll_y +
- GIMP_TAG_POPUP_PADDING,
- popup->layout);
-#endif
+ cairo_move_to (cr,
+ (tag_data->bounds.x +
+ GIMP_TAG_POPUP_PADDING),
+ (tag_data->bounds.y -
+ popup->scroll_y +
+ GIMP_TAG_POPUP_PADDING));
+
+ pango_cairo_show_layout (cr, popup->layout);
if (tag_data == popup->prelight &&
tag_data->state != GTK_STATE_INSENSITIVE &&
@@ -860,9 +847,6 @@ gimp_tag_popup_list_expose (GtkWidget *widget,
}
}
- gdk_pango_renderer_set_drawable (GDK_PANGO_RENDERER (renderer), NULL);
- gdk_pango_renderer_set_gc (GDK_PANGO_RENDERER (renderer), NULL);
-
cairo_destroy (cr);
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]