Code cleanup

This commit is contained in:
Tig
2024-11-01 07:49:18 -06:00
parent 8835126470
commit b0b5b23632
7 changed files with 14 additions and 34 deletions

View File

@@ -160,7 +160,6 @@ public class Adornment : View, IDesignable
/// <summary>
/// Called when the <see cref="Thickness"/> of the Adornment is to be cleared.
/// </summary>
/// <param name="viewport"></param>
/// <returns><see langword="true"/> to stop further clearing.</returns>
protected override bool OnClearingViewport ()
{
@@ -187,7 +186,6 @@ public class Adornment : View, IDesignable
protected override bool OnDrawingSubviews () { return Thickness == Thickness.Empty; }
/// <summary>Does nothing for Adornment</summary>
/// <param name="clipRegion"></param>
/// <returns></returns>
protected override bool OnRenderingLineCanvas () { return true; }

View File

@@ -941,22 +941,11 @@ public class Border : Adornment
return true; ;
}
/// <summary>
/// Gets the subview used to render <see cref="ViewDiagnosticFlags.DrawIndicator"/>.
/// </summary>
public SpinnerView? DrawIndicator { get; private set; } = null;
/// <param name="clipRegion"></param>
/// <inheritdoc />
protected override bool OnRenderingLineCanvas ()
{
if (DrawIndicator is { })
{
//DrawIndicator.AdvanceAnimation (false);
//DrawIndicator.DrawText();
}
RenderLineCanvas ();
return true;
}
private void SetupGradientLineCanvas (LineCanvas lc, Rectangle rect)
{
GetAppealingGradientColors (out List<Color> stops, out List<int> steps);

View File

@@ -37,15 +37,15 @@ public partial class View // Drawing APIs
saved = SetClipToViewport ();
DoSetAttribute ();
DoDrawSubviews ();
//DoSetAttribute ();
DoClearViewport ();
//DoSetAttribute ();
DoSetAttribute ();
DoDrawSubviews ();
DoSetAttribute ();
DoDrawText ();
//DoSetAttribute ();
DoSetAttribute ();
DoDrawContent ();
// Restore the clip before rendering the line canvas and adornment subviews

View File

@@ -255,9 +255,6 @@ public partial class View : Responder, ISupportInitializeNotification
private bool _enabled = true;
// This is a cache of the Enabled property so that we can restore it when the superview is re-enabled.
private bool _oldEnabled;
/// <summary>Gets or sets a value indicating whether this <see cref="Responder"/> can respond to user interaction.</summary>
public bool Enabled
{

View File

@@ -202,9 +202,6 @@ public class Bar : View, IOrientation, IDesignable
LayoutBarItems (args.OldContentSize);
}
// This is used to calculate the minimum width of the Bar when the width is NOT Dim.Auto
private int? _minimumDimAutoWidth;
private void LayoutBarItems (Size contentSize)
{
View? prevBarItem = null;

View File

@@ -89,7 +89,7 @@ public class SpinnerView : View, IDesignable
/// <summary>Gets or sets the number of milliseconds to wait between characters in the animation.</summary>
/// <remarks>
/// This is the maximum speed the spinner will rotate at. You still need to call
/// <see cref="SpinnerView.AdvanceAnimation()"/> or <see cref="SpinnerView.AutoSpin"/> to advance/start animation.
/// <see cref="SpinnerView.AdvanceAnimation(bool)"/> or <see cref="SpinnerView.AutoSpin"/> to advance/start animation.
/// </remarks>
public int SpinDelay
{

View File

@@ -1,4 +1,5 @@
using Terminal.Gui;
using System;
using Terminal.Gui;
namespace UICatalog.Scenarios;
@@ -35,9 +36,8 @@ public class Adornments : Scenario
Title = "The _Window",
Arrangement = ViewArrangement.Movable,
// X = Pos.Center (),
Width = Dim.Percent (60),
Height = Dim.Percent (90)
Width = Dim.Fill (Dim.Func (() => editor.Frame.Width )),
Height = Dim.Fill ()
};
app.Add (window);
@@ -84,7 +84,7 @@ public class Adornments : Scenario
};
window.Margin.Data = "Margin";
window.Margin.Text = "Margin Text";
window.Margin.Text = "Margin Text";
window.Margin.Thickness = new (0);
window.Border.Data = "Border";
@@ -104,7 +104,6 @@ public class Adornments : Scenario
longLabel.TextFormatter.WordWrap = true;
window.Add (tf1, color, button, label, btnButtonInWindow, labelAnchorEnd, longLabel);
window.ClearingViewport += (s, e) => e.Cancel = true;
window.Initialized += (s, e) =>
{
editor.ViewToEdit = window;