linuxmint / nemo

File browser for Cinnamon
GNU General Public License v2.0
1.2k stars 298 forks source link

Feature request: Use tile to highlight selected file instead of adding background color to thumbnail #2889

Open andrewdbate opened 2 years ago

andrewdbate commented 2 years ago
 * Nemo version: 5.0.5
 * Is issue with desktop or windowed nemo? Windowed Nemo
 * Distribution: Mint 20.2

In the Icon view, selecting files puts a background on both the filename and the icon thumbnail: NemoThumbnailsSelection

This has a disadvantage: Putting a background color on the thumbnail can make it difficult to see the thumbnail.

Compare this to Pantheon Files: Selecting files draws a highlighted rectangle behind the icon and the thumbnail is shown unaltered: PantheonFilesThumbnailsSelection

Windows Explorer also highlights files without coloring the thumbnail: WindowsExplorer

The Mac Finder does it slightly differently: MacFinder

Finder is closest to the current behaviour in Nemo:

I think the way Finder highlights thumbnails is the best way to do it.

I've looked through the source code to estimate how difficult it would be to implement. If I have understood correctly, the majority of the changes would be in libnemo-private/nemo-icon-canvas-item.c and it wouldn't be too difficult. (Themes would also have to be updated separately if the highlight behind the icon was to be a lighter shade.)

What are your opinions on this?

(This issue relates to https://github.com/linuxmint/nemo/issues/2673 but that issue is about desktop icons only.)

Jeremy7701 commented 2 years ago

There is a slightly more subtle effect that occurs on nemo in a split-screen scenario:-

If a file is selected then the text is high-lighted and the thumbnail is slightly darkened; but if this is made to lie in the inactive pane, then the text retains the highlighted effect, but the thumbnail loses its darkened effect and appears as normal.

andrewdbate commented 2 years ago

@Jeremy7701 Related to your comment, I've also attempted to tweak the stylesheet to keep the text highlighted but to take the highlight off the thumbnail/icon, but it turns out that this is not possible with Nemo.

I've attempted to use all possible combinations of the :selected, :focus, :active and :backdrop CSS pseudo-classes to achieve this but it can't be done because sometimes only the text is in the "selected" state (e.g., on right-click or when the window/pane is not the active window) and sometimes both the text and the icon are in the "selected" state (e.g. on single-click).

Originally I was only going to suggest that the "focus" or "selected" states of the text or icon should be more carefully set (to make applying styles easier). But then I considered about it further and thought that having the highlight behind the thumbnail is more legible but this cannot currently be done with stylesheets alone because you would need to first draw a rectangle behind the icon.

mtwebster commented 2 years ago

I'd be open to tweaking what we have now, but I'm not sure about going to a 'grid' style. We rely on having space to right-click to do actions on the view vs the files within, and right-clicking the background while seemingly hovering/selecting a file would be wrong.

Nautilus has an 'experimental' view setting that implements the 'tile' layout using a widget container rather than a canvas like we have now. It basically turns every file into a button. In that experimental mode, there is no background-click possible. I'm not sure how pantheon implements this - can you right-click the background?

Anyway, I'm not a fan of how we currently recolor the icons either - I've toyed with the appearances of selected/hovered files in the past, but never found anything I'm happy with.

andrewdbate commented 2 years ago

@mtwebster What do you think of that way the Mac Finder does it? The Finder seems similar to how Nemo does it now, just with a bit of a tweak on the thumbnail background.

With Pantheon it is surprisingly easy to right-click between the files. The hit region for each file is smaller than the surface area that gets highlighted. You have to right-click on or near the thumbnail or the text (similar to the current Nemo behaviour). Not that I am advocating for a grid (I think the Finder does it well without a grid) but I think it can be done.