Fixes #3839, #3922 - CM Glyphs not working (#3923)

* fixed

* Moved Glyphs to ThemeScope

* Removed test code
This commit is contained in:
Tig
2025-02-26 15:24:58 -07:00
committed by GitHub
parent 7ba6d638bc
commit f3697a99f4
36 changed files with 980 additions and 898 deletions

View File

@@ -270,7 +270,7 @@ public class CharacterMap : Scenario
var startSort = string.Empty;
var endSort = string.Empty;
string sortIndicator = descending ? CM.Glyphs.DownArrow.ToString () : CM.Glyphs.UpArrow.ToString ();
string sortIndicator = descending ? Glyphs.DownArrow.ToString () : Glyphs.UpArrow.ToString ();
switch (sortByColumn)
{

View File

@@ -25,7 +25,7 @@ public class Clipping : Scenario
app.DrawingContent += (s, e) =>
{
app!.FillRect (app!.Viewport, CM.Glyphs.Dot);
app!.FillRect (app!.Viewport, Glyphs.Dot);
e.Cancel = true;
};

View File

@@ -567,10 +567,10 @@ public class DynamicMenuBar : Scenario
var btnAddMenuBar = new Button { Y = 1, Text = "Add a MenuBar" };
frmMenu.Add (btnAddMenuBar);
var btnMenuBarUp = new Button { X = Pos.Center (), Text = CM.Glyphs.UpArrow.ToString () };
var btnMenuBarUp = new Button { X = Pos.Center (), Text = Glyphs.UpArrow.ToString () };
frmMenu.Add (btnMenuBarUp);
var btnMenuBarDown = new Button { X = Pos.Center (), Y = Pos.Bottom (btnMenuBarUp), Text = CM.Glyphs.DownArrow.ToString () };
var btnMenuBarDown = new Button { X = Pos.Center (), Y = Pos.Bottom (btnMenuBarUp), Text = Glyphs.DownArrow.ToString () };
frmMenu.Add (btnMenuBarDown);
var btnRemoveMenuBar = new Button { Y = 1, Text = "Remove a MenuBar" };
@@ -580,7 +580,7 @@ public class DynamicMenuBar : Scenario
var btnPrevious = new Button
{
X = Pos.Left (btnAddMenuBar), Y = Pos.Top (btnAddMenuBar) + 2, Text = CM.Glyphs.LeftArrow.ToString ()
X = Pos.Left (btnAddMenuBar), Y = Pos.Top (btnAddMenuBar) + 2, Text = Glyphs.LeftArrow.ToString ()
};
frmMenu.Add (btnPrevious);
@@ -588,7 +588,7 @@ public class DynamicMenuBar : Scenario
btnAdd.X = Pos.AnchorEnd ();
frmMenu.Add (btnAdd);
var btnNext = new Button { X = Pos.X (btnAdd), Y = Pos.Top (btnPrevious), Text = CM.Glyphs.RightArrow.ToString () };
var btnNext = new Button { X = Pos.X (btnAdd), Y = Pos.Top (btnPrevious), Text = Glyphs.RightArrow.ToString () };
frmMenu.Add (btnNext);
var lblMenuBar = new Label
@@ -648,10 +648,10 @@ public class DynamicMenuBar : Scenario
var btnRemove = new Button { X = Pos.Left (btnAdd), Y = Pos.Top (btnAdd) + 1, Text = "Remove" };
frmMenu.Add (btnRemove);
var btnUp = new Button { X = Pos.Right (_lstMenus) + 2, Y = Pos.Top (btnRemove) + 2, Text = CM.Glyphs.UpArrow.ToString () };
var btnUp = new Button { X = Pos.Right (_lstMenus) + 2, Y = Pos.Top (btnRemove) + 2, Text = Glyphs.UpArrow.ToString () };
frmMenu.Add (btnUp);
var btnDown = new Button { X = Pos.Right (_lstMenus) + 2, Y = Pos.Top (btnUp) + 1, Text = CM.Glyphs.DownArrow.ToString () };
var btnDown = new Button { X = Pos.Right (_lstMenus) + 2, Y = Pos.Top (btnUp) + 1, Text = Glyphs.DownArrow.ToString () };
frmMenu.Add (btnDown);
Add (frmMenu);

View File

@@ -293,10 +293,10 @@ public class DynamicStatusBar : Scenario
var _btnRemove = new Button { X = Pos.Left (_btnAdd), Y = Pos.Top (_btnAdd) + 1, Text = "Remove" };
_frmStatusBar.Add (_btnRemove);
var _btnUp = new Button { X = Pos.Right (_lstItems) + 2, Y = Pos.Top (_btnRemove) + 2, Text = CM.Glyphs.UpArrow.ToString () };
var _btnUp = new Button { X = Pos.Right (_lstItems) + 2, Y = Pos.Top (_btnRemove) + 2, Text = Glyphs.UpArrow.ToString () };
_frmStatusBar.Add (_btnUp);
var _btnDown = new Button { X = Pos.Right (_lstItems) + 2, Y = Pos.Top (_btnUp) + 1, Text = CM.Glyphs.DownArrow.ToString () };
var _btnDown = new Button { X = Pos.Right (_lstItems) + 2, Y = Pos.Top (_btnUp) + 1, Text = Glyphs.DownArrow.ToString () };
_frmStatusBar.Add (_btnDown);
Add (_frmStatusBar);

View File

@@ -251,7 +251,7 @@ public class GraphViewExample : Scenario
var series = new MultiBarSeries (3, 1, 0.25f, new [] { magenta, cyan, red });
Rune stiple = CM.Glyphs.Stipple;
Rune stiple = Glyphs.Stipple;
series.AddBars ("'96", stiple, 5900, 9000, 14000);
series.AddBars ("'97", stiple, 6100, 9200, 14800);
@@ -817,7 +817,7 @@ public class GraphViewExample : Scenario
_graphView.AxisY.ShowLabelsEvery = 0;
_graphView.AxisY.Minimum = 0;
var stiple = new GraphCellToRender (CM.Glyphs.Stipple);
var stiple = new GraphCellToRender (Glyphs.Stipple);
// Bars in 2 directions

View File

@@ -45,7 +45,7 @@ public class LineViewExample : Scenario
// creates a horizontal line
var arrowLine = new LineView
{
Y = 8, Width = 10, StartingAnchor = CM.Glyphs.LeftTee, EndingAnchor = (Rune)'>'
Y = 8, Width = 10, StartingAnchor = Glyphs.LeftTee, EndingAnchor = (Rune)'>'
};
appWindow.Add (arrowLine);
@@ -62,7 +62,7 @@ public class LineViewExample : Scenario
// creates a horizontal line
var verticalArrow = new LineView (Orientation.Vertical)
{
X = 27, StartingAnchor = CM.Glyphs.TopTee, EndingAnchor = (Rune)'V'
X = 27, StartingAnchor = Glyphs.TopTee, EndingAnchor = (Rune)'V'
};
appWindow.Add (verticalArrow);

View File

@@ -45,7 +45,7 @@ public class ShadowStyles : Scenario
app.DrawingContent += (s, e) =>
{
app!.FillRect (app!.Viewport, CM.Glyphs.Dot);
app!.FillRect (app!.Viewport, Glyphs.Dot);
e.Cancel = true;
};

View File

@@ -21,7 +21,7 @@ public sealed class SimpleDialog : Scenario
appWindow.DrawingText += (s, e) =>
{
appWindow!.FillRect (appWindow!.Viewport, CM.Glyphs.Dot);
appWindow!.FillRect (appWindow!.Viewport, Glyphs.Dot);
e.Cancel = true;
};

View File

@@ -90,17 +90,17 @@ public class Sliders : Scenario
{
if (single.Orientation == Orientation.Horizontal)
{
single.Style.SpaceChar = new Cell { Rune = CM.Glyphs.HLine };
single.Style.OptionChar = new Cell { Rune = CM.Glyphs.HLine };
single.Style.SpaceChar = new Cell { Rune = Glyphs.HLine };
single.Style.OptionChar = new Cell { Rune = Glyphs.HLine };
}
else
{
single.Style.SpaceChar = new Cell { Rune = CM.Glyphs.VLine };
single.Style.OptionChar = new Cell { Rune = CM.Glyphs.VLine };
single.Style.SpaceChar = new Cell { Rune = Glyphs.VLine };
single.Style.OptionChar = new Cell { Rune = Glyphs.VLine };
}
};
single.Style.SetChar = new Cell { Rune = CM.Glyphs.ContinuousMeterSegment };
single.Style.DragChar = new Cell { Rune = CM.Glyphs.ContinuousMeterSegment };
single.Style.SetChar = new Cell { Rune = Glyphs.ContinuousMeterSegment };
single.Style.DragChar = new Cell { Rune = Glyphs.ContinuousMeterSegment };
v.Add (single);
@@ -264,7 +264,7 @@ public class Sliders : Scenario
{
s.Orientation = Orientation.Horizontal;
s.Style.SpaceChar = new Cell { Rune = CM.Glyphs.HLine };
s.Style.SpaceChar = new Cell { Rune = Glyphs.HLine };
if (prev == null)
{
@@ -282,7 +282,7 @@ public class Sliders : Scenario
{
s.Orientation = Orientation.Vertical;
s.Style.SpaceChar = new Cell { Rune = CM.Glyphs.VLine };
s.Style.SpaceChar = new Cell { Rune = Glyphs.VLine };
if (prev == null)
{

View File

@@ -292,11 +292,11 @@ public class Snake : Scenario
public SnakeView (SnakeState state)
{
_appleRune = CM.Glyphs.Apple;
_appleRune = Glyphs.Apple;
if (!Driver.IsRuneSupported (_appleRune))
{
_appleRune = CM.Glyphs.AppleBMP;
_appleRune = Glyphs.AppleBMP;
}
State = state;

View File

@@ -1278,14 +1278,14 @@ public class TableEditor : Scenario
// add a new one if this the one that is being sorted
if (col.Ordinal == clickedCol)
{
col.ColumnName += isAsc ? CM.Glyphs.UpArrow : CM.Glyphs.DownArrow;
col.ColumnName += isAsc ? Glyphs.UpArrow : Glyphs.DownArrow;
}
}
_tableView.Update ();
}
private string StripArrows (string columnName) { return columnName.Replace ($"{CM.Glyphs.DownArrow}", "").Replace ($"{CM.Glyphs.UpArrow}", ""); }
private string StripArrows (string columnName) { return columnName.Replace ($"{Glyphs.DownArrow}", "").Replace ($"{Glyphs.UpArrow}", ""); }
private void TableViewKeyPress (object sender, Key e)
{
@@ -1528,8 +1528,8 @@ public class TableEditor : Scenario
private string TrimArrows (string columnName)
{
return columnName.TrimEnd (
(char)CM.Glyphs.UpArrow.Value,
(char)CM.Glyphs.DownArrow.Value
(char)Glyphs.UpArrow.Value,
(char)Glyphs.DownArrow.Value
);
}

View File

@@ -17,15 +17,15 @@ public class UnicodeInMenu : Scenario
var gitString =
$"gui.cs 糊 (hú) {
CM.Glyphs.IdenticalTo
Glyphs.IdenticalTo
} {
CM.Glyphs.DownArrow
Glyphs.DownArrow
}18 {
CM.Glyphs.UpArrow
Glyphs.UpArrow
}10 {
CM.Glyphs.VerticalFourDots
Glyphs.VerticalFourDots
}1 {
CM.Glyphs.HorizontalEllipsis
Glyphs.HorizontalEllipsis
}";
// Init