Page MenuHome

File Browser UI: Allow dragging anywhere in a file preview tile to drag
ClosedPublic

Authored by Julian Eisel (Severin) on Mar 2 2022, 7:30 PM.
Tags
None
Tokens
"Mountain of Wealth" token, awarded by luischerubini."Love" token, awarded by lopoIsaac."Love" token, awarded by AlexeyAdamitsky."Love" token, awarded by AndyCuccaro."Love" token, awarded by CarbonSmasher."Party Time" token, awarded by Draise."Love" token, awarded by sybren."Cup of Joe" token, awarded by harley."Party Time" token, awarded by pablovazquez."Love" token, awarded by fsiddi.

Details

Summary

Previously you'd have to drag the image itself, dragging outside of the image but within the preview tile (e.g. the name) would not start dragging the file, but trigger border select. This often conflicts with user expectations, especially when doing things fast. In fact I've seen many people get annoyed by this, or people have complained about it.

Or explained visually:

OldNew

This specific patch sets the "drag hit-box" as indicated here:

That is opposed to using the full tile size:
Reason being that the latter leaves quite little space in-between tiles to start dragging a boundbox from.

Diff Detail

Repository
rB Blender

Event Timeline

Julian Eisel (Severin) requested review of this revision.Mar 2 2022, 7:30 PM
Julian Eisel (Severin) created this revision.
Julian Eisel (Severin) retitled this revision from File Browser UI: Allow dragging anywhere in a file tile to drag to File Browser UI: Allow dragging anywhere in a file preview tile to drag.Mar 2 2022, 7:40 PM
Julian Eisel (Severin) edited the summary of this revision. (Show Details)

The idea seems relatively reasonable to me, and the code is understandable. Another argument for a more hierarchic representation of UI elements, I think.

source/blender/editors/interface/interface_handlers.c
2139–2140 ↗(On Diff #48857)

It's not obvious how this change is related (I'm not familiar with this code).
A comment on the choice of size might be helpful?

Or it's just the general state of the code; there are no comments on imb_scale or sx, sy.

Julian Eisel (Severin) edited the summary of this revision. (Show Details)Mar 2 2022, 7:46 PM
source/blender/editors/interface/interface_handlers.c
2139–2140 ↗(On Diff #48857)

Without this change you get these offsets of the drag image when dragging, because the button has a different size than the preview:

(The cursor is in the middle between the image and the text.)

Indeed the code for this is confusing. sx/sy are the width/height of the box to draw the preview within, on top of which the tooltip will be displayed. Not sure if it makes sense keeping to keep these parameters, now we just always set them based on the image size. Maybe for other cases it's nice to have more control.

This is great! Having that gap is a good idea to keep balance.

In most cases the user clicks in-between the thumbnail and text anyway. +1 !

This revision is now accepted and ready to land.Mar 3 2022, 2:56 PM
Julian Eisel (Severin) updated this revision to Diff 48895.EditedMar 3 2022, 3:16 PM
  • Applied {544bd0c353cf}
  • Remove now unnecessary header
source/blender/editors/interface/interface_handlers.c
2139–2140 ↗(On Diff #48857)

I entirely removed the redundant parameters now (544bd0c353cf), if there ever is an actual need for this (which I kind of doubt), we can bring it back in a better way.