Skip to content

Commit 508b3db

Browse files
committed
Code Quality: Add drag & drop timer constant
1 parent e41f687 commit 508b3db

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

src/Files.App/Constants.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,11 @@ public static class Actions
216216
{
217217
public const int MaxSelectedItems = 5;
218218
}
219+
220+
public static class DragAndDrop
221+
{
222+
public const Int32 HoverToOpenTimespan = 1300;
223+
}
219224

220225
public static class UserEnvironmentPaths
221226
{

src/Files.App/UserControls/TabBar/TabBar.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public TabBar()
6161
{
6262
InitializeComponent();
6363

64-
tabHoverTimer.Interval = TimeSpan.FromMilliseconds(1000);
64+
tabHoverTimer.Interval = TimeSpan.FromMilliseconds(Constants.DragAndDrop.HoverToOpenTimespan);
6565
tabHoverTimer.Tick += TabHoverSelected;
6666

6767
var appWindow = MainWindow.Instance.AppWindow;

src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ public async Task PathBoxItem_DragOver(object sender, DragEventArgs e)
373373
dragOverPath = null;
374374
}
375375
},
376-
TimeSpan.FromMilliseconds(1000), false);
376+
TimeSpan.FromMilliseconds(Constants.DragAndDrop.HoverToOpenTimespan), false);
377377
}
378378
}
379379

src/Files.App/Views/Layouts/BaseLayoutPage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ private async void Item_DragOver(object sender, DragEventArgs e)
10951095
Commands.OpenItem.ExecuteAsync();
10961096
}
10971097
},
1098-
TimeSpan.FromMilliseconds(1000), false);
1098+
TimeSpan.FromMilliseconds(Constants.DragAndDrop.HoverToOpenTimespan), false);
10991099
}
11001100
}
11011101
}

0 commit comments

Comments
 (0)