Skip to content

Commit

Permalink
fix #340
Browse files Browse the repository at this point in the history
  • Loading branch information
mgth committed May 19, 2024
1 parent 581ff05 commit 0481ffc
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using Avalonia.Media;
using LittleBigMouse.DisplayLayout.Monitors;
using LittleBigMouse.Plugin.Layout.Avalonia.LocationPlugin.Anchors;
using LittleBigMouse.Plugins;
using LittleBigMouse.Plugins.Avalonia;
using LittleBigMouse.Ui.Avalonia.MonitorFrame;
using ReactiveUI;

namespace LittleBigMouse.Plugin.Layout.Avalonia.LocationPlugin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ You should have received a copy of the GNU General Public License
using LittleBigMouse.Plugin.Layout.Avalonia.LocationPlugin.Anchors;
using LittleBigMouse.Plugins;
using LittleBigMouse.Plugins.Avalonia;
using LittleBigMouse.Ui.Avalonia.MonitorFrame;

using static HLab.Sys.Windows.API.WinUser;

namespace LittleBigMouse.Plugin.Layout.Avalonia.LocationPlugin;
Expand Down Expand Up @@ -135,7 +133,7 @@ protected override void OnPointerPressed(PointerPressedEventArgs e)

_frameLocation = this.GetFrameLocation();

_frameMover = new FrameMover(
_frameMover = new (
model,
layout,
frame,
Expand All @@ -161,7 +159,8 @@ protected void EndMove(PointerEventArgs e)
_frameMover?.EndMove(e.GetPosition(MainPanel));
_frameMover = null;
// restore frame location to normal behavior
this.SetFrameLocation(_frameLocation);
if(_frameLocation != null)
_ = this.SetFrameLocation(_frameLocation);

e.Pointer.Capture(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Avalonia;
using Avalonia.VisualTree;
using LittleBigMouse.DisplayLayout.Monitors;
using LittleBigMouse.Ui.Avalonia.MonitorFrame;

namespace LittleBigMouse.Plugins.Avalonia;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace LittleBigMouse.Ui.Avalonia.MonitorFrame;
namespace LittleBigMouse.Plugins;

public interface IFrameLocation
{
public double Width { get; }
public double Height { get; }
public double X { get; }
public double Y { get; }
public double X { get; set;}
public double Y { get; set;}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using HLab.Mvvm.Annotations;
using LittleBigMouse.DisplayLayout.Monitors;
using LittleBigMouse.Ui.Avalonia.MonitorFrame;

namespace LittleBigMouse.Plugins;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using ReactiveUI;
using LittleBigMouse.DisplayLayout.Monitors;
using LittleBigMouse.Plugins;

namespace LittleBigMouse.Ui.Avalonia.MonitorFrame;

Expand Down Expand Up @@ -34,9 +35,17 @@ public FrameLocation(PhysicalMonitor monitor)
public double Height => _height.Value;
readonly ObservableAsPropertyHelper<double> _height;

public double X => _x.Value;
public double X
{
get => _x.Value;
set => Monitor.DepthProjection.X = value;
}
readonly ObservableAsPropertyHelper<double> _x;

public double Y => _y.Value;
public double Y
{
get => _y.Value;
set => Monitor.DepthProjection.Y = value;
}
readonly ObservableAsPropertyHelper<double> _y;
}

0 comments on commit 0481ffc

Please sign in to comment.