[gnome-control-center] A couple more updates use the GTK3 drawing APIs
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] A couple more updates use the GTK3 drawing APIs
- Date: Sat, 2 Oct 2010 21:46:07 +0000 (UTC)
commit 533b044dc9e0f3f198250b00cf8fcce3be50b4b3
Author: William Jon McCann <jmccann redhat com>
Date: Sat Oct 2 17:45:40 2010 -0400
A couple more updates use the GTK3 drawing APIs
panels/background/cc-background-panel.c | 12 ++++--------
shell/shell-search-renderer.c | 8 +-------
2 files changed, 5 insertions(+), 15 deletions(-)
---
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index 200c141..9be9057 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -470,11 +470,10 @@ backgrounds_changed_cb (GtkIconView *icon_view,
}
static gboolean
-preview_expose_cb (GtkWidget *widget,
- GdkEventExpose *expose,
- CcBackgroundPanel *panel)
+preview_draw_cb (GtkWidget *widget,
+ cairo_t *cr,
+ CcBackgroundPanel *panel)
{
- cairo_t *cr;
GtkAllocation allocation;
CcBackgroundPanelPrivate *priv = panel->priv;
GdkPixbuf *pixbuf = NULL;
@@ -485,8 +484,6 @@ preview_expose_cb (GtkWidget *widget,
GdkPixbuf *preview, *temp;
gint size;
- cr = gdk_cairo_create (gtk_widget_get_window (widget));
-
gtk_widget_get_allocation (widget, &allocation);
if (priv->current_background)
@@ -536,7 +533,6 @@ preview_expose_cb (GtkWidget *widget,
allocation.width / 2 - (size / 2),
allocation.height / 2 - (size / 2));
cairo_paint (cr);
- cairo_destroy (cr);
g_object_unref (temp);
g_object_unref (preview);
@@ -687,7 +683,7 @@ cc_background_panel_init (CcBackgroundPanel *self)
/* setup preview area */
widget = WID ("preview-area");
- g_signal_connect (widget, "expose-event", G_CALLBACK (preview_expose_cb),
+ g_signal_connect (widget, "draw", G_CALLBACK (preview_draw_cb),
self);
priv->display_base = gdk_pixbuf_new_from_file (DATADIR "/display-base.png",
diff --git a/shell/shell-search-renderer.c b/shell/shell-search-renderer.c
index 08cada5..ef0b997 100644
--- a/shell/shell-search-renderer.c
+++ b/shell/shell-search-renderer.c
@@ -219,21 +219,17 @@ shell_search_renderer_get_size (GtkCellRenderer *cell,
static void
shell_search_renderer_render (GtkCellRenderer *cell,
- GdkDrawable *window,
+ cairo_t *cr,
GtkWidget *widget,
GdkRectangle *background_area,
GdkRectangle *cell_area,
- GdkRectangle *expose_area,
GtkCellRendererState flags)
{
ShellSearchRendererPrivate *priv = SHELL_SEARCH_RENDERER (cell)->priv;
- cairo_t *cr;
PangoRectangle rect;
shell_search_renderer_set_layout (SHELL_SEARCH_RENDERER (cell), widget);
- cr = gdk_cairo_create (window);
-
pango_layout_get_pixel_extents (priv->layout, NULL, &rect);
cairo_move_to (cr, cell_area->x, cell_area->y);
@@ -243,8 +239,6 @@ shell_search_renderer_render (GtkCellRenderer *cell,
if (priv->layout)
pango_cairo_layout_path (cr, priv->layout);
cairo_fill (cr);
-
- cairo_destroy (cr);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]