Remember uploader window size
This commit is contained in:
@@ -53,6 +53,8 @@ public partial class MainWindow : Window
|
||||
_liveTimer.Interval = TimeSpan.FromSeconds(30);
|
||||
_liveTimer.Tick += (_, _) => UpdateLiveStatus();
|
||||
_liveTimer.Start();
|
||||
Opened += OnWindowOpened;
|
||||
Closing += OnWindowClosing;
|
||||
ApplySettings();
|
||||
}
|
||||
|
||||
@@ -185,6 +187,31 @@ public partial class MainWindow : Window
|
||||
UpdateSteps();
|
||||
}
|
||||
|
||||
private void OnWindowOpened(object? sender, EventArgs e)
|
||||
{
|
||||
ApplyWindowSize();
|
||||
}
|
||||
|
||||
private void OnWindowClosing(object? sender, WindowClosingEventArgs e)
|
||||
{
|
||||
_settings.WindowWidth = Width;
|
||||
_settings.WindowHeight = Height;
|
||||
_settingsStore.Save(_settings);
|
||||
}
|
||||
|
||||
private void ApplyWindowSize()
|
||||
{
|
||||
if (_settings.WindowWidth > 0)
|
||||
{
|
||||
Width = Math.Max(MinWidth, _settings.WindowWidth);
|
||||
}
|
||||
|
||||
if (_settings.WindowHeight > 0)
|
||||
{
|
||||
Height = Math.Max(MinHeight, _settings.WindowHeight);
|
||||
}
|
||||
}
|
||||
|
||||
private void StartUploadPipelineIfReady()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(_settings.UploadUrl) || string.IsNullOrWhiteSpace(_settings.WatchFolder))
|
||||
|
||||
Reference in New Issue
Block a user