Opened 9 years ago

Closed 9 years ago

#5671 closed bug (fixed)

Replace source/destination paths on drag&drop

Reported by: humdinger Owned by: axeld
Priority: normal Milestone: R1
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

This is hrev35922.

Drag&dropping a file/folder into the Source or Destination text field inserts the path into the already existing path. It'd be much more convenient if the path got replaced instead.

Change History (13)

comment:1 Changed 9 years ago by axeld

Component: Applications/ExpanderKits/Interface Kit
Owner: changed from korli to axeld
Type: enhancementbug

This is actually a problem of BTextControl/BTextView recently introduced by Rene.

comment:2 Changed 9 years ago by anevilyak

That depends, if the text in the control is already selected, then certainly it should and I can fix that. If the text isn't selected though, I don't see how to intelligently infer that a replace is desired. Thoughts?

comment:3 Changed 9 years ago by anevilyak

I might also note, what makes this somewhat annoying is that BTextView doesn't indicate its selection at all if its window isn't focused, making it impossible to tell which behavior is going to happen.

comment:4 Changed 9 years ago by stippi

If it's a one line BTextView, then I suppose replace behavior is wanted.

comment:5 Changed 9 years ago by humdinger

That probably works for the majority of cases. A counter example could be the CC-line of an email client. Here you might as well want to add another recipient. I guess an insert/replace flag upon creation of the BTextView is out of the question?

comment:6 Changed 9 years ago by bonefish

The BeOS behavior for dragging text over a text view is: The selection (if any) disappears and a cursor appears at the potential drop position. When dropping, the text is inserted there. In Expander this works just the same. If an entry_ref is dragged over either of Expander's text views there is no visual feedback and when dropping the text is replaced with the entry's path.

I think the drop behavior is just what one would expect (save for the missing visual feedback on drag-over) and I don't think it has anything to do with BTextView.

As for the default behavior for text drops on BTextView, I think I would prefer keeping the selection and replacing it on drop. If nothing is selected inserting seems fine. A modifier could be used to change the drop behavior.

comment:7 Changed 9 years ago by humdinger

Maybe using a vanilla BTextView isn't best for Expander. At least in my usage it's a bit annoying to first have to click into the text field, select all and then drag&drop a folder...
BTW, there is the same visual feedback as in BeOS when hovering a drag&drop: a text cursur appears, though it's not very easily spotted with a half transparent folder floating above it.

comment:8 in reply to:  7 ; Changed 9 years ago by bonefish

Replying to humdinger:

Maybe using a vanilla BTextView isn't best for Expander. At least in my usage it's a bit annoying to first have to click into the text field, select all and then drag&drop a folder...

Apparently BeOS' Expander subclasses it, since BeOS's BTextView doesn't seem to accept entry refs. I not so sure that it's good idea that ours does by default. It does seem handy to quickly insert a file path into a text, but I suppose in a lot of applications a different behavior is expected -- e.g. when dropping a text file on a text editor window I would prefer it to just open the file. There's always right-button dragging for all options.

comment:9 in reply to:  8 ; Changed 9 years ago by anevilyak

Replying to bonefish:

Apparently BeOS' Expander subclasses it, since BeOS's BTextView doesn't seem to accept entry refs. I not so sure that it's good idea that ours does by default. It does seem handy to quickly insert a file path into a text, but I suppose in a lot of applications a different behavior is expected -- e.g. when dropping a text file on a text editor window I would prefer it to just open the file. There's always right-button dragging for all options.

Should I just remove that behavior from BTextView then? Or perhaps relocate that behavior to BTextControl so it only applies for single line textviews (in which case it would obviously replace existing content)?

comment:10 in reply to:  9 Changed 9 years ago by bonefish

Replying to anevilyak:

Should I just remove that behavior from BTextView then? Or perhaps relocate that behavior to BTextControl so it only applies for single line textviews (in which case it would obviously replace existing content)?

I would relocate it to Expander.

comment:11 Changed 9 years ago by axeld

Expander already had this functionality before. I guess I would just remove it from BTextView. What we could do, however, is to add a default context menu for right click drags that allow for more, as Ingo suggested.

comment:12 Changed 9 years ago by axeld

Status: newin-progress

comment:13 Changed 9 years ago by axeld

Resolution: fixed
Status: in-progressclosed

Fixed in hrev36390, reverted the BTextView part of hrev35731.

Note: See TracTickets for help on using tickets.