Commit 7c35994b authored by Carlos Garnacho's avatar Carlos Garnacho

Make GtkPaned use GtkStyleContext

parent 760d6d1e
...@@ -182,8 +182,8 @@ static void gtk_paned_realize (GtkWidget *widget); ...@@ -182,8 +182,8 @@ static void gtk_paned_realize (GtkWidget *widget);
static void gtk_paned_unrealize (GtkWidget *widget); static void gtk_paned_unrealize (GtkWidget *widget);
static void gtk_paned_map (GtkWidget *widget); static void gtk_paned_map (GtkWidget *widget);
static void gtk_paned_unmap (GtkWidget *widget); static void gtk_paned_unmap (GtkWidget *widget);
static void gtk_paned_state_changed (GtkWidget *widget, static void gtk_paned_state_flags_changed (GtkWidget *widget,
GtkStateType previous_state); GtkStateFlags previous_state);
static gboolean gtk_paned_draw (GtkWidget *widget, static gboolean gtk_paned_draw (GtkWidget *widget,
cairo_t *cr); cairo_t *cr);
static gboolean gtk_paned_enter (GtkWidget *widget, static gboolean gtk_paned_enter (GtkWidget *widget,
...@@ -299,7 +299,7 @@ gtk_paned_class_init (GtkPanedClass *class) ...@@ -299,7 +299,7 @@ gtk_paned_class_init (GtkPanedClass *class)
widget_class->motion_notify_event = gtk_paned_motion; widget_class->motion_notify_event = gtk_paned_motion;
widget_class->grab_broken_event = gtk_paned_grab_broken; widget_class->grab_broken_event = gtk_paned_grab_broken;
widget_class->grab_notify = gtk_paned_grab_notify; widget_class->grab_notify = gtk_paned_grab_notify;
widget_class->state_changed = gtk_paned_state_changed; widget_class->state_flags_changed = gtk_paned_state_flags_changed;
container_class->add = gtk_paned_add; container_class->add = gtk_paned_add;
container_class->remove = gtk_paned_remove; container_class->remove = gtk_paned_remove;
...@@ -706,8 +706,8 @@ gtk_paned_set_property (GObject *object, ...@@ -706,8 +706,8 @@ gtk_paned_set_property (GObject *object,
else else
priv->cursor_type = GDK_SB_V_DOUBLE_ARROW; priv->cursor_type = GDK_SB_V_DOUBLE_ARROW;
/* state_changed updates the cursor */ /* state_flags_changed updates the cursor */
gtk_paned_state_changed (GTK_WIDGET (paned), gtk_widget_get_state (GTK_WIDGET (paned))); gtk_paned_state_flags_changed (GTK_WIDGET (paned), 0);
gtk_widget_queue_resize (GTK_WIDGET (paned)); gtk_widget_queue_resize (GTK_WIDGET (paned));
break; break;
case PROP_POSITION: case PROP_POSITION:
...@@ -1197,27 +1197,28 @@ gtk_paned_draw (GtkWidget *widget, ...@@ -1197,27 +1197,28 @@ gtk_paned_draw (GtkWidget *widget,
priv->child1 && gtk_widget_get_visible (priv->child1) && priv->child1 && gtk_widget_get_visible (priv->child1) &&
priv->child2 && gtk_widget_get_visible (priv->child2)) priv->child2 && gtk_widget_get_visible (priv->child2))
{ {
GtkStateType state; GtkStyleContext *context;
GtkStateFlags state;
GtkAllocation allocation; GtkAllocation allocation;
gtk_widget_get_allocation (widget, &allocation); gtk_widget_get_allocation (widget, &allocation);
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
if (gtk_widget_is_focus (widget)) if (gtk_widget_is_focus (widget))
state = GTK_STATE_SELECTED; state |= GTK_STATE_FLAG_SELECTED;
else if (priv->handle_prelit) if (priv->handle_prelit)
state = GTK_STATE_PRELIGHT; state |= GTK_STATE_FLAG_PRELIGHT;
else
state = gtk_widget_get_state (widget); gtk_style_context_save (context);
gtk_style_context_set_state (context, state);
gtk_paint_handle (gtk_widget_get_style (widget), gtk_render_handle (context, cr,
cr, priv->handle_pos.x - allocation.x,
state, GTK_SHADOW_NONE, priv->handle_pos.y - allocation.y,
widget, "paned", priv->handle_pos.width,
priv->handle_pos.x - allocation.x, priv->handle_pos.height);
priv->handle_pos.y - allocation.y,
priv->handle_pos.width, gtk_style_context_restore (context);
priv->handle_pos.height,
!priv->orientation);
} }
/* Chain up to draw children */ /* Chain up to draw children */
...@@ -1421,8 +1422,8 @@ gtk_paned_grab_notify (GtkWidget *widget, ...@@ -1421,8 +1422,8 @@ gtk_paned_grab_notify (GtkWidget *widget,
} }
static void static void
gtk_paned_state_changed (GtkWidget *widget, gtk_paned_state_flags_changed (GtkWidget *widget,
GtkStateType previous_state) GtkStateFlags previous_state)
{ {
GtkPaned *paned = GTK_PANED (widget); GtkPaned *paned = GTK_PANED (widget);
GtkPanedPrivate *priv = paned->priv; GtkPanedPrivate *priv = paned->priv;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment