Remember uploader window size
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-12 21:03:27 +01:00
parent 898ac9ff0e
commit be722f6e37
3 changed files with 33 additions and 3 deletions

View File

@@ -4,9 +4,10 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="520" d:DesignHeight="360"
x:Class="PhotoboothUploader.MainWindow"
Width="520" Height="360"
Width="560" Height="420"
MinWidth="520" MinHeight="400"
Title="Die Fotospiel.App - Photobooth Uploader">
<Grid Margin="24" ColumnDefinitions="*,8,*">
<Grid Margin="24,32,24,24" ColumnDefinitions="*,8,*">
<StackPanel Grid.Column="0" Spacing="12" MaxWidth="420">
<StackPanel Orientation="Horizontal" Spacing="10" VerticalAlignment="Center">
<Image Source="avares://PhotoboothUploader/Assets/logo.png" Width="32" Height="32" />
@@ -54,7 +55,7 @@
</Border>
</StackPanel>
<StackPanel Grid.Column="2" Spacing="12" MaxWidth="380">
<StackPanel Grid.Column="2" Spacing="12" MaxWidth="380" Margin="0,6,0,0">
<Border Background="#1F000000" Padding="12" CornerRadius="8">
<StackPanel Spacing="6">
<TextBlock Text="Status" FontWeight="SemiBold" />

View File

@@ -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))

View File

@@ -12,4 +12,6 @@ public sealed class PhotoboothSettings
public string? LastError { get; set; }
public string? LastErrorAt { get; set; }
public int MaxConcurrentUploads { get; set; } = 2;
public double WindowWidth { get; set; }
public double WindowHeight { get; set; }
}