From ab690d3e0a5b1c071af07930f9f12ef60d751fb6 Mon Sep 17 00:00:00 2001 From: BDisp Date: Wed, 21 Oct 2020 16:01:11 +0100 Subject: [PATCH] Fixes #965. Broken buttons --- Terminal.Gui/Views/Button.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Terminal.Gui/Views/Button.cs b/Terminal.Gui/Views/Button.cs index 73beba18d..608ec89f8 100644 --- a/Terminal.Gui/Views/Button.cs +++ b/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); }