mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
[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:
@@ -45,7 +45,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
/// <summary>
|
||||
/// Declaration for the opening flyout window callback function.
|
||||
/// </summary>
|
||||
public delegate void FlyoutOpeningCallback();
|
||||
public delegate void FlyoutOpeningCallback(POINT? point);
|
||||
|
||||
/// <summary>
|
||||
/// Declaration for the disabling hide of flyout window callback function.
|
||||
@@ -330,13 +330,28 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
if (json != null)
|
||||
{
|
||||
if (json.ToString().StartsWith("{\"ShowYourself\":"))
|
||||
IJsonValue whatToShowJson;
|
||||
if (json.TryGetValue("ShowYourself", out whatToShowJson))
|
||||
{
|
||||
if (json.ToString().EndsWith("\"flyout\"}"))
|
||||
if (whatToShowJson.ValueType == JsonValueType.String && whatToShowJson.GetString().Equals("flyout"))
|
||||
{
|
||||
OpenFlyoutCallback();
|
||||
POINT? p = null;
|
||||
|
||||
IJsonValue flyoutPointX;
|
||||
IJsonValue flyoutPointY;
|
||||
if (json.TryGetValue("x_position", out flyoutPointX) && json.TryGetValue("y_position", out flyoutPointY))
|
||||
{
|
||||
if (flyoutPointX.ValueType == JsonValueType.Number && flyoutPointY.ValueType == JsonValueType.Number)
|
||||
{
|
||||
int flyout_x = (int)flyoutPointX.GetNumber();
|
||||
int flyout_y = (int)flyoutPointY.GetNumber();
|
||||
p = new POINT(flyout_x, flyout_y);
|
||||
}
|
||||
}
|
||||
|
||||
OpenFlyoutCallback(p);
|
||||
}
|
||||
else if (json.ToString().EndsWith("\"main_page\"}"))
|
||||
else if (whatToShowJson.ValueType == JsonValueType.String && whatToShowJson.GetString().Equals("main_page"))
|
||||
{
|
||||
OpenMainWindowCallback();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user