Skip to content

Commit ca24af1

Browse files
committed
fix(LauncherTabBar): Restore drag-and-hover handling logic for the tab bar
To improve the interaction experience for tab reordering via drag-and-drop, the drag effect is set to "move" and the event is marked as handled when drag data matching the expected format hovers over a tab item.
1 parent 864dd80 commit ca24af1

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎src/Views/LauncherTabBar.axaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
PointerReleased="OnPointerReleasedTab"
7070
ContextRequested="OnTabContextRequested"
7171
DragDrop.AllowDrop="True"
72+
DragDrop.DragOver="DragOverTab"
7273
DragDrop.Drop="DropTab">
7374
<ToolTip.Tip>
7475
<Grid>

‎src/Views/LauncherTabBar.axaml.cs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,15 @@ private async void OnPointerMovedOverTab(object sender, PointerEventArgs e)
259259
e.Handled = true;
260260
}
261261

262+
private void DragOverTab(object sender, DragEventArgs e)
263+
{
264+
if (e.DataTransfer.Contains(_dndMainTabFormat))
265+
{
266+
e.DragEffects = DragDropEffects.Move;
267+
e.Handled = true;
268+
}
269+
}
270+
262271
private void DropTab(object sender, DragEventArgs e)
263272
{
264273
if (e.DataTransfer.TryGetValue(_dndMainTabFormat) is not { Length: > 0 } id)

0 commit comments

Comments
 (0)