[Xfce4-commits] [xfce/thunar] 04/06: Fix standard view border during drag and drop (Bug #14523)

noreply at xfce.org noreply at xfce.org
Wed Jul 18 22:07:32 CEST 2018


This is an automated email from the git hooks/post-receive script.

a   l   e   x       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       x   f   c   e   -   4   .   1   4   
   in repository xfce/thunar.

commit 203029e4dd1bf1b132e15f4b9b79e93ef269e48f
Author: Andre Miranda <andreldm at xfce.org>
Date:   Mon Jul 16 13:04:13 2018 -0300

    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.
---
 thunar/thunar-application.c   |  4 +++-
 thunar/thunar-standard-view.c | 13 ++++++-------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c
index 01c03f1..d26364c 100644
--- a/thunar/thunar-application.c
+++ b/thunar/thunar-application.c
@@ -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);
diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c
index 09c802b..539f6a9 100644
--- a/thunar/thunar-standard-view.c
+++ b/thunar/thunar-standard-view.c
@@ -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;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list