diff --git a/FasdDesktopUi/Basics/UserControls/Ticket/CloseCaseDialogWithTicket.xaml.cs b/FasdDesktopUi/Basics/UserControls/Ticket/CloseCaseDialogWithTicket.xaml.cs index 06671a6..43283d3 100644 --- a/FasdDesktopUi/Basics/UserControls/Ticket/CloseCaseDialogWithTicket.xaml.cs +++ b/FasdDesktopUi/Basics/UserControls/Ticket/CloseCaseDialogWithTicket.xaml.cs @@ -26,6 +26,8 @@ namespace FasdDesktopUi.Basics.UserControls { public partial class CloseCaseDialogWithTicket : UserControl { + private const double MinDialogContentHeightDip = 220d; + #region Fields & Properties private readonly Dictionary _errors = new Dictionary(); @@ -2743,9 +2745,8 @@ namespace FasdDesktopUi.Basics.UserControls if (DialogContentScrollViewer == null) return; - // Keep dialog usable on very small screens, but allow larger monitors to use space. - var clamped = Math.Max(220, Math.Min(900, maxHeight)); - DialogContentScrollViewer.MaxHeight = clamped; + // Keep dialog usable on very small screens; parent window already constrains max size. + DialogContentScrollViewer.MaxHeight = Math.Max(MinDialogContentHeightDip, maxHeight); } catch (Exception E) { diff --git a/FasdDesktopUi/Pages/TicketCompletion/TicketCompletion.xaml.cs b/FasdDesktopUi/Pages/TicketCompletion/TicketCompletion.xaml.cs index abaf444..26ef25e 100644 --- a/FasdDesktopUi/Pages/TicketCompletion/TicketCompletion.xaml.cs +++ b/FasdDesktopUi/Pages/TicketCompletion/TicketCompletion.xaml.cs @@ -18,6 +18,8 @@ namespace FasdDesktopUi.Pages.TicketCompletion { public partial class TicketCompletion : Window, IBlurInvoker, INotifyPropertyChanged { + private const double WindowWorkingAreaMarginDip = 12d; + private const double DialogNonContentReserveDip = 180d; private bool isCanceled = false; private bool _WaitForClosing = false; @@ -162,10 +164,10 @@ namespace FasdDesktopUi.Pages.TicketCompletion screen = screen ?? WinForms.Screen.PrimaryScreen; var workingArea = screen?.WorkingArea ?? WinForms.Screen.PrimaryScreen.WorkingArea; var dpiScaleY = VisualTreeHelper.GetDpi(this).DpiScaleY; - var maxHeightDip = (workingArea.Height / Math.Max(0.1, dpiScaleY)) - 12; + var maxHeightDip = (workingArea.Height / Math.Max(0.1, dpiScaleY)) - WindowWorkingAreaMarginDip; MaxHeight = Math.Max(220, maxHeightDip); - CloseCaseDialogUc?.SetDialogContentMaxHeight(MaxHeight - 180); + CloseCaseDialogUc?.SetDialogContentMaxHeight(MaxHeight - DialogNonContentReserveDip); } catch (Exception ex) {