Bug 543655

Summary: DND'ing CTabs in editor bar to actually show moving tab as feedback
Product: [Eclipse Project] Platform Reporter: Mickael Istria <mistria>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: akurtakov, ericwill, xixiyan
Version: 4.8   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/135737
https://bugs.eclipse.org/bugs/show_bug.cgi?id=543910
Whiteboard:
Attachments:
Description Flags
screencast none

Description Mickael Istria CLA 2019-01-21 11:38:31 EST
Most recent software that use tabs make that when DND'ing tabs to re-order them, the tab is shown as feedback when moving: ie other tabs are moved for "preview" when DNDing.
It would be interesting to have it in SWT.
Comment 1 Mickael Istria CLA 2019-01-21 11:40:07 EST
One possibility seems to use widget.print(...) on the tab folder, and to use this image either as a cursor or as other feedback when moving the tab.
Comment 2 Alexander Kurtakov CLA 2019-01-21 11:53:10 EST
Xi, the goal here is to have smth like firefox tab dragging. Please have a look and let's discuss whether it seems feasible.
Comment 3 Eclipse Genie CLA 2019-01-24 16:40:38 EST
New Gerrit change created: https://git.eclipse.org/r/135737
Comment 4 Mickael Istria CLA 2019-01-24 16:44:44 EST
(In reply to Eclipse Genie from comment #3)
> New Gerrit change created: https://git.eclipse.org/r/135737

Hey Xi, this is interesting!
Would you be able to produce a video or an animated gif to see how it looks like?
Comment 5 Xi Yan CLA 2019-01-24 16:59:56 EST
(In reply to Eclipse Genie from comment #3)
> New Gerrit change created: https://git.eclipse.org/r/135737

It looks like there are two things involved here:

1) Showing the moving tab as feedback while dragging. This can be done using the existing functionalities provided by SWT. The snippet attached uses a captured image of the Tab/Tab+Editor as a Cursor while the drag is happening to show the tab. 

2) Making the other tabs in the folder move to adjust for space when the dragged tab is inserted/removed in/from the folder. Still need to investigate how this can be done, not sure if the transitions can be animated.
Comment 6 Xi Yan CLA 2019-01-24 17:05:09 EST
Created attachment 277274 [details]
screencast
Comment 7 Xi Yan CLA 2019-01-24 17:11:57 EST
(In reply to Mickael Istria from comment #4)
> (In reply to Eclipse Genie from comment #3)
> > New Gerrit change created: https://git.eclipse.org/r/135737
> 
> Hey Xi, this is interesting!
> Would you be able to produce a video or an animated gif to see how it looks
> like?

Sure, see #6. It's still missing all the animated transition and the dragged tab is not isolated from the rest when dragging.