From be722f6e372f8f2232bc8d229e8ecc061dbeef28 Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Mon, 12 Jan 2026 21:03:27 +0100 Subject: [PATCH] Remember uploader window size --- .../PhotoboothUploader/MainWindow.axaml | 7 ++--- .../PhotoboothUploader/MainWindow.axaml.cs | 27 +++++++++++++++++++ .../Models/PhotoboothSettings.cs | 2 ++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml b/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml index 48d51fa..c13297c 100644 --- a/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml +++ b/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml @@ -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"> - + @@ -54,7 +55,7 @@ - + diff --git a/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml.cs b/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml.cs index f21ab4f..bce7771 100644 --- a/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml.cs +++ b/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml.cs @@ -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)) diff --git a/clients/photobooth-uploader/PhotoboothUploader/Models/PhotoboothSettings.cs b/clients/photobooth-uploader/PhotoboothUploader/Models/PhotoboothSettings.cs index 3e0d438..de48deb 100644 --- a/clients/photobooth-uploader/PhotoboothUploader/Models/PhotoboothSettings.cs +++ b/clients/photobooth-uploader/PhotoboothUploader/Models/PhotoboothSettings.cs @@ -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; } }