Commit 203029e4 authored by Andre Miranda's avatar Andre Miranda Committed by Alexander Schwinn

Fix standard view border during drag and drop (Bug #14523)

Also make gtk_render_frame work properly, so there's no
need to use cairo directly.
parent a5b9d1c1
......@@ -585,8 +585,10 @@ thunar_application_load_css (void)
gtk_css_provider_load_from_data (css_provider, ".path-bar-button { margin-right: 0; }"
/* remove extra border between side pane and view */
/* also make border thicker during DnD */
".shortcuts-pane { border-right-width: 0px; }"
".standard-view { border-left-width: 0px; }", -1, NULL);
".standard-view { border-left-width: 0px; }"
".standard-view:drop(active) { border-width: 2px; }", -1, NULL);
screen = gdk_screen_get_default ();
gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (css_provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref (css_provider);
......
......@@ -1111,6 +1111,7 @@ thunar_standard_view_draw (GtkWidget *widget,
{
gboolean result = FALSE;
GtkAllocation a;
GtkStyleContext *context;
/* let the scrolled window do it's work */
cairo_save (cr);
......@@ -1122,14 +1123,12 @@ thunar_standard_view_draw (GtkWidget *widget,
{
gtk_widget_get_allocation (widget, &a);
gtk_render_frame (gtk_widget_get_style_context (widget),
cr, a.x, a.y, a.width, a.height);
context = gtk_widget_get_style_context (widget);
/* the cairo version looks better here, so we use it if possible */
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
cairo_set_line_width (cr, 1.0);
cairo_rectangle (cr, a.x + 0.5, a.y + 0.5, a.width - 1, a.height - 1);
cairo_stroke (cr);
gtk_style_context_save (context);
gtk_style_context_set_state (context, GTK_STATE_FLAG_DROP_ACTIVE);
gtk_render_frame (context, cr, 0, 0, a.width, a.height);
gtk_style_context_restore (context);
}
return result;
......
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