From d4f7440fdafbbbefcef11e4a31b066e7543b75d3 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Tue, 29 Oct 2024 19:29:03 +0000
Subject: [PATCH] Automated JetBrains cleanup
Co-authored-by: <+@users.noreply.github.com>
---
Directory.Core.Build.props | 2 +-
.../Drawing/ConsoloniaRenderInterface.cs | 13 +++++----
.../Drawing/DrawingContextImpl.cs | 25 +++++++++--------
.../Drawing/FourBitColorBrush.cs | 20 ++++++-------
src/Consolonia.Core/Drawing/Rectangle.cs | 2 +-
src/Consolonia.Core/Drawing/RenderTarget.cs | 16 +++++------
.../ArrowsAndKeyboardNavigationHandler.cs | 4 +--
.../Infrastructure/ConsoleWindow.cs | 26 ++++++++---------
.../Infrastructure/ConsoloniaPlatform.cs | 2 +-
.../Infrastructure/ExceptionSink.cs | 4 +--
.../InputLessDefaultNetConsole.cs | 6 ++--
.../InternalHelpers/CommonInternalHelper.cs | 3 +-
.../Styles/ResourceIncludeBase.cs | 3 +-
src/Consolonia.Core/Text/FontManagerImpl.cs | 15 +++++-----
src/Consolonia.Core/Text/GlyphRunImpl.cs | 4 +--
src/Consolonia.Core/Text/TextShaper.cs | 9 ++----
.../WindowsConsole.cs | 8 +++---
.../Templates/Controls/Button.axaml | 4 +--
.../Templates/Controls/CalendarItem.axaml | 6 ++--
.../Templates/Controls/ComboBox.axaml | 5 ++--
.../Templates/Controls/DataGrid.axaml | 14 +++++-----
.../Controls/Dialog/DialogHelpers.cs | 2 +-
.../Templates/Controls/DialogWrap.axaml | 2 +-
.../Templates/Controls/DialogWrap.axaml.cs | 18 ++++++------
.../Helpers/AreIntegersEqualConverter.cs | 4 ---
.../Controls/Helpers/FastLineSeparator.cs | 18 ++++++------
.../Controls/Helpers/MenuExtensions.cs | 4 ++-
.../Controls/Helpers/SymbolsControl.cs | 22 +++++++--------
.../Controls/Helpers/TextBoxCaret.cs | 12 ++++----
.../Templates/Controls/ItemsControl.axaml | 2 +-
.../Templates/Controls/ScrollViewer.axaml | 8 ++++--
.../Templates/Controls/Separator.axaml | 2 +-
.../Templates/Controls/TabControl.axaml | 2 +-
.../Templates/Controls/TextBox.axaml | 28 ++++++++++++-------
.../Templates/TurboVisionDefaultColors.axaml | 2 +-
.../Base/GalleryTestsBaseBase.cs | 4 ++-
.../ConsoloniaAppTestBase.cs | 17 +++++------
.../Consolonia.TestsCore/UnitTestConsole.cs | 1 -
38 files changed, 172 insertions(+), 167 deletions(-)
diff --git a/Directory.Core.Build.props b/Directory.Core.Build.props
index 4f24099a..90acdb61 100644
--- a/Directory.Core.Build.props
+++ b/Directory.Core.Build.props
@@ -11,7 +11,7 @@
true
- true
+ true
true
\ No newline at end of file
diff --git a/src/Consolonia.Core/Drawing/ConsoloniaRenderInterface.cs b/src/Consolonia.Core/Drawing/ConsoloniaRenderInterface.cs
index 998dfb1e..7f03c62e 100644
--- a/src/Consolonia.Core/Drawing/ConsoloniaRenderInterface.cs
+++ b/src/Consolonia.Core/Drawing/ConsoloniaRenderInterface.cs
@@ -90,12 +90,14 @@ public IWriteableBitmapImpl LoadWriteableBitmap(Stream stream)
throw new NotImplementedException();
}
- IBitmapImpl IPlatformRenderInterface.LoadBitmapToWidth(Stream stream, int width, BitmapInterpolationMode interpolationMode)
+ IBitmapImpl IPlatformRenderInterface.LoadBitmapToWidth(Stream stream, int width,
+ BitmapInterpolationMode interpolationMode)
{
throw new NotImplementedException();
}
- IBitmapImpl IPlatformRenderInterface.LoadBitmapToHeight(Stream stream, int height, BitmapInterpolationMode interpolationMode)
+ IBitmapImpl IPlatformRenderInterface.LoadBitmapToHeight(Stream stream, int height,
+ BitmapInterpolationMode interpolationMode)
{
throw new NotImplementedException();
}
@@ -105,7 +107,7 @@ IBitmapImpl IPlatformRenderInterface.ResizeBitmap(IBitmapImpl bitmapImpl, PixelS
{
throw new NotImplementedException();
}
-
+
public IBitmapImpl LoadBitmap(
PixelFormat format,
AlphaFormat alphaFormat,
@@ -117,10 +119,11 @@ public IBitmapImpl LoadBitmap(
throw new NotImplementedException();
}
- public IGlyphRunImpl CreateGlyphRun(IGlyphTypeface glyphTypeface, double fontRenderingEmSize, IReadOnlyList glyphInfos,
+ public IGlyphRunImpl CreateGlyphRun(IGlyphTypeface glyphTypeface, double fontRenderingEmSize,
+ IReadOnlyList glyphInfos,
Point baselineOrigin)
{
- return new GlyphRunImpl(glyphTypeface,glyphInfos,baselineOrigin);
+ return new GlyphRunImpl(glyphTypeface, glyphInfos, baselineOrigin);
}
public IPlatformRenderInterfaceContext CreateBackendContext(IPlatformGraphicsContext graphicsApiContext)
diff --git a/src/Consolonia.Core/Drawing/DrawingContextImpl.cs b/src/Consolonia.Core/Drawing/DrawingContextImpl.cs
index ec846958..ba90be07 100644
--- a/src/Consolonia.Core/Drawing/DrawingContextImpl.cs
+++ b/src/Consolonia.Core/Drawing/DrawingContextImpl.cs
@@ -170,6 +170,7 @@ public void DrawGlyphRun(IBrush foreground, IGlyphRunImpl glyphRun)
ConsoloniaPlatform.RaiseNotSupported(17, glyphRun);
throw new InvalidProgramException();
}
+
if (glyphRun.FontRenderingEmSize.IsNearlyEqual(0)) return;
if (!glyphRun.FontRenderingEmSize.IsNearlyEqual(1))
{
@@ -195,9 +196,9 @@ public void PushClip(Rect clip)
public void PushClip(RoundedRect clip)
{
- if(clip.IsRounded)
+ if (clip.IsRounded)
ConsoloniaPlatform.RaiseNotSupported(2);
-
+
PushClip(clip.Rect);
}
@@ -265,13 +266,13 @@ public Matrix Transform
{
lineStyle = null;
if (pen is not
- {
- Brush: FourBitColorBrush or LineBrush { Brush: FourBitColorBrush },
- Thickness: 1,
- DashStyle: null or { Dashes.Count: 0 },
- LineCap: PenLineCap.Flat,
- LineJoin: PenLineJoin.Miter
- })
+ {
+ Brush: FourBitColorBrush or LineBrush { Brush: FourBitColorBrush },
+ Thickness: 1,
+ DashStyle: null or { Dashes.Count: 0 },
+ LineCap: PenLineCap.Flat,
+ LineJoin: PenLineJoin.Miter
+ })
{
ConsoloniaPlatform.RaiseNotSupported(6);
return null;
@@ -352,7 +353,7 @@ void DrawPixelAndMoveHead(int count)
}
}
}
-
+
private void DrawStringInternal(IBrush foreground, string str, Point origin = new())
{
if (foreground is not FourBitColorBrush { Mode: PixelBackgroundMode.Colored } consoleColorBrush)
@@ -394,8 +395,8 @@ void DrawPixelAndMoveHead(int count)
case '\n':
{
/* it's not clear if we need to draw anything. Cursor can be placed at the end of the line
- var consolePixel = new Pixel(' ', foregroundColor);
-
+ var consolePixel = new Pixel(' ', foregroundColor);
+
_pixelBuffer.Set((PixelBufferCoordinate)characterPoint,
(oldPixel, cp) => oldPixel.Blend(cp), consolePixel);*/
}
diff --git a/src/Consolonia.Core/Drawing/FourBitColorBrush.cs b/src/Consolonia.Core/Drawing/FourBitColorBrush.cs
index 0a9d5242..bd523b82 100644
--- a/src/Consolonia.Core/Drawing/FourBitColorBrush.cs
+++ b/src/Consolonia.Core/Drawing/FourBitColorBrush.cs
@@ -43,19 +43,19 @@ public ConsoleColor Color
set => SetValue(ColorProperty, value);
}
+ public double Opacity => 1;
+ public ITransform Transform => null;
+ public RelativePoint TransformOrigin => RelativePoint.TopLeft;
+
// ReSharper disable once UnusedMember.Global used by Avalonia
// ReSharper disable once UnusedParameter.Global
public IBrush ProvideValue(IServiceProvider _)
{
return this;
}
-
- public double Opacity => 1;
- public ITransform Transform => null;
- public RelativePoint TransformOrigin => RelativePoint.TopLeft;
}
- public class FourBitBrushConverter : TypeConverter
+ public class FourBitBrushConverter : TypeConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
@@ -66,15 +66,11 @@ public override object ConvertFrom(
ITypeDescriptorContext context, CultureInfo culture, object value)
{
if (value is string s)
- {
- return Enum.TryParse(s, out ConsoleColor result)
- ? result
+ return Enum.TryParse(s, out ConsoleColor result)
+ ? result
: null;
- }
-
+
return null;
}
}
-
-
}
\ No newline at end of file
diff --git a/src/Consolonia.Core/Drawing/Rectangle.cs b/src/Consolonia.Core/Drawing/Rectangle.cs
index 74a2aa2c..ad001372 100644
--- a/src/Consolonia.Core/Drawing/Rectangle.cs
+++ b/src/Consolonia.Core/Drawing/Rectangle.cs
@@ -34,7 +34,7 @@ public IGeometryImpl Intersect(IGeometryImpl geometry)
throw new NotImplementedException();
}
- public bool StrokeContains([NotNull]IPen pen, Point point)
+ public bool StrokeContains([NotNull] IPen pen, Point point)
{
if (pen!.Thickness == 0)
return false;
diff --git a/src/Consolonia.Core/Drawing/RenderTarget.cs b/src/Consolonia.Core/Drawing/RenderTarget.cs
index 096edd7b..d4cacc4e 100644
--- a/src/Consolonia.Core/Drawing/RenderTarget.cs
+++ b/src/Consolonia.Core/Drawing/RenderTarget.cs
@@ -67,6 +67,13 @@ void IDrawingContextLayerImpl.Blit(IDrawingContextImpl context)
bool IDrawingContextLayerImpl.CanBlit => true;
+ public IDrawingContextImpl CreateDrawingContext()
+ {
+ return new DrawingContextImpl(_consoleWindow, _bufferBuffer);
+ }
+
+ public bool IsCorrupted => false;
+
private void OnResized(Size size, WindowResizeReason reason)
{
@@ -110,7 +117,7 @@ private void RenderToDevice()
throw new InvalidOperationException("Caret is already shown");
caretPosition = new PixelBufferCoordinate(x, y);
}
-
+
/* todo: There is not IWindowImpl.Invalidate anymore.
if (!_consoleWindow.InvalidatedRects.Any(rect =>
rect.ContainsExclusive(new Point(x, y)))) continue;*/
@@ -221,12 +228,5 @@ public void Flush()
_stringBuilder.Clear();
}
}
-
- public IDrawingContextImpl CreateDrawingContext()
- {
- return new DrawingContextImpl(_consoleWindow, _bufferBuffer);
- }
-
- public bool IsCorrupted => false;
}
}
\ No newline at end of file
diff --git a/src/Consolonia.Core/Infrastructure/ArrowsAndKeyboardNavigationHandler.cs b/src/Consolonia.Core/Infrastructure/ArrowsAndKeyboardNavigationHandler.cs
index a3b90fc1..a2562213 100644
--- a/src/Consolonia.Core/Infrastructure/ArrowsAndKeyboardNavigationHandler.cs
+++ b/src/Consolonia.Core/Infrastructure/ArrowsAndKeyboardNavigationHandler.cs
@@ -10,11 +10,11 @@ namespace Consolonia.Core.Infrastructure
{
public class ArrowsAndKeyboardNavigationHandler : IKeyboardNavigationHandler
{
+ private readonly IKeyboardNavigationHandler _keyboardNavigationHandler;
+
//todo: check XTFocus https://github.com/jinek/Consolonia/issues/105#issuecomment-2089015880
private IInputRoot _owner;
- private readonly IKeyboardNavigationHandler _keyboardNavigationHandler;
-
public ArrowsAndKeyboardNavigationHandler(IKeyboardNavigationHandler keyboardNavigationHandler)
{
_keyboardNavigationHandler = keyboardNavigationHandler;
diff --git a/src/Consolonia.Core/Infrastructure/ConsoleWindow.cs b/src/Consolonia.Core/Infrastructure/ConsoleWindow.cs
index 9f684510..f7f03703 100644
--- a/src/Consolonia.Core/Infrastructure/ConsoleWindow.cs
+++ b/src/Consolonia.Core/Infrastructure/ConsoleWindow.cs
@@ -32,6 +32,8 @@ public ConsoleWindow()
Handle = null!;
}
+ private IMouseDevice MouseDevice { get; }
+
public void Dispose()
{
Closed?.Invoke();
@@ -41,7 +43,7 @@ public void Dispose()
Console.FocusEvent -= ConsoleOnFocusEvent;
Console.Dispose();
}
-
+
public void SetInputRoot(IInputRoot inputRoot)
{
_inputRoot = inputRoot;
@@ -77,7 +79,7 @@ public void SetFrameThemeVariant(PlatformThemeVariant themeVariant)
{
//todo:
}
-
+
public Size ClientSize
{
get
@@ -105,7 +107,6 @@ public Size ClientSize
public Compositor Compositor { get; } = new(null);
public Action Closed { get; set; }
public Action LostFocus { get; set; }
- private IMouseDevice MouseDevice { get; }
public WindowTransparencyLevel TransparencyLevel => WindowTransparencyLevel.None;
@@ -241,6 +242,14 @@ public void SetExtendClientAreaTitleBarHeightHint(double titleBarHeight)
// ReSharper disable once UnassignedGetOnlyAutoProperty todo: what is this property
public Thickness OffScreenMargin { get; }
+ public object TryGetFeature(Type featureType)
+ {
+ if (featureType == typeof(ISystemNavigationManagerImpl))
+ return null;
+ if (featureType == typeof(ITextInputMethodImpl)) return null;
+ throw new NotImplementedException("Consider this");
+ }
+
private void ConsoleOnMouseEvent(RawPointerEventType type, Point point, Vector? wheelDelta,
RawInputModifiers modifiers)
{
@@ -334,16 +343,5 @@ await Dispatcher.UIThread.InvokeAsync(() =>
}, DispatcherPriority.Input);
}
}
-
- public object TryGetFeature(Type featureType)
- {
- if (featureType == typeof(ISystemNavigationManagerImpl))
- return null;
- if (featureType == typeof(ITextInputMethodImpl))
- {
- return null;
- }
- throw new NotImplementedException("Consider this");
- }
}
}
\ No newline at end of file
diff --git a/src/Consolonia.Core/Infrastructure/ConsoloniaPlatform.cs b/src/Consolonia.Core/Infrastructure/ConsoloniaPlatform.cs
index abc60746..f65c7f2c 100644
--- a/src/Consolonia.Core/Infrastructure/ConsoloniaPlatform.cs
+++ b/src/Consolonia.Core/Infrastructure/ConsoloniaPlatform.cs
@@ -41,7 +41,7 @@ public void Initialize()
.Bind().ToConstant(new UiThreadRenderTimer(120))
.Bind().ToConstant(new ManagedDispatcherImpl(null))
/*.Bind().ToConstant(new SleepLoopRenderTimer(120))*/
- /*SleepLoopRenderTimer : IRenderTimer*/
+ /*SleepLoopRenderTimer : IRenderTimer*/
/*.Bind().ToConstant(new RenderLoop()) todo: is internal now*/
.Bind().ToConstant(new PlatformHotkeyConfiguration(KeyModifiers.Control))
.Bind().ToConstant(new ConsoleKeyboardDevice())
diff --git a/src/Consolonia.Core/Infrastructure/ExceptionSink.cs b/src/Consolonia.Core/Infrastructure/ExceptionSink.cs
index ba5bf7bb..717fdf66 100644
--- a/src/Consolonia.Core/Infrastructure/ExceptionSink.cs
+++ b/src/Consolonia.Core/Infrastructure/ExceptionSink.cs
@@ -16,9 +16,7 @@ public bool IsEnabled(LogEventLevel level, string area)
public void Log(LogEventLevel level, string area, object source, string messageTemplate)
{
Log(level, area, source, messageTemplate, Array.Empty