Skip to content

Commit 232ec15

Browse files
committed
Re-add jumpTimer
1 parent 6b7db72 commit 232ec15

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

Files/BaseLayout.cs

+14-3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ namespace Files
4242
/// </summary>
4343
public abstract class BaseLayout : Page, IBaseLayout, INotifyPropertyChanged
4444
{
45+
private readonly DispatcherTimer jumpTimer;
46+
4547
protected NamedPipeAsAppServiceConnection Connection => ParentShellPageInstance?.ServiceConnection;
4648

4749
public SelectedItemsPropertiesViewModel SelectedItemsPropertiesViewModel { get; }
@@ -132,9 +134,8 @@ public string JumpString
132134
ScrollIntoView(jumpedToItem);
133135
}
134136

135-
// Reset
136-
jumpString = "";
137-
return;
137+
// Restart the timer
138+
jumpTimer.Start();
138139
}
139140
jumpString = value;
140141
}
@@ -208,6 +209,10 @@ internal set
208209

209210
public BaseLayout()
210211
{
212+
jumpTimer = new DispatcherTimer();
213+
jumpTimer.Interval = TimeSpan.FromSeconds(0.8);
214+
jumpTimer.Tick += JumpTimer_Tick; ;
215+
211216
SelectedItemsPropertiesViewModel = new SelectedItemsPropertiesViewModel(this);
212217
DirectoryPropertiesViewModel = new DirectoryPropertiesViewModel();
213218

@@ -223,6 +228,12 @@ public BaseLayout()
223228
dragOverTimer = DispatcherQueue.GetForCurrentThread().CreateTimer();
224229
}
225230

231+
private void JumpTimer_Tick(object sender, object e)
232+
{
233+
jumpString = string.Empty;
234+
jumpTimer.Stop();
235+
}
236+
226237
protected abstract void InitializeCommandsViewModel();
227238

228239
public abstract void FocusFileList();

0 commit comments

Comments
 (0)