Fixes #959. PositionCursor with hotkeys.

This commit is contained in:
BDisp
2020-10-19 04:12:21 +01:00
parent 31b76df893
commit 4073019554
5 changed files with 26 additions and 4 deletions

View File

@@ -145,7 +145,13 @@ namespace Terminal.Gui {
base.Text = ustring.Make (_leftBracket) + " " + text + " " + ustring.Make (_rightBracket);
int w = base.Text.RuneCount - (base.Text.Contains (HotKeySpecifier) ? 1 : 0);
Width = w;
try {
Width = w;
#pragma warning disable RCS1075 // Avoid empty catch clause that catches System.Exception.
} catch (Exception) {
#pragma warning restore RCS1075 // Avoid empty catch clause that catches System.Exception.
// It's a Dim.DimCombine and so can't be assigned. Let it have it's own anchor.
}
Height = 1;
Frame = new Rect (Frame.Location, new Size (w, 1));
SetNeedsDisplay ();