|
@@ -1212,11 +1212,11 @@ namespace Terminal.Gui {
|
|
if (isVertical) {
|
|
if (isVertical) {
|
|
var runesWidth = GetSumMaxCharWidth (Lines, line);
|
|
var runesWidth = GetSumMaxCharWidth (Lines, line);
|
|
x = bounds.Right - runesWidth;
|
|
x = bounds.Right - runesWidth;
|
|
- CursorPosition = bounds.Width - runesWidth + hotKeyPos;
|
|
|
|
|
|
+ CursorPosition = bounds.Width - runesWidth + (hotKeyPos > -1 ? hotKeyPos : 0);
|
|
} else {
|
|
} else {
|
|
var runesWidth = GetTextWidth (ustring.Make (runes));
|
|
var runesWidth = GetTextWidth (ustring.Make (runes));
|
|
x = bounds.Right - runesWidth;
|
|
x = bounds.Right - runesWidth;
|
|
- CursorPosition = bounds.Width - runesWidth + hotKeyPos;
|
|
|
|
|
|
+ CursorPosition = bounds.Width - runesWidth + (hotKeyPos > -1 ? hotKeyPos : 0);
|
|
}
|
|
}
|
|
} else if (textAlignment == TextAlignment.Left || textAlignment == TextAlignment.Justified) {
|
|
} else if (textAlignment == TextAlignment.Left || textAlignment == TextAlignment.Justified) {
|
|
if (isVertical) {
|
|
if (isVertical) {
|
|
@@ -1225,16 +1225,16 @@ namespace Terminal.Gui {
|
|
} else {
|
|
} else {
|
|
x = bounds.Left;
|
|
x = bounds.Left;
|
|
}
|
|
}
|
|
- CursorPosition = hotKeyPos;
|
|
|
|
|
|
+ CursorPosition = hotKeyPos > -1 ? hotKeyPos : 0;
|
|
} else if (textAlignment == TextAlignment.Centered) {
|
|
} else if (textAlignment == TextAlignment.Centered) {
|
|
if (isVertical) {
|
|
if (isVertical) {
|
|
var runesWidth = GetSumMaxCharWidth (Lines, line);
|
|
var runesWidth = GetSumMaxCharWidth (Lines, line);
|
|
x = bounds.Left + line + ((bounds.Width - runesWidth) / 2);
|
|
x = bounds.Left + line + ((bounds.Width - runesWidth) / 2);
|
|
- CursorPosition = (bounds.Width - runesWidth) / 2 + hotKeyPos;
|
|
|
|
|
|
+ CursorPosition = (bounds.Width - runesWidth) / 2 + (hotKeyPos > -1 ? hotKeyPos : 0);
|
|
} else {
|
|
} else {
|
|
var runesWidth = GetTextWidth (ustring.Make (runes));
|
|
var runesWidth = GetTextWidth (ustring.Make (runes));
|
|
x = bounds.Left + (bounds.Width - runesWidth) / 2;
|
|
x = bounds.Left + (bounds.Width - runesWidth) / 2;
|
|
- CursorPosition = (bounds.Width - runesWidth) / 2 + hotKeyPos;
|
|
|
|
|
|
+ CursorPosition = (bounds.Width - runesWidth) / 2 + (hotKeyPos > -1 ? hotKeyPos : 0);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
throw new ArgumentOutOfRangeException ();
|
|
throw new ArgumentOutOfRangeException ();
|
|
@@ -1291,7 +1291,7 @@ namespace Terminal.Gui {
|
|
rune = runes [idx];
|
|
rune = runes [idx];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (idx == HotKeyPos) {
|
|
|
|
|
|
+ if (HotKeyPos > -1 && idx == HotKeyPos) {
|
|
if ((isVertical && textVerticalAlignment == VerticalTextAlignment.Justified) ||
|
|
if ((isVertical && textVerticalAlignment == VerticalTextAlignment.Justified) ||
|
|
(!isVertical && textAlignment == TextAlignment.Justified)) {
|
|
(!isVertical && textAlignment == TextAlignment.Justified)) {
|
|
CursorPosition = idx - start;
|
|
CursorPosition = idx - start;
|