Преглед на файлове

Fixes changes requested.

BDisp преди 3 години
родител
ревизия
d9a56e97c8
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      Terminal.Gui/Views/Button.cs

+ 2 - 1
Terminal.Gui/Views/Button.cs

@@ -111,6 +111,7 @@ namespace Terminal.Gui {
 			_rightDefault = new Rune (Driver != null ? Driver.RightDefaultIndicator : '>');
 
 			CanFocus = true;
+			AutoSize = true;
 			this.is_default = is_default;
 			this.text = text ?? string.Empty;
 			Update ();
@@ -197,7 +198,7 @@ namespace Terminal.Gui {
 			else
 				TextFormatter.Text = ustring.Make (_leftBracket) + " " + text + " " + ustring.Make (_rightBracket);
 
-			int w = TextFormatter.Size.Width - (TextFormatter.Text.Contains (HotKeySpecifier) ? 1 : 0);
+			int w = TextFormatter.Size.Width - GetHotKeySpecifierLength ();
 			GetCurrentWidth (out int cWidth);
 			var canSetWidth = SetWidth (w, out int rWidth);
 			if (canSetWidth && (cWidth < rWidth || AutoSize)) {