mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
[Chore] Run solution code cleanup (#20584)
This commit is contained in:
@@ -159,7 +159,7 @@ public class PowerAccent : IDisposable
|
||||
|
||||
public Point GetDisplayCoordinates(Size window)
|
||||
{
|
||||
var activeDisplay = WindowsFunctions.GetActiveDisplay();
|
||||
(Point Location, Size Size, double Dpi) activeDisplay = WindowsFunctions.GetActiveDisplay();
|
||||
Rect screen = new Rect(activeDisplay.Location, activeDisplay.Size) / activeDisplay.Dpi;
|
||||
Position position = _settingService.Position;
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ namespace PowerAccent.Core.Tools
|
||||
{
|
||||
public static Point GetRawCoordinatesFromCaret(Point caret, Rect screen, Size window)
|
||||
{
|
||||
var left = caret.X - (window.Width / 2);
|
||||
var top = caret.Y - window.Height - 20;
|
||||
double left = caret.X - (window.Width / 2);
|
||||
double top = caret.Y - window.Height - 20;
|
||||
|
||||
return new Point(
|
||||
left < screen.X ? screen.X : (left + window.Width > (screen.X + screen.Width) ? (screen.X + screen.Width) - window.Width : left),
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
@@ -24,7 +23,7 @@ namespace PowerAccent.Core.Tools
|
||||
}
|
||||
|
||||
// Using InvariantCulture since this is used for a log file name
|
||||
var logFilePath = _fileSystem.Path.Combine(ApplicationLogPath, "Log_" + DateTime.Now.ToString(@"yyyy-MM-dd", CultureInfo.InvariantCulture) + ".txt");
|
||||
string logFilePath = _fileSystem.Path.Combine(ApplicationLogPath, "Log_" + DateTime.Now.ToString(@"yyyy-MM-dd", CultureInfo.InvariantCulture) + ".txt");
|
||||
|
||||
Trace.Listeners.Add(new TextWriterTraceListener(logFilePath));
|
||||
|
||||
@@ -71,8 +70,8 @@ namespace PowerAccent.Core.Tools
|
||||
{
|
||||
StackTrace stackTrace = new StackTrace();
|
||||
|
||||
var methodName = stackTrace.GetFrame(3)?.GetMethod();
|
||||
var className = methodName?.DeclaringType?.Name;
|
||||
System.Reflection.MethodBase methodName = stackTrace.GetFrame(3)?.GetMethod();
|
||||
string className = methodName?.DeclaringType?.Name;
|
||||
return "[Method]: " + methodName?.Name + " [Class]: " + className;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user