caduandrade / tabbed_view

Widget inspired by the classic Desktop-style tab component.
MIT License
49 stars 16 forks source link

Implementation for onReorder: #21

Closed bksubhuti closed 1 year ago

bksubhuti commented 1 year ago

Fluent UI has a callback property called
onReorder: (oldIndex, newIndex) { It would be good if an internal drag drop could handle this. You might need a switch to allow this in case it would interfere with previous drag implementations.
Every browser has this feature and it is the most basic use cases for drag and drop.

We can implement drag drop (code is on github for tipitaka pali reader) However, we don't have access to the major part of the "tab". It would be good if the tab label were a Text() widget that gets passed inside . From there we can make it a dragTarget. However, the best thing to do would be to have a onReorder

Please see this github repo with example Code for Demo: https://github.com/bdlukaa/fluent_ui Demo: https://bdlukaa.github.io/fluent_ui/
Look for navigation / tabview

Lastly, There is an issue with focus. if you have 3 tabs, and has #1 in focus but wants to drag #3 to #2 spot, it will not work. the current version of you widget needs to have the tab in focus in order to initiate a dragTarget. It would be good if you gain focus on mousedown.
One should be able to take any tab and move it anywhere despite being in focus or not in focus. The fluent example implements this well however, we want to do multiple documents at the same time. (split view). For now, up to 3 documents (tabs) can show content at the same time. We need your widget in order to do that.

In order to run our code, you need to download the db and split it (according to the github readme file). The dragtarget is the small eye icon (for now). It is not intuitive. We want either reOrder or we want to pass in a Text() widget for the tab instead of string.

caduandrade commented 1 year ago
bksubhuti commented 1 year ago

our project has quite a few changes to the tabbed view and it more will be added.
Future features to be added (implemented but not pushed).. We have drag drop . Tipitaka Pali Reader

caduandrade commented 1 year ago

The DraggableTabBuilder will need to be changed. Probably the draggable data will need to be fixed for the TabData type. The default drag widget should be the same as defined by the theme. The DraggableTabBuilder will be able to change the drag widget and dragAnchorStrategy.

caduandrade commented 1 year ago

Apologies for the delay. I'm still busy. I made a simple visual effect for sorting as it can be a separate task if necessary. Available in version 1.17.0.