diff --git a/OpenGptChat/OpenGptChat.csproj b/OpenGptChat/OpenGptChat.csproj index e881460..3e4a1a2 100644 --- a/OpenGptChat/OpenGptChat.csproj +++ b/OpenGptChat/OpenGptChat.csproj @@ -11,7 +11,7 @@ - 1.1.6.3 + 1.1.6.4 disable app.manifest OpenGptChat.EntryPoint diff --git a/OpenGptChat/Properties/PublishProfiles/win64-standalone.pubxml b/OpenGptChat/Properties/PublishProfiles/win32.pubxml similarity index 75% rename from OpenGptChat/Properties/PublishProfiles/win64-standalone.pubxml rename to OpenGptChat/Properties/PublishProfiles/win32.pubxml index 2db38f1..e6a7125 100644 --- a/OpenGptChat/Properties/PublishProfiles/win64-standalone.pubxml +++ b/OpenGptChat/Properties/PublishProfiles/win32.pubxml @@ -6,12 +6,12 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Release\net6.0-windows\publish\win-x64\ + bin\Release\net6.0-windows\publish\win-x86\ FileSystem <_TargetId>Folder net6.0-windows - win-x64 - true + win-x86 + false true false diff --git a/OpenGptChat/Utilities/UiUtils.cs b/OpenGptChat/Utilities/UiUtils.cs index 2311e06..36bcaa5 100644 --- a/OpenGptChat/Utilities/UiUtils.cs +++ b/OpenGptChat/Utilities/UiUtils.cs @@ -31,10 +31,24 @@ private static void CornerRadiusChanged(DependencyObject d, DependencyPropertyCh if (d is not FrameworkElement ele) return; - if (GetBorderFromControl(ele) is not Border border) - return; + void ApplyBorder(FrameworkElement ele) + { + if (GetBorderFromControl(ele) is not Border border) + return; - border.CornerRadius = (CornerRadius)e.NewValue; + border.CornerRadius = (CornerRadius)e.NewValue; + } + + void LoadedOnce(object? sender, RoutedEventArgs _e) + { + ApplyBorder(ele); + ele.Loaded -= LoadedOnce; + } + + if (ele.IsLoaded) + ApplyBorder(ele); + else + ele.Loaded += LoadedOnce; } private static Border? GetBorderFromControl(FrameworkElement control) @@ -46,8 +60,14 @@ private static void CornerRadiusChanged(DependencyObject d, DependencyPropertyCh for (int i = 0; i < childrenCount; i++) { DependencyObject child = VisualTreeHelper.GetChild(control, i); + if (child is not FrameworkElement childElement) + continue; + if (child is Border borderChild) return borderChild; + + if (GetBorderFromControl(childElement) is Border childBorderChild) + return childBorderChild; } return null;