Explorar o código

Add a frame to buttons, as this calculation is used elsewhere, still missing - focus on the dialogs

miguel %!s(int64=7) %!d(string=hai) anos
pai
achega
9bd619c74f
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      Terminal.Gui/Views/Button.cs

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

@@ -66,8 +66,10 @@ namespace Terminal.Gui {
 		public Button (ustring text, bool is_default = false) : base ()
 		{
 			Text = text;
-			Width = text.Length + 4 + (is_default ? 2 : 0);
+			int w = text.Length + 4 + (is_default ? 2 : 0);
+			Width = w;
 			Height = 1;
+			Frame = new Rect (0, 0, w, 1);
 		}
 
 		/// <summary>