ソースを参照

Fixes #965. Broken buttons

BDisp 4 年 前
コミット
ab690d3e0a
1 ファイル変更3 行追加1 行削除
  1. 3 1
      Terminal.Gui/Views/Button.cs

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

@@ -145,7 +145,9 @@ namespace Terminal.Gui {
 				base.Text = ustring.Make (_leftBracket) + " " + text + " " + ustring.Make (_rightBracket);
 
 			int w = base.Text.RuneCount - (base.Text.Contains (HotKeySpecifier) ? 1 : 0);
-			if (Width is Dim.DimCombine) {
+			if (!(Width is Dim.DimCombine)) {
+				Width = w;
+			} else {
 				// It's a Dim.DimCombine and so can't be assigned. Let it have it's own anchor.
 				w = Width.Anchor (w);
 			}