summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2020-06-21 15:35:48 +0100
committerAntónio Fernandes <antoniojpfernandes@gmail.com>2020-12-23 00:42:48 +0000
commit8d567c58916b6d84bc60084ab8351eac41af0d44 (patch)
treed0f84329e492b83eac4ee8f7352d49bd645db2f8
parentc750a870d9a052d07c897476c98ac6d9c6ccd169 (diff)
downloadnautilus-wip/antoniof/list-view-dnd-hover-style-fixes.tar.gz
css: Don't conflict with drop target visual feedbackwip/antoniof/list-view-dnd-hover-style-fixes
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
-rw-r--r--src/resources/css/Adwaita.css11
1 files 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 {