Browse Source

Fix formatting

pull/2551/head
MarkusKgit 7 years ago
parent
commit
3860fafa00
  1. 10
      src/Avalonia.X11/X11CursorFactory.cs
  2. 4
      src/Gtk/Avalonia.Gtk3/CursorFactory.cs
  3. 4
      src/Windows/Avalonia.Win32/CursorFactory.cs

10
src/Avalonia.X11/X11CursorFactory.cs

@ -9,7 +9,7 @@ namespace Avalonia.X11
class X11CursorFactory : IStandardCursorFactory class X11CursorFactory : IStandardCursorFactory
{ {
private static IntPtr _nullCursor; private static IntPtr _nullCursor;
private readonly IntPtr _display; private readonly IntPtr _display;
private Dictionary<CursorFontShape, IntPtr> _cursors; private Dictionary<CursorFontShape, IntPtr> _cursors;
@ -48,10 +48,10 @@ namespace Avalonia.X11
_cursors = Enum.GetValues(typeof(CursorFontShape)).Cast<CursorFontShape>() _cursors = Enum.GetValues(typeof(CursorFontShape)).Cast<CursorFontShape>()
.ToDictionary(id => id, id => XLib.XCreateFontCursor(_display, id)); .ToDictionary(id => id, id => XLib.XCreateFontCursor(_display, id));
} }
public IPlatformHandle GetCursor(StandardCursorType cursorType) public IPlatformHandle GetCursor(StandardCursorType cursorType)
{ {
IntPtr handle; IntPtr handle;
if (cursorType == StandardCursorType.None) if (cursorType == StandardCursorType.None)
{ {
handle = _nullCursor; handle = _nullCursor;
@ -61,7 +61,7 @@ namespace Avalonia.X11
handle = s_mapping.TryGetValue(cursorType, out var shape) handle = s_mapping.TryGetValue(cursorType, out var shape)
? _cursors[shape] ? _cursors[shape]
: _cursors[CursorFontShape.XC_top_left_arrow]; : _cursors[CursorFontShape.XC_top_left_arrow];
} }
return new PlatformHandle(handle, "XCURSOR"); return new PlatformHandle(handle, "XCURSOR");
} }
@ -71,7 +71,7 @@ namespace Avalonia.X11
byte[] data = new byte[] { 0 }; byte[] data = new byte[] { 0 };
IntPtr window = XLib.XRootWindow(display, 0); IntPtr window = XLib.XRootWindow(display, 0);
IntPtr pixmap = XLib.XCreateBitmapFromData(display, window, data, 1, 1); IntPtr pixmap = XLib.XCreateBitmapFromData(display, window, data, 1, 1);
return XLib.XCreatePixmapCursor(display, pixmap, pixmap, ref color, ref color, 0, 0); return XLib.XCreatePixmapCursor(display, pixmap, pixmap, ref color, ref color, 0, 0);
} }
} }
} }

4
src/Gtk/Avalonia.Gtk3/CursorFactory.cs

@ -13,7 +13,7 @@ namespace Avalonia.Gtk3
<StandardCursorType, object> <StandardCursorType, object>
{ {
{StandardCursorType.None, CursorType.Blank}, {StandardCursorType.None, CursorType.Blank},
{ StandardCursorType.AppStarting, CursorType.Watch}, {StandardCursorType.AppStarting, CursorType.Watch},
{StandardCursorType.Arrow, CursorType.LeftPtr}, {StandardCursorType.Arrow, CursorType.LeftPtr},
{StandardCursorType.Cross, CursorType.Cross}, {StandardCursorType.Cross, CursorType.Cross},
{StandardCursorType.Hand, CursorType.Hand1}, {StandardCursorType.Hand, CursorType.Hand1},
@ -37,7 +37,7 @@ namespace Avalonia.Gtk3
{StandardCursorType.BottomRightCorner, CursorType.BottomRightCorner}, {StandardCursorType.BottomRightCorner, CursorType.BottomRightCorner},
{StandardCursorType.DragCopy, CursorType.CenterPtr}, {StandardCursorType.DragCopy, CursorType.CenterPtr},
{StandardCursorType.DragMove, CursorType.Fleur}, {StandardCursorType.DragMove, CursorType.Fleur},
{StandardCursorType.DragLink, CursorType.Cross}, {StandardCursorType.DragLink, CursorType.Cross},
}; };
private static readonly Dictionary<StandardCursorType, IPlatformHandle> Cache = private static readonly Dictionary<StandardCursorType, IPlatformHandle> Cache =

4
src/Windows/Avalonia.Win32/CursorFactory.cs

@ -42,7 +42,7 @@ namespace Avalonia.Win32
<StandardCursorType, int> <StandardCursorType, int>
{ {
{StandardCursorType.None, 0}, {StandardCursorType.None, 0},
{ StandardCursorType.AppStarting, 32650}, {StandardCursorType.AppStarting, 32650},
{StandardCursorType.Arrow, 32512}, {StandardCursorType.Arrow, 32512},
{StandardCursorType.Cross, 32515}, {StandardCursorType.Cross, 32515},
{StandardCursorType.Hand, 32649}, {StandardCursorType.Hand, 32649},
@ -70,7 +70,7 @@ namespace Avalonia.Win32
// Fallback, should have been loaded from ole32.dll // Fallback, should have been loaded from ole32.dll
{StandardCursorType.DragMove, 32516}, {StandardCursorType.DragMove, 32516},
{StandardCursorType.DragCopy, 32516}, {StandardCursorType.DragCopy, 32516},
{StandardCursorType.DragLink, 32516}, {StandardCursorType.DragLink, 32516},
}; };
private static readonly Dictionary<StandardCursorType, IPlatformHandle> Cache = private static readonly Dictionary<StandardCursorType, IPlatformHandle> Cache =

Loading…
Cancel
Save