[nautilus/wip/antoniof/list-view-dnd-hover-style-fixes: 181/181] css: Don't conflict with drop target visual feedback




commit 8d567c58916b6d84bc60084ab8351eac41af0d44
Author: António Fernandes <antoniof gnome org>
Date:   Sun Jun 21 15:35:48 2020 +0100

    css: Don't conflict with drop target visual feedback
    
    While dragging items over the list view, the row which accepts drops in
    the current pointer position has its top border highlighted, but not the
    bottom border, as indended by the default stylesheet.
    
    This had already been fixed.[1] The regression happened because GTK has
    stopped using .dnd style class, instead using :drop(active).[2]
    
    The previous fix ([1]) consisted in not highlighting any border at all,
    with the rationale that "we already modify the icon to hint about dnd".
    This is based on the assumptions that:
    
        1. folder icons change to the folder-open icon;
        2. folders are the only drop targets.
    
    But these assumptions do not hold:
    
        1. the folder-open icon is not used if a folder has a custom image
           instead of the default icon, or if a thumbnailer is installed;
        2. some non-folder items, such as archive files, accept drops too.
    
    So let's fix this the other way around: highlighting both borders,
    above and below, as intended by the default stylesheet.
    
    Closes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1525
    
    [1] https://gitlab.gnome.org/GNOME/nautilus/-/commit/4963cd7d564b633299f8e31bb8ac10f67eae6477
    [2] https://gitlab.gnome.org/GNOME/gtk/-/commit/12c5ca5c013e035374ad1590b0e64cb7a452aa30

 src/resources/css/Adwaita.css | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css
index 546d3e98a..26a86cd18 100644
--- a/src/resources/css/Adwaita.css
+++ b/src/resources/css/Adwaita.css
@@ -158,8 +158,10 @@ entry.search > * {
     color: shade(@disk_space_free, 0.7);
 }
 
-/* View */
-.nautilus-list-view .view {
+/* As a workaround for GtkTreeView showing thick border above first row when
+ * horizontal grid lines are enabled, we add them using CSS instead. Exclude the
+ * drop targets to let through the default feedback style. */
+.nautilus-list-view .view:not(:drop(active)) {
     border-bottom: 1px solid @theme_bg_color;
 }
 
@@ -169,11 +171,6 @@ entry.search > * {
   padding:2px;
 }
 
-/* Hide superfluous treeview drop target indication */
-.nautilus-list-view .view.dnd {
-    border-style: none;
-}
-
 @define-color conflict_bg #fef6b6;
 
 .conflict-row {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]