Fixes requested changes.

This commit is contained in:
BDisp
2022-06-18 02:15:32 +01:00
committed by Tig Kindel
parent 38bed3fd98
commit ef494eecdc
2 changed files with 11 additions and 8 deletions

View File

@@ -114,8 +114,7 @@ namespace Terminal.Gui {
break;
}
int w = TextFormatter.Size.Width - (TextFormatter.Text.Contains (HotKeySpecifier)
? Math.Max (Rune.ColumnWidth (HotKeySpecifier), 0) : 0);
int w = TextFormatter.Size.Width - GetHotKeySpecifierLength ();
GetCurrentWidth (out int cWidth);
var canSetWidth = SetWidth (w, out int rWidth);
if (canSetWidth && (cWidth < rWidth || AutoSize)) {

View File

@@ -175,6 +175,7 @@ namespace Terminal.Gui.Views {
X = 1,
Y = Pos.Center (),
Text = "Check this out 你",
AutoSize = false,
Width = 25
};
var win = new Window () {
@@ -226,8 +227,9 @@ namespace Terminal.Gui.Views {
X = 1,
Y = Pos.Center (),
Text = "Check this out 你",
Width = 25,
TextAlignment = TextAlignment.Centered
TextAlignment = TextAlignment.Centered,
AutoSize = false,
Width = 25
};
var win = new Window () {
Width = Dim.Fill (),
@@ -278,8 +280,9 @@ namespace Terminal.Gui.Views {
X = 1,
Y = Pos.Center (),
Text = "Check this out 你",
Width = 25,
TextAlignment = TextAlignment.Justified
TextAlignment = TextAlignment.Justified,
AutoSize = false,
Width = 25
};
var win = new Window () {
Width = Dim.Fill (),
@@ -330,8 +333,9 @@ namespace Terminal.Gui.Views {
X = 1,
Y = Pos.Center (),
Text = "Check this out 你",
Width = 25,
TextAlignment = TextAlignment.Right
TextAlignment = TextAlignment.Right,
AutoSize = false,
Width = 25
};
var win = new Window () {
Width = Dim.Fill (),