Skip to content

Commit

Permalink
optimize window class
Browse files Browse the repository at this point in the history
  • Loading branch information
Scighost committed Dec 30, 2023
1 parent 134f0c3 commit c2d4859
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Starward/MyWindows/InstallGameWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public InstallGameWindow()



private void InitializeWindow(string? action = null)
private void InitializeWindow()
{
Title = "Starward - Install Game";
AppWindow.TitleBar.ExtendsContentIntoTitleBar = true;
Expand Down
3 changes: 1 addition & 2 deletions src/Starward/MyWindows/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ private void InitializeMainWindow()
AppWindow.TitleBar.ExtendsContentIntoTitleBar = true;
AppWindow.TitleBar.IconShowOptions = IconShowOptions.ShowIconAndSystemMenu;
AppWindow.Closing += AppWindow_Closing;
var len = (int)(48 * UIScale);
ChangeWindowSize();
AdaptTitleBarButtonColorToActuallTheme();
SetDragRectangles(new RectInt32(0, 0, 100000, len));
SetDragRectangles(new RectInt32(0, 0, 100000, (int)(48 * UIScale)));
AppWindow.SetIcon(Path.Combine(AppContext.BaseDirectory, @"Assets\logo.ico"));
WTSRegisterSessionNotification(WindowHandle, 0);
if (AppWindow.Presenter is OverlappedPresenter presenter)
Expand Down
2 changes: 1 addition & 1 deletion src/Starward/MyWindows/SystemTrayWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ public override void Show()
[RelayCommand]
public override void Hide()
{
base.Hide();
try
{
base.Hide();
AppWindow.ResizeClient(new Windows.Graphics.SizeInt32(1000, 1000));
}
catch { }
Expand Down
3 changes: 1 addition & 2 deletions src/Starward/MyWindows/WelcomeWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ private void InitializeWindow()
AppWindow.TitleBar.IconShowOptions = IconShowOptions.HideIconAndSystemMenu;
ChangeWindowSize(AppConfig.WindowSizeMode);
AdaptTitleBarButtonColorToActuallTheme();
int len = (int)(48 * UIScale);
SetDragRectangles(new RectInt32(0, 0, 10000, len));
SetDragRectangles(new RectInt32(0, 0, 10000, (int)(48 * UIScale)));
AppWindow.SetIcon(Path.Combine(AppContext.BaseDirectory, @"Assets\logo.ico"));
if (AppWindow.Presenter is OverlappedPresenter presenter)
{
Expand Down

0 comments on commit c2d4859

Please sign in to comment.