&& xpaned->bottom_right_child
&& gtk_widget_get_visible (xpaned->bottom_right_child))
{
- GtkStateType state;
+ GtkStyleContext *context;
- if (gtk_widget_is_focus (widget))
- state = GTK_STATE_SELECTED;
- else if (xpaned->handle_prelit)
- state = GTK_STATE_PRELIGHT;
- else
- state = gtk_widget_get_state (widget);
-
- gtk_paint_handle (gtk_widget_get_style (widget),
- cr,
- state,
- GTK_SHADOW_NONE,
- widget,
- "paned",
- xpaned->handle_pos_east.x - handle_size - 256 / 2,
- xpaned->handle_pos_west.y + 1,
- 256 + handle_size, handle_size - 2,
- /*xpaned->handle_pos_west.x,
- xpaned->handle_pos_west.y + 1,
- xpaned->handle_pos_west.width + handle_size + xpaned->handle_pos_east.width,
- handle_size - 2, */
- GTK_ORIENTATION_HORIZONTAL);
-
- gtk_paint_handle (gtk_widget_get_style (widget),
- cr,
- state,
- GTK_SHADOW_NONE,
- widget,
- "paned",
- xpaned->handle_pos_north.x + 1,
- xpaned->handle_pos_south.y - handle_size - 256 / 2,
- handle_size - 2, 256 + handle_size,
- /*xpaned->handle_pos_north.x + 1,
- xpaned->handle_pos_north.y,
- handle_size - 2,
- xpaned->handle_pos_north.height + handle_size + xpaned->handle_pos_south.height, */
- GTK_ORIENTATION_VERTICAL);
+ context = gtk_widget_get_style_context (widget);
+ gtk_render_handle (context, cr,
+ xpaned->handle_pos_east.x - handle_size - 256 / 2,
+ xpaned->handle_pos_west.y + 1,
+ 256 + handle_size, handle_size - 2);
+
+ gtk_render_handle (context, cr,
+ xpaned->handle_pos_north.x + 1,
+ xpaned->handle_pos_south.y - handle_size - 256 / 2,
+ handle_size - 2, 256 + handle_size);
}
/* Chain up to draw children */
update_drag (GtkXPaned * xpaned)
{
GdkPoint pos;
+ GtkWidget *widget = GTK_WIDGET (xpaned);
gint handle_size;
GtkRequisition size;
GtkAllocation allocation;
- gtk_widget_get_allocation (GTK_WIDGET (xpaned), &allocation);
- gtk_widget_get_pointer (GTK_WIDGET (xpaned), &pos.x, &pos.y);
+ gtk_widget_get_allocation (widget, &allocation);
+
+ gdk_window_get_device_position (gtk_widget_get_window (widget),
+ gdk_device_manager_get_client_pointer (
+ gdk_display_get_device_manager (
+ gtk_widget_get_display (widget))),
+ &pos.x, &pos.y, NULL);
if (xpaned->in_drag_vert)
{
if (is_rtl (xpaned))
{
- gtk_widget_style_get (GTK_WIDGET (xpaned),
- "handle-size", &handle_size, NULL);
+ gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
size.height = allocation.height - pos.y - handle_size;
}
if (is_rtl (xpaned))
{
- gtk_widget_style_get (GTK_WIDGET (xpaned),
- "handle-size", &handle_size, NULL);
+ gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
size.width = allocation.width - pos.x - handle_size;
}
if (is_rtl (xpaned))
{
- gtk_widget_style_get (GTK_WIDGET (xpaned),
- "handle-size", &handle_size, NULL);
+ gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
size.width = allocation.width - pos.x - handle_size;
size.height = allocation.height - pos.y - handle_size;