MMTabBarView icon indicating copy to clipboard operation
MMTabBarView copied to clipboard

Mini-window is drawn only for last tab

Open gloubibou opened this issue 10 years ago • 0 comments

Dragging a tab out of the tab button bar should show a mini-window as dragging image.

This works only for the last tab. For other tabs, this is skipped because no destinationIndexForDraggedItem was set on the tab view during draggingEntered:

As a workaround, I have modified -[MMTabDragAssistant _destinationIndexForButton:atPoint:inTabBarView:] at line 570 to set resultingIndex without testing aPoint against lastFrame:

           else if ([self isDragging]) {
                if ([tabBarView destinationIndexForDraggedItem] != NSNotFound)
                    resultingIndex = [tabBarView destinationIndexForDraggedItem];
                else {
                    resultingIndex = [tabBarView numberOfVisibleTabViewItems];
                }
            }

Now draggingEntered: defaults to setting destinationIndexForDraggedItem to the number of tab items. During draggingExited:, MMTabDragAssistant:932 now considers the tab bar to have participated in the dragging operation.

I have not created a pull request as I am not sure what further implications this change will have.

gloubibou avatar Dec 16 '14 13:12 gloubibou