Kaynağa Gözat

adusted more tests

Tigger Kindel 2 yıl önce
ebeveyn
işleme
10971ec824

+ 1 - 1
Terminal.Gui/Core/Frame.cs

@@ -16,7 +16,7 @@ namespace Terminal.Gui {
 	/// enabling borders, menus, etc... 
 	/// </summary>
 	public class Frame : View {
-		private Thickness _thickness;
+		private Thickness _thickness = Thickness.Empty;
 
 		internal override void CreateFrames () { /* Do nothing - Frames do not have Frames */ }
 

+ 6 - 0
Terminal.Gui/Core/Window.cs

@@ -121,6 +121,12 @@ namespace Terminal.Gui {
 
 			// TODO: Hack until Border is refactored
 			Padding.Thickness = Border.PaddingThickness ?? Padding.Thickness;
+
+			if (frame.IsEmpty) {
+				// Make it bigger to fit the margin, border, & padding
+				frame = new Rect (frame.Location, new Size (Margin.Thickness.Horizontal + BorderFrame.Thickness.Horizontal + Padding.Thickness.Horizontal + 1, Margin.Thickness.Vertical + BorderFrame.Thickness.Vertical + Padding.Thickness.Vertical + 1));
+			}
+			Frame = frame;
 		}
 
 		public override void BeginInit ()

+ 1 - 0
Terminal.Gui/Views/Label.cs

@@ -56,6 +56,7 @@ namespace Terminal.Gui {
 
 		void SetInitialProperties (bool autosize = true)
 		{
+			Height = 1;
 			AutoSize = autosize;
 		}
 

+ 2 - 1
UICatalog/Scenarios/ASCIICustomButton.cs

@@ -99,7 +99,8 @@ namespace UICatalog.Scenarios {
 				};
 
 				border.MouseClick += This_MouseClick;
-				border.Subviews [0].MouseClick += This_MouseClick;
+				// BUGBUG: v2 This uses internal knowledge of FrameView an breaks in v2 where FrameView does not have a ContentView
+				//border.Subviews [0].MouseClick += This_MouseClick;
 				fill.MouseClick += This_MouseClick;
 				title.MouseClick += This_MouseClick;
 

+ 6 - 2
UICatalog/Scenarios/VkeyPacketSimulator.cs

@@ -221,14 +221,18 @@ namespace UICatalog.Scenarios {
 
 			tvInput.SetFocus ();
 
-			Win.LayoutComplete += (_) => {
+			void Win_LayoutComplete (View.LayoutEventArgs obj)
+			{
 				inputHorizontalRuler.Text = outputHorizontalRuler.Text = ruler.Repeat ((int)Math.Ceiling ((double)(inputHorizontalRuler.Bounds.Width) / (double)ruler.Length)) [0..(inputHorizontalRuler.Bounds.Width)];
 				inputVerticalRuler.Height = tvInput.Frame.Height + 1;
 				inputVerticalRuler.Text = ruler.Repeat ((int)Math.Ceiling ((double)(inputVerticalRuler.Bounds.Height) / (double)ruler.Length)) [0..(inputVerticalRuler.Bounds.Height)];
 				outputVerticalRuler.Text = ruler.Repeat ((int)Math.Ceiling ((double)(outputVerticalRuler.Bounds.Height) / (double)ruler.Length)) [0..(outputVerticalRuler.Bounds.Height)];
-			};
+			}
+
+			Win.LayoutComplete += Win_LayoutComplete;
 		}
 
+
 		private void AddKeyboardStrokes (View.KeyEventEventArgs e)
 		{
 			var ke = e.KeyEvent;