Browse Source

Fix radiogroup rectangle region

Miguel de Icaza 7 years ago
parent
commit
e02714ba65
3 changed files with 2 additions and 3 deletions
  1. 0 1
      Core.cs
  2. 1 1
      Views/RadioGroup.cs
  3. 1 1
      demo.cs

+ 0 - 1
Core.cs

@@ -996,7 +996,6 @@ namespace Terminal {
 					Y = ry,
 					Y = ry,
 					Flags = me.Flags
 					Flags = me.Flags
 				};
 				};
-					          
 				// Should we bubbled up the event, if it is not handled?
 				// Should we bubbled up the event, if it is not handled?
 				view.MouseEvent (nme);
 				view.MouseEvent (nme);
 			}
 			}

+ 1 - 1
Views/RadioGroup.cs

@@ -25,7 +25,7 @@ namespace Terminal {
 			int width = 0;
 			int width = 0;
 
 
 			foreach (var s in radioLabels)
 			foreach (var s in radioLabels)
-				width = Math.Max (radioLabels.Length + 4, width);
+				width = Math.Max (s.Length + 4, width);
 			return new Rect (x, y, width, radioLabels.Length);
 			return new Rect (x, y, width, radioLabels.Length);
 		}
 		}
 		/// <summary>
 		/// <summary>

+ 1 - 1
demo.cs

@@ -57,7 +57,7 @@ class Demo {
 		int count = 0;
 		int count = 0;
 		ml = new Label (new Rect (3, 16, 50, 1), "Mouse: ");
 		ml = new Label (new Rect (3, 16, 50, 1), "Mouse: ");
 		Application.RootMouseEvent += delegate (MouseEvent me) {
 		Application.RootMouseEvent += delegate (MouseEvent me) {
-			
+
 			ml.Text = $"Mouse: ({me.X},{me.Y}) - {me.Flags} {count++}";
 			ml.Text = $"Mouse: ({me.X},{me.Y}) - {me.Flags} {count++}";
 		};
 		};