Răsfoiți Sursa

Fixed ExpanderButton

Tig 1 an în urmă
părinte
comite
ffc4136a42

+ 0 - 4
UICatalog/Scenarios/AdornmentsEditor.cs

@@ -124,10 +124,6 @@ public class AdornmentsEditor : View
 
         Add (_diagRulerCheckBox);
         _diagRulerCheckBox.Y = Pos.Bottom (_diagPaddingCheckBox);
-
-        // BUGBUG: This should not be needed. There's some bug in the layout system that doesn't update the layout.
-        SuperView.LayoutSubviews();
-
     }
 
     private void Application_MouseEvent (object sender, MouseEvent e)

+ 0 - 6
UICatalog/Scenarios/Bars.cs

@@ -341,12 +341,6 @@ public class Bars : Scenario
     //    Application.MouseEvent -= Application_MouseEvent;
     //}
 
-    private void Menu_Initialized (object sender, EventArgs e)
-    {
-        // BUGBUG: this should not be needed    
-
-        ((View)(sender)).LayoutSubviews ();
-    }
 
     private void ConfigMenuBar (Bar bar)
     {

+ 1 - 2
UICatalog/Scenarios/BorderEditor.cs

@@ -33,9 +33,8 @@ public class BorderEditor : AdornmentEditor
         {
             X = 0,
 
-            // BUGBUG: Hack until dimauto is working properly
             Y = Pos.Bottom (Subviews [^1]),
-            Width = Dim.Width (Subviews [^2]) + Dim.Width (Subviews [^1]) - 1,
+            Width = Dim.Fill (),
             SelectedItem = (int)(((Border)AdornmentToEdit)?.LineStyle ?? LineStyle.None),
             BorderStyle = LineStyle.Single,
             Title = "Border St_yle",

+ 2 - 5
UICatalog/Scenarios/ExpanderButton.cs

@@ -96,8 +96,6 @@ public class ExpanderButton : Button
                 ExpandedGlyph = new ('\u21d2'); // ⇒
             }
 
-            Text = $"{(Collapsed ? CollapsedGlyph : ExpandedGlyph)}";
-
             ExpandOrCollapse (Collapsed);
         }
 
@@ -157,9 +155,6 @@ public class ExpanderButton : Button
                 subview.Visible = !Collapsed;
                 subview.Enabled = !Collapsed;
             }
-
-            // BUGBUG: This should not be needed. There's some bug in the layout system that doesn't update the layout.
-            superView.SuperView?.LayoutSubviews ();
         }
 
         return args.Cancel;
@@ -186,6 +181,8 @@ public class ExpanderButton : Button
 
     private void ExpandOrCollapse (bool collapse)
     {
+        Text = $"{(Collapsed ? CollapsedGlyph : ExpandedGlyph)}";
+
         View superView = SuperView;
         if (superView is Adornment adornment)
         {