Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Lamparter committed Oct 6, 2024
2 parents db66e5c + a7e687b commit a8d2d60
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
20 changes: 19 additions & 1 deletion Helpers/TitleBarService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,28 @@ public TitleBarService(WindowEx win, FrameworkElement accentStrip, Image titleBa
Content.PointerExited += PointerExited;
CurrentWindow.WindowStateChanged += CurrentWindow_WindowStateChanged;
LoadBounds();
CheckWindow();
Rehook();
}

public async void CheckWindow()
{
try
{
if (WindowTitle != null && CurrentWindow != null)
{
WindowTitle.Text = CurrentWindow.Title;
}
await Task.Delay(50);
CheckFocus();
CheckWindow();
}
catch
{

}
}

private void CurrentWindow_WindowStateChanged(object sender, WindowState e)
{
CheckMaximization();
Expand Down Expand Up @@ -556,7 +575,6 @@ public async void LoadBounds()
titleBar.SetDragRectangles(rects);
}

CheckFocus();
LoadBounds();
}
catch
Expand Down
18 changes: 0 additions & 18 deletions Rebound/ControlPanelWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public ControlPanelWindow()
WindowTitle.Text = Title;
RootFrame.Navigate(typeof(ModernHomePage));

CheckWindow();
Read();

AddressBox.Text = "Control Panel";
Expand Down Expand Up @@ -117,23 +116,6 @@ private void MenuFlyoutItem_Click_1(object sender, RoutedEventArgs e)
NavigateToPath();
}

public async void CheckWindow()
{
try
{
if (WindowTitle != null && this != null)
{
WindowTitle.Text = Title;
}
await Task.Delay(50);
CheckWindow();
}
catch
{

}
}

private void WindowEx_Closed(object sender, WindowEventArgs args)
{
App.cpanelWin = null;
Expand Down

0 comments on commit a8d2d60

Please sign in to comment.