mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
IDesignable for SpinnerView
This commit is contained in:
@@ -11,7 +11,7 @@ namespace Terminal.Gui;
|
||||
/// By default animation only occurs when you call <see cref="SpinnerView.AdvanceAnimation()"/>. Use
|
||||
/// <see cref="AutoSpin"/> to make the automate calls to <see cref="SpinnerView.AdvanceAnimation()"/>.
|
||||
/// </remarks>
|
||||
public class SpinnerView : View
|
||||
public class SpinnerView : View, IDesignable
|
||||
{
|
||||
private const int DEFAULT_DELAY = 130;
|
||||
private static readonly SpinnerStyle DEFAULT_STYLE = new SpinnerStyle.Line ();
|
||||
@@ -289,4 +289,12 @@ public class SpinnerView : View
|
||||
Width = GetSpinnerWidth ();
|
||||
}
|
||||
}
|
||||
|
||||
bool IDesignable.EnableForDesign ()
|
||||
{
|
||||
Style = new SpinnerStyle.Points ();
|
||||
SpinReverse = true;
|
||||
AutoSpin = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,8 +191,8 @@ public class AllViewsTester : Scenario
|
||||
// We have two choices:
|
||||
// 1) Call Layout explicitly
|
||||
// 2) Throw LayoutException so Layout tries again
|
||||
//_eventLog.Layout ();
|
||||
throw new LayoutException ("_eventLog");
|
||||
_eventLog.Layout ();
|
||||
//throw new LayoutException ("_eventLog");
|
||||
}
|
||||
|
||||
return _eventLog.Frame.Width;
|
||||
|
||||
@@ -13,7 +13,6 @@ public class SpinnerViewStyles : Scenario
|
||||
{
|
||||
public override void Main ()
|
||||
{
|
||||
|
||||
Application.Init ();
|
||||
|
||||
Window app = new ()
|
||||
@@ -28,7 +27,7 @@ public class SpinnerViewStyles : Scenario
|
||||
|
||||
foreach (Type style in typeof (SpinnerStyle).GetNestedTypes ())
|
||||
{
|
||||
styleDict.Add (i, new KeyValuePair<string, Type> (style.Name, style));
|
||||
styleDict.Add (i, new (style.Name, style));
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -212,7 +211,6 @@ public class SpinnerViewStyles : Scenario
|
||||
app.Unloaded -= App_Unloaded;
|
||||
}
|
||||
|
||||
|
||||
Application.Run (app);
|
||||
app.Dispose ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user