[Flyout][Hotfix]Appear next to the tray icon position (#23772)

* [Flyout]Appear next to the tray icon position

* fix spellchecker
This commit is contained in:
Jaime Bernardo
2023-02-03 15:10:14 +00:00
committed by GitHub
parent 2e047e04de
commit fc8ee435e6
8 changed files with 153 additions and 48 deletions

View File

@@ -171,16 +171,17 @@ namespace Microsoft.PowerToys.Settings.UI
});
// open flyout
ShellPage.SetOpenFlyoutCallback(() =>
ShellPage.SetOpenFlyoutCallback((POINT? p) =>
{
this.DispatcherQueue.TryEnqueue(Microsoft.UI.Dispatching.DispatcherQueuePriority.Normal, () =>
{
if (App.GetFlyoutWindow() == null)
{
App.SetFlyoutWindow(new FlyoutWindow());
App.SetFlyoutWindow(new FlyoutWindow(p));
}
FlyoutWindow flyout = App.GetFlyoutWindow();
flyout.FlyoutAppearPosition = p;
flyout.Activate();
// https://github.com/microsoft/microsoft-ui-xaml/issues/7595 - Activate doesn't bring window to the foreground
@@ -196,7 +197,7 @@ namespace Microsoft.PowerToys.Settings.UI
{
if (App.GetFlyoutWindow() == null)
{
App.SetFlyoutWindow(new FlyoutWindow());
App.SetFlyoutWindow(new FlyoutWindow(null));
}
App.GetFlyoutWindow().ViewModel.DisableHiding();