[gnome-panel/gtk3] panel-applet-frame: Use gtk_render_handle() instead of gtk_paint_handle()
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel/gtk3] panel-applet-frame: Use gtk_render_handle() instead of gtk_paint_handle()
- Date: Fri, 21 Jan 2011 14:20:29 +0000 (UTC)
commit 0dc1773bd599d0cdcae2198ced7fa6d394fb759d
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Fri Jan 21 15:19:58 2011 +0100
panel-applet-frame: Use gtk_render_handle() instead of gtk_paint_handle()
gnome-panel/panel-applet-frame.c | 41 +++++++++++++------------------------
1 files changed, 15 insertions(+), 26 deletions(-)
---
diff --git a/gnome-panel/panel-applet-frame.c b/gnome-panel/panel-applet-frame.c
index fa60ba9..be65965 100644
--- a/gnome-panel/panel-applet-frame.c
+++ b/gnome-panel/panel-applet-frame.c
@@ -95,38 +95,27 @@ panel_applet_frame_draw (GtkWidget *widget,
cairo_t *cr)
{
PanelAppletFrame *frame = PANEL_APPLET_FRAME (widget);
- GtkOrientation orientation = GTK_ORIENTATION_HORIZONTAL;
+ GtkStyleContext *context;
if (GTK_WIDGET_CLASS (panel_applet_frame_parent_class)->draw)
GTK_WIDGET_CLASS (panel_applet_frame_parent_class)->draw (widget, cr);
if (!frame->priv->has_handle)
return FALSE;
-
- switch (frame->priv->orientation) {
- case PANEL_ORIENTATION_TOP:
- case PANEL_ORIENTATION_BOTTOM:
- orientation = GTK_ORIENTATION_VERTICAL;
- break;
- case PANEL_ORIENTATION_LEFT:
- case PANEL_ORIENTATION_RIGHT:
- orientation = GTK_ORIENTATION_HORIZONTAL;
- break;
- default:
- g_assert_not_reached ();
- break;
- }
-
- gtk_paint_handle (gtk_widget_get_style (widget),
- cr,
- gtk_widget_get_state (widget),
- GTK_SHADOW_OUT,
- widget, "handlebox",
- frame->priv->handle_rect.x,
- frame->priv->handle_rect.y,
- frame->priv->handle_rect.width,
- frame->priv->handle_rect.height,
- orientation);
+
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_save (context);
+ gtk_style_context_set_state (context, gtk_widget_get_state_flags (widget));
+
+ cairo_save (cr);
+ gtk_render_handle (context, cr,
+ frame->priv->handle_rect.x,
+ frame->priv->handle_rect.y,
+ frame->priv->handle_rect.width,
+ frame->priv->handle_rect.height);
+ cairo_restore (cr);
+
+ gtk_style_context_restore (context);
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]