Skip to content

Commit

Permalink
Draw->DrawIndicator
Browse files Browse the repository at this point in the history
  • Loading branch information
tig committed Oct 27, 2024
1 parent c1597b3 commit 51fcfb5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Terminal.Gui/View/Adornment/Border.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public override void BeginInit ()
LayoutStarted += OnLayoutStarted;
}
#endif
if (View.Diagnostics.HasFlag (ViewDiagnosticFlags.Draw))
if (View.Diagnostics.HasFlag (ViewDiagnosticFlags.DrawIndicator))
{
_drawIndicator = new SpinnerView ()
{
Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/View/View.Diagnostics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public enum ViewDiagnosticFlags : uint
/// <summary>
/// When enabled a draw indicator will be shown; the indicator will change each time the View's Draw method is called with NeedsDisplay set to true.
/// </summary>
Draw = 0b_0000_01000,
DrawIndicator = 0b_0000_01000,
}

public partial class View
Expand Down
20 changes: 10 additions & 10 deletions UICatalog/UICatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ private MenuItem [] CreateDiagnosticFlagsMenuItems ()
const string RULER = "View Diagnostics: _Ruler";
const string THICKNESS = "View Diagnostics: _Thickness";
const string HOVER = "View Diagnostics: _Hover";
const string DRAW = "View Diagnostics: _Draw";
const string DRAWINDICATOR = "View Diagnostics: _DrawIndicator";
var index = 0;

List<MenuItem> menuItems = new ();
Expand All @@ -1030,7 +1030,7 @@ private MenuItem [] CreateDiagnosticFlagsMenuItems ()
item.Checked = !_diagnosticFlags.HasFlag (ViewDiagnosticFlags.Thickness)
&& !_diagnosticFlags.HasFlag (ViewDiagnosticFlags.Ruler)
&& !_diagnosticFlags.HasFlag (ViewDiagnosticFlags.Hover)
&& !_diagnosticFlags.HasFlag (ViewDiagnosticFlags.Draw);
&& !_diagnosticFlags.HasFlag (ViewDiagnosticFlags.DrawIndicator);
}
else
{
Expand All @@ -1043,12 +1043,12 @@ private MenuItem [] CreateDiagnosticFlagsMenuItems ()
if (item.Title == t && item.Checked == false)
{
_diagnosticFlags &= ~(ViewDiagnosticFlags.Thickness | ViewDiagnosticFlags.Ruler | ViewDiagnosticFlags.Hover | ViewDiagnosticFlags.Draw);
_diagnosticFlags &= ~(ViewDiagnosticFlags.Thickness | ViewDiagnosticFlags.Ruler | ViewDiagnosticFlags.Hover | ViewDiagnosticFlags.DrawIndicator);
item.Checked = true;
}
else if (item.Title == t && item.Checked == true)
{
_diagnosticFlags |= ViewDiagnosticFlags.Thickness | ViewDiagnosticFlags.Ruler | ViewDiagnosticFlags.Hover | ViewDiagnosticFlags.Draw;
_diagnosticFlags |= ViewDiagnosticFlags.Thickness | ViewDiagnosticFlags.Ruler | ViewDiagnosticFlags.Hover | ViewDiagnosticFlags.DrawIndicator;
item.Checked = false;
}
else
Expand All @@ -1072,7 +1072,7 @@ private MenuItem [] CreateDiagnosticFlagsMenuItems ()
menuItem.Checked = !_diagnosticFlags.HasFlag (ViewDiagnosticFlags.Ruler)
&& !_diagnosticFlags.HasFlag (ViewDiagnosticFlags.Thickness)
&& !_diagnosticFlags.HasFlag (ViewDiagnosticFlags.Hover)
&& !_diagnosticFlags.HasFlag (ViewDiagnosticFlags.Draw);
&& !_diagnosticFlags.HasFlag (ViewDiagnosticFlags.DrawIndicator);
}
else if (menuItem.Title != t)
{
Expand All @@ -1095,7 +1095,7 @@ string GetDiagnosticsTitle (Enum diag)
"Ruler" => RULER,
"Thickness" => THICKNESS,
"Hover" => HOVER,
"Draw" => DRAW,
"DrawIndicator" => DRAWINDICATOR,
_ => ""
};
}
Expand All @@ -1107,7 +1107,7 @@ Enum GetDiagnosticsEnumValue (string? title)
RULER => ViewDiagnosticFlags.Ruler,
THICKNESS => ViewDiagnosticFlags.Thickness,
HOVER => ViewDiagnosticFlags.Hover,
DRAW => ViewDiagnosticFlags.Draw,
DRAWINDICATOR => ViewDiagnosticFlags.DrawIndicator,
_ => null!
};
}
Expand Down Expand Up @@ -1149,14 +1149,14 @@ void SetDiagnosticsFlag (Enum diag, bool add)
}

break;
case ViewDiagnosticFlags.Draw:
case ViewDiagnosticFlags.DrawIndicator:
if (add)
{
_diagnosticFlags |= ViewDiagnosticFlags.Draw;
_diagnosticFlags |= ViewDiagnosticFlags.DrawIndicator;
}
else
{
_diagnosticFlags &= ~ViewDiagnosticFlags.Draw;
_diagnosticFlags &= ~ViewDiagnosticFlags.DrawIndicator;
}

break;
Expand Down

0 comments on commit 51fcfb5

Please sign in to comment.