浏览代码

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

miguel 7 年之前
父节点
当前提交
9bd619c74f
共有 1 个文件被更改,包括 3 次插入1 次删除
  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>