mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 12:46:47 +02:00
Change WindowIntelopHelper to WindowIntelopHelper (#887)
This commit is contained in:
@@ -10,7 +10,7 @@ using Point = System.Windows.Point;
|
|||||||
|
|
||||||
namespace Wox.Helper
|
namespace Wox.Helper
|
||||||
{
|
{
|
||||||
public class WindowIntelopHelper
|
public class WindowsInteropHelper
|
||||||
{
|
{
|
||||||
private const int GWL_STYLE = -16; //WPF's Message code for Title Bar's Style
|
private const int GWL_STYLE = -16; //WPF's Message code for Title Bar's Style
|
||||||
private const int WS_SYSMENU = 0x80000; //WPF's Message code for System Menu
|
private const int WS_SYSMENU = 0x80000; //WPF's Message code for System Menu
|
||||||
@@ -54,7 +54,7 @@ namespace Wox
|
|||||||
|
|
||||||
private void OnLoaded(object sender, RoutedEventArgs _)
|
private void OnLoaded(object sender, RoutedEventArgs _)
|
||||||
{
|
{
|
||||||
WindowIntelopHelper.DisableControlBox(this);
|
WindowsInteropHelper.DisableControlBox(this);
|
||||||
ThemeManager.Instance.ChangeTheme(_settings.Theme);
|
ThemeManager.Instance.ChangeTheme(_settings.Theme);
|
||||||
InitProgressbarAnimation();
|
InitProgressbarAnimation();
|
||||||
|
|
||||||
@@ -200,8 +200,8 @@ namespace Wox
|
|||||||
private double WindowLeft()
|
private double WindowLeft()
|
||||||
{
|
{
|
||||||
var screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position);
|
var screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position);
|
||||||
var dip1 = WindowIntelopHelper.TransformPixelsToDIP(this, screen.WorkingArea.X, 0);
|
var dip1 = WindowsInteropHelper.TransformPixelsToDIP(this, screen.WorkingArea.X, 0);
|
||||||
var dip2 = WindowIntelopHelper.TransformPixelsToDIP(this, screen.WorkingArea.Width, 0);
|
var dip2 = WindowsInteropHelper.TransformPixelsToDIP(this, screen.WorkingArea.Width, 0);
|
||||||
var left = (dip2.X - ActualWidth) / 2 + dip1.X;
|
var left = (dip2.X - ActualWidth) / 2 + dip1.X;
|
||||||
return left;
|
return left;
|
||||||
}
|
}
|
||||||
@@ -209,8 +209,8 @@ namespace Wox
|
|||||||
private double WindowTop()
|
private double WindowTop()
|
||||||
{
|
{
|
||||||
var screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position);
|
var screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position);
|
||||||
var dip1 = WindowIntelopHelper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Y);
|
var dip1 = WindowsInteropHelper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Y);
|
||||||
var dip2 = WindowIntelopHelper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Height);
|
var dip2 = WindowsInteropHelper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Height);
|
||||||
var top = (dip2.Y - QueryTextBox.ActualHeight) / 4 + dip1.Y;
|
var top = (dip2.Y - QueryTextBox.ActualHeight) / 4 + dip1.Y;
|
||||||
return top;
|
return top;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace Wox
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
var screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position);
|
var screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position);
|
||||||
var dipWorkingArea = WindowIntelopHelper.TransformPixelsToDIP(this,
|
var dipWorkingArea = WindowsInteropHelper.TransformPixelsToDIP(this,
|
||||||
screen.WorkingArea.Width,
|
screen.WorkingArea.Width,
|
||||||
screen.WorkingArea.Height);
|
screen.WorkingArea.Height);
|
||||||
Left = dipWorkingArea.X - Width;
|
Left = dipWorkingArea.X - Width;
|
||||||
|
|||||||
@@ -544,7 +544,7 @@ namespace Wox.ViewModel
|
|||||||
{
|
{
|
||||||
//double if to omit calling win32 function
|
//double if to omit calling win32 function
|
||||||
if (_settings.IgnoreHotkeysOnFullscreen)
|
if (_settings.IgnoreHotkeysOnFullscreen)
|
||||||
if (WindowIntelopHelper.IsWindowFullscreen())
|
if (WindowsInteropHelper.IsWindowFullscreen())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -187,7 +187,7 @@
|
|||||||
<Compile Include="Helper\SingleInstance.cs" />
|
<Compile Include="Helper\SingleInstance.cs" />
|
||||||
<Compile Include="Helper\SyntaxSugars.cs" />
|
<Compile Include="Helper\SyntaxSugars.cs" />
|
||||||
<Compile Include="Helper\WallpaperPathRetrieval.cs" />
|
<Compile Include="Helper\WallpaperPathRetrieval.cs" />
|
||||||
<Compile Include="Helper\WindowIntelopHelper.cs" />
|
<Compile Include="Helper\WindowsInteropHelper.cs" />
|
||||||
<Compile Include="CustomQueryHotkeySetting.xaml.cs">
|
<Compile Include="CustomQueryHotkeySetting.xaml.cs">
|
||||||
<DependentUpon>CustomQueryHotkeySetting.xaml</DependentUpon>
|
<DependentUpon>CustomQueryHotkeySetting.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|||||||
Reference in New Issue
Block a user