Fix title bar caption buttons theme

This commit is contained in:
Aleh Khantsevich
2024-07-15 00:20:22 +02:00
parent 403e5e5de0
commit 2e0dd24cdd

View File

@@ -240,13 +240,9 @@ namespace Wino.Services
_ = mainApplicationFrame.DispatcherQueue.TryEnqueue(Microsoft.UI.Dispatching.DispatcherQueuePriority.Normal, _ = mainApplicationFrame.DispatcherQueue.TryEnqueue(Microsoft.UI.Dispatching.DispatcherQueuePriority.Normal,
() => () =>
{ {
ApplicationViewTitleBar titleBar = null; var titleBar = _appShellService.AppWindow.AppWindow.TitleBar;
try
{ if(titleBar == null) return;
titleBar = ApplicationView.GetForCurrentView().TitleBar;
}
catch { }
if (titleBar == null) return;
if (_underlyingThemeService.IsUnderlyingThemeDark()) if (_underlyingThemeService.IsUnderlyingThemeDark())
{ {
@@ -260,12 +256,8 @@ namespace Wino.Services
#else #else
_ = mainApplicationFrame.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => _ = mainApplicationFrame.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
{ {
ApplicationViewTitleBar titleBar = null; ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;
try
{
titleBar = ApplicationView.GetForCurrentView().TitleBar;
}
catch { }
if (titleBar == null) return; if (titleBar == null) return;
if (_underlyingThemeService.IsUnderlyingThemeDark()) if (_underlyingThemeService.IsUnderlyingThemeDark())
@@ -458,7 +450,7 @@ namespace Wino.Services
{ {
byte[] bytes = new byte[readerStream.Length]; byte[] bytes = new byte[readerStream.Length];
await readerStream.ReadAsync(bytes,0, bytes.Length); await readerStream.ReadAsync(bytes, 0, bytes.Length);
var buffer = bytes.AsBuffer(); var buffer = bytes.AsBuffer();