diff --git a/BililiveRecorder.WPF/Controls/LogPanel.xaml.cs b/BililiveRecorder.WPF/Controls/LogPanel.xaml.cs index 4b0f60f..bbc6392 100644 --- a/BililiveRecorder.WPF/Controls/LogPanel.xaml.cs +++ b/BililiveRecorder.WPF/Controls/LogPanel.xaml.cs @@ -33,6 +33,9 @@ namespace BililiveRecorder.WPF.Controls { } } + private static readonly TimeSpan OneSecond = TimeSpan.FromSeconds(1); + private DateTimeOffset lastSizeChanged = DateTimeOffset.MinValue; + private void ListView_SizeChanged(object sender, SizeChangedEventArgs e) { try @@ -40,6 +43,13 @@ namespace BililiveRecorder.WPF.Controls if (sender is not ListView listView) return; if (listView.View is not GridView view) return; + var now = DateTimeOffset.Now; + + if (now - this.lastSizeChanged < OneSecond) + return; + + this.lastSizeChanged = now; + var w = listView.ActualWidth - SystemParameters.VerticalScrollBarWidth - 105 - 60 - 105; view.Columns[0].Width = 105;