Compare commits

..
2 Commits
Author SHA1 Message Date
rmbgame 9c13426781 fix more screen 2021-06-06 01:48:44 +08:00
rmbgame 67ec02af0c fix taskbar high dpi error 2021-06-06 01:42:11 +08:00
3 changed files with 9 additions and 5 deletions
@@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
Width="180" Height="400"
Width="180"
x:Class="System.Application.UI.Views.Windows.TaskBarWindow"
xmlns:resx="clr-namespace:System.Application.UI.Resx;assembly=System.Application.SteamTools.Client.Desktop"
xmlns:service="clr-namespace:System.Application.Services;assembly=System.Application.SteamTools.Client.Desktop"
@@ -49,17 +49,21 @@ namespace System.Application.UI.Views.Windows
//{
// this.Position = new PixelPoint(vm.SizePosition.X, vm.SizePosition.Y - (int)this.Height);
//}
var workingAreaWidth = this.Screens.Primary.WorkingArea.Width;
vm.WhenAnyValue(x => x.SizePosition.X, x => x.SizePosition.Y)
.Subscribe(x =>
{
var screen = this.Screens.ScreenFromPoint(new PixelPoint(x.Item1, x.Item2));
var workingAreaWidth = screen.WorkingArea.Width;
if ((x.Item1 + (int)this.Width + 30) > workingAreaWidth)
{
this.Position = new PixelPoint(x.Item1 - (int)this.Width, x.Item2 - (int)this.Height);
this.Position = new PixelPoint(x.Item1 - (int)(this.Width * screen.PixelDensity), x.Item2 - (int)(this.Height * screen.PixelDensity));
}
else
{
this.Position = new PixelPoint(x.Item1, x.Item2 - (int)this.Height);
this.Position = new PixelPoint(x.Item1, x.Item2 - (int)(this.Height * screen.PixelDensity));
}
});
}
@@ -55,7 +55,7 @@ namespace System.Application.UI
JumpList jumpList1 = JumpList.GetJumpList(AvaloniaApplication.Current);
if (jumpList1 != null)
{
var tk = jumpList1.JumpItems.FirstOrDefault(s => s is JumpTask t && t.Arguments == task.Arguments);
var tk = jumpList1.JumpItems.FirstOrDefault(s => s is JumpTask t && t.ApplicationPath == task.ApplicationPath && t.Arguments == task.Arguments);
if (tk != null)
{
jumpList1.JumpItems.Remove(tk);