فهرست منبع

Updated ProgressBarstyles to use vertical alignment

Tig 1 سال پیش
والد
کامیت
b75bfb248a
1فایلهای تغییر یافته به همراه18 افزوده شده و 10 حذف شده
  1. 18 10
      UICatalog/Scenarios/ProgressBarStyles.cs

+ 18 - 10
UICatalog/Scenarios/ProgressBarStyles.cs

@@ -50,13 +50,12 @@ public class ProgressBarStyles : Scenario
         var pbList = new ListView
         var pbList = new ListView
         {
         {
             Title = "Focused ProgressBar",
             Title = "Focused ProgressBar",
-            Y = 0,
+            Y = Pos.Align (Alignment.Top),
             X = Pos.Center (),
             X = Pos.Center (),
             Width = 30,
             Width = 30,
             Height = 7,
             Height = 7,
             BorderStyle = LineStyle.Single
             BorderStyle = LineStyle.Single
         };
         };
-
         container.Add (pbList);
         container.Add (pbList);
 
 
         #region ColorPicker
         #region ColorPicker
@@ -97,7 +96,9 @@ public class ProgressBarStyles : Scenario
 
 
         var fgColorPickerBtn = new Button
         var fgColorPickerBtn = new Button
         {
         {
-            Text = "Foreground HotNormal Color", X = Pos.Center (), Y = Pos.Bottom (pbList)
+            Text = "Foreground HotNormal Color",
+            X = Pos.Center (),
+            Y = Pos.Align (Alignment.Top),
         };
         };
         container.Add (fgColorPickerBtn);
         container.Add (fgColorPickerBtn);
 
 
@@ -122,7 +123,9 @@ public class ProgressBarStyles : Scenario
 
 
         var bgColorPickerBtn = new Button
         var bgColorPickerBtn = new Button
         {
         {
-            X = Pos.Center (), Y = Pos.Bottom (fgColorPickerBtn), Text = "Background HotNormal Color"
+            X = Pos.Center (),
+            Y = Pos.Align (Alignment.Top),
+            Text = "Background HotNormal Color"
         };
         };
         container.Add (bgColorPickerBtn);
         container.Add (bgColorPickerBtn);
 
 
@@ -155,19 +158,24 @@ public class ProgressBarStyles : Scenario
             BorderStyle = LineStyle.Single,
             BorderStyle = LineStyle.Single,
             Title = "ProgressBarFormat",
             Title = "ProgressBarFormat",
             X = Pos.Left (pbList),
             X = Pos.Left (pbList),
-            Y = Pos.Bottom (bgColorPickerBtn) + 1,
+            Y = Pos.Align (Alignment.Top),
             RadioLabels = pbFormatEnum.Select (e => e.ToString ()).ToArray ()
             RadioLabels = pbFormatEnum.Select (e => e.ToString ()).ToArray ()
         };
         };
         container.Add (rbPBFormat);
         container.Add (rbPBFormat);
 
 
-        var button = new Button { X = Pos.Center (), Y = Pos.Bottom (rbPBFormat) + 1, Text = "Start timer" };
+        var button = new Button
+        {
+            X = Pos.Center (),
+            Y = Pos.Align (Alignment.Top),
+            Text = "Start timer"
+        };
         container.Add (button);
         container.Add (button);
 
 
         var blocksPB = new ProgressBar
         var blocksPB = new ProgressBar
         {
         {
             Title = "Blocks",
             Title = "Blocks",
             X = Pos.Center (),
             X = Pos.Center (),
-            Y = Pos.Bottom (button) + 1,
+            Y = Pos.Align (Alignment.Top),
             Width = Dim.Width (pbList),
             Width = Dim.Width (pbList),
             BorderStyle = LineStyle.Single,
             BorderStyle = LineStyle.Single,
             CanFocus = true
             CanFocus = true
@@ -178,7 +186,7 @@ public class ProgressBarStyles : Scenario
         {
         {
             Title = "Continuous",
             Title = "Continuous",
             X = Pos.Center (),
             X = Pos.Center (),
-            Y = Pos.Bottom (blocksPB) + 1,
+            Y = Pos.Align (Alignment.Top),
             Width = Dim.Width (pbList),
             Width = Dim.Width (pbList),
             ProgressBarStyle = ProgressBarStyle.Continuous,
             ProgressBarStyle = ProgressBarStyle.Continuous,
             BorderStyle = LineStyle.Single,
             BorderStyle = LineStyle.Single,
@@ -228,7 +236,7 @@ public class ProgressBarStyles : Scenario
         {
         {
             Title = "Marquee Blocks",
             Title = "Marquee Blocks",
             X = Pos.Center (),
             X = Pos.Center (),
-            Y = Pos.Bottom (ckbBidirectional) + 1,
+            Y = Pos.Align (Alignment.Top),
             Width = Dim.Width (pbList),
             Width = Dim.Width (pbList),
             ProgressBarStyle = ProgressBarStyle.MarqueeBlocks,
             ProgressBarStyle = ProgressBarStyle.MarqueeBlocks,
             BorderStyle = LineStyle.Single,
             BorderStyle = LineStyle.Single,
@@ -240,7 +248,7 @@ public class ProgressBarStyles : Scenario
         {
         {
             Title = "Marquee Continuous",
             Title = "Marquee Continuous",
             X = Pos.Center (),
             X = Pos.Center (),
-            Y = Pos.Bottom (marqueesBlocksPB) + 1,
+            Y = Pos.Align (Alignment.Top),
             Width = Dim.Width (pbList),
             Width = Dim.Width (pbList),
             ProgressBarStyle = ProgressBarStyle.MarqueeContinuous,
             ProgressBarStyle = ProgressBarStyle.MarqueeContinuous,
             BorderStyle = LineStyle.Single,
             BorderStyle = LineStyle.Single,