From 733095eadd0f9505109b208fcbd575c167b9ec82 Mon Sep 17 00:00:00 2001 From: agailloty Date: Sat, 1 Feb 2025 09:58:41 +0100 Subject: [PATCH] adjust automatically startup heigh and width --- xpathrunnerui/xpathrunnerui/MainWindow.axaml | 2 +- xpathrunnerui/xpathrunnerui/MainWindow.axaml.cs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/xpathrunnerui/xpathrunnerui/MainWindow.axaml b/xpathrunnerui/xpathrunnerui/MainWindow.axaml index 36ca591..f58f63a 100644 --- a/xpathrunnerui/xpathrunnerui/MainWindow.axaml +++ b/xpathrunnerui/xpathrunnerui/MainWindow.axaml @@ -4,7 +4,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="xpathrunnerui.MainWindow" - Title="XPATH Runner" Width="750" Height="680" + Title="XPATH Runner" Icon="/Assets/html_tag.png" WindowStartupLocation="CenterScreen"> diff --git a/xpathrunnerui/xpathrunnerui/MainWindow.axaml.cs b/xpathrunnerui/xpathrunnerui/MainWindow.axaml.cs index f5b6fe3..d95758b 100644 --- a/xpathrunnerui/xpathrunnerui/MainWindow.axaml.cs +++ b/xpathrunnerui/xpathrunnerui/MainWindow.axaml.cs @@ -16,6 +16,13 @@ public partial class MainWindow : Window public MainWindow() { InitializeComponent(); + var screen = Screens.Primary; + // Set width and height as percentages of the screen + if (screen != null) + { + Width = screen.WorkingArea.Width * 0.5; + Height = screen.WorkingArea.Height * 0.6; + } } public async void PickFileHandler(object sender, RoutedEventArgs args)