Prechádzať zdrojové kódy

Temp fix for ProgressStyles scenario

Tig 1 rok pred
rodič
commit
102269ec2a
1 zmenil súbory, kde vykonal 12 pridanie a 6 odobranie
  1. 12 6
      UICatalog/Scenarios/ProgressBarStyles.cs

+ 12 - 6
UICatalog/Scenarios/ProgressBarStyles.cs

@@ -64,19 +64,25 @@ public class ProgressBarStyles : Scenario
         {
         {
             var colorPicker = new ColorPicker { Title = text, SelectedColor = colorName };
             var colorPicker = new ColorPicker { Title = text, SelectedColor = colorName };
 
 
-            var dialog = new Dialog { Title = text };
+            var dialog = new Dialog { AutoSize = false, Title = text };
 
 
-            dialog.LayoutComplete += (sender, args) =>
+            dialog.Initialized += (sender, args) =>
                                      {
                                      {
                                          // TODO: Replace with Dim.Auto
                                          // TODO: Replace with Dim.Auto
                                          dialog.X = pbList.Frame.X;
                                          dialog.X = pbList.Frame.X;
                                          dialog.Y = pbList.Frame.Height;
                                          dialog.Y = pbList.Frame.Height;
-
-                                         dialog.Bounds = new Rectangle (0, 0, colorPicker.Frame.Width, colorPicker.Frame.Height);
-
-                                         Top.LayoutSubviews ();
                                      };
                                      };
 
 
+            dialog.LayoutComplete += (sender, args) =>
+                                    {
+                                        dialog.Bounds = Rectangle.Empty with
+                                        {
+                                            Width = colorPicker.Frame.Width,
+                                            Height = colorPicker.Frame.Height
+                                        };
+                                        Application.Top.LayoutSubviews();
+                                    };
+
             dialog.Add (colorPicker);
             dialog.Add (colorPicker);
             colorPicker.ColorChanged += (s, e) => { dialog.RequestStop (); };
             colorPicker.ColorChanged += (s, e) => { dialog.RequestStop (); };
             Application.Run (dialog);
             Application.Run (dialog);