From 9cf404250ba3eeca37bf1b5a7459caf30bc71482 Mon Sep 17 00:00:00 2001 From: Taras <109293326+taras-janea@users.noreply.github.com> Date: Wed, 14 Dec 2022 12:17:38 +0200 Subject: [PATCH] [Quick Accent] fix showing toolbar in the corner position (#22736) * [Quick Accent] fix showing toolbar in the corner position * [Quick Accent] set horizontal allignment according to toolbar position * [Quick Accent] fix spelling mistake --- .../poweraccent/PowerAccent.Core/PowerAccent.cs | 5 +++++ .../poweraccent/PowerAccent.UI/Selector.xaml | 1 + .../poweraccent/PowerAccent.UI/Selector.xaml.cs | 13 +++++++++++++ 3 files changed, 19 insertions(+) diff --git a/src/modules/poweraccent/PowerAccent.Core/PowerAccent.cs b/src/modules/poweraccent/PowerAccent.Core/PowerAccent.cs index b189298ec1..f9b9566b3e 100644 --- a/src/modules/poweraccent/PowerAccent.Core/PowerAccent.cs +++ b/src/modules/poweraccent/PowerAccent.Core/PowerAccent.cs @@ -285,6 +285,11 @@ public class PowerAccent : IDisposable return Calculation.GetRawCoordinatesFromPosition(position, screen, window); } + public Position GetToolbarPosition() + { + return _settingService.Position; + } + public void Dispose() { _keyboardListener.UnInitHook(); diff --git a/src/modules/poweraccent/PowerAccent.UI/Selector.xaml b/src/modules/poweraccent/PowerAccent.UI/Selector.xaml index b1624ae757..1f30d628e2 100644 --- a/src/modules/poweraccent/PowerAccent.UI/Selector.xaml +++ b/src/modules/poweraccent/PowerAccent.UI/Selector.xaml @@ -42,6 +42,7 @@ HorizontalAlignment.Left, + Position.Right or Position.TopRight or Position.BottomRight => HorizontalAlignment.Right, + Position.Center or Position.Top or Position.Bottom => HorizontalAlignment.Center, + _ => HorizontalAlignment.Center + }; + } + protected override void OnClosed(EventArgs e) { _powerAccent.Dispose();