[gimp/gtk3-port: 86/241] app: port to GtkWidget::draw()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 86/241] app: port to GtkWidget::draw()
- Date: Wed, 16 Feb 2011 22:25:56 +0000 (UTC)
commit c5502d25977839db476053339f9d91c8a16d39f8
Author: Michael Natterer <mitch gimp org>
Date: Tue Oct 19 20:26:16 2010 +0200
app: port to GtkWidget::draw()
app/display/gimpstatusbar.c | 22 +++++++---------------
1 files changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c
index 2d2ac22..e27a920 100644
--- a/app/display/gimpstatusbar.c
+++ b/app/display/gimpstatusbar.c
@@ -97,8 +97,8 @@ static gboolean gimp_statusbar_progress_message (GimpProgress *progress,
static void gimp_statusbar_progress_canceled (GtkWidget *button,
GimpStatusbar *statusbar);
-static gboolean gimp_statusbar_label_expose (GtkWidget *widget,
- GdkEventExpose *event,
+static gboolean gimp_statusbar_label_draw (GtkWidget *widget,
+ cairo_t *cr,
GimpStatusbar *statusbar);
static void gimp_statusbar_update (GimpStatusbar *statusbar);
@@ -227,8 +227,8 @@ gimp_statusbar_init (GimpStatusbar *statusbar)
g_object_unref (statusbar->label);
- g_signal_connect_after (statusbar->label, "expose-event",
- G_CALLBACK (gimp_statusbar_label_expose),
+ g_signal_connect_after (statusbar->label, "draw",
+ G_CALLBACK (gimp_statusbar_label_draw),
statusbar);
statusbar->progressbar = g_object_new (GTK_TYPE_PROGRESS_BAR,
@@ -1320,21 +1320,15 @@ gimp_statusbar_clear_cursor (GimpStatusbar *statusbar)
/* private functions */
static gboolean
-gimp_statusbar_label_expose (GtkWidget *widget,
- GdkEventExpose *event,
- GimpStatusbar *statusbar)
+gimp_statusbar_label_draw (GtkWidget *widget,
+ cairo_t *cr,
+ GimpStatusbar *statusbar)
{
if (statusbar->icon)
{
- cairo_t *cr;
PangoRectangle rect;
gint x, y;
- cr = gdk_cairo_create (event->window);
-
- gdk_cairo_region (cr, event->region);
- cairo_clip (cr);
-
gtk_label_get_layout_offsets (GTK_LABEL (widget), &x, &y);
pango_layout_index_to_pos (gtk_label_get_layout (GTK_LABEL (widget)), 0,
@@ -1347,8 +1341,6 @@ gimp_statusbar_label_expose (GtkWidget *widget,
gdk_cairo_set_source_pixbuf (cr, statusbar->icon, x, y);
cairo_paint (cr);
-
- cairo_destroy (cr);
}
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]