mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
set window icon/title and use centralized logger (#30091)
This commit is contained in:
committed by
GitHub
parent
9e03386eb3
commit
f30438b959
@@ -10,6 +10,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:views="using:Peek.UI.Views"
|
||||
xmlns:winuiex="using:WinUIEx"
|
||||
Title="{x:Bind ViewModel.WindowTitle, Mode=OneWay}"
|
||||
MinWidth="450"
|
||||
MinHeight="400"
|
||||
mc:Ignorable="d">
|
||||
|
||||
@@ -47,6 +47,7 @@ namespace Peek.UI
|
||||
ViewModel = Application.Current.GetService<MainWindowViewModel>();
|
||||
|
||||
TitleBarControl.SetTitleBarToWindow(this);
|
||||
AppWindow.SetIcon("Assets/Peek/Icon.ico");
|
||||
|
||||
AppWindow.Closing += AppWindow_Closing;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ using Peek.UI.Telemetry.Events;
|
||||
using Windows.Graphics;
|
||||
using Windows.Storage;
|
||||
using Windows.System;
|
||||
using WinUIEx;
|
||||
|
||||
namespace Peek.UI.Views
|
||||
{
|
||||
@@ -123,11 +122,6 @@ namespace Peek.UI.Views
|
||||
var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(this);
|
||||
ThemeHelpers.SetImmersiveDarkMode(hWnd, ThemeHelpers.GetAppTheme() == AppTheme.Dark);
|
||||
Visibility = Visibility.Collapsed;
|
||||
|
||||
// Set window icon
|
||||
WindowId windowId = Win32Interop.GetWindowIdFromWindow(hWnd);
|
||||
AppWindow appWindow = AppWindow.GetFromWindowId(windowId);
|
||||
appWindow.SetIcon("Assets/Peek/Icon.ico");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user