modern-forms / Modern.Forms

Cross-platform spiritual successor to Winforms for .NET 6+
MIT License
842 stars 54 forks source link

Padding in Panel #43

Closed ProGraMajster closed 1 year ago

ProGraMajster commented 1 year ago

Padding in Panel not working. Source code from my app:

private Button button;
        private Panel panelMenu;
        private void InitializeComponent()
        {
            this.panelMenu = new Panel();
            panelMenu.Name = "panelMenu";
            panelMenu.Dock = DockStyle.Left;
            panelMenu.Width = 260;
            panelMenu.CurrentStyle.BackgroundColor = new SkiaSharp.SKColor(220, 220, 220);
            panelMenu.Padding = new Padding(15,15,15,15);
            panelMenu.CurrentStyle.Border.Radius = 15;
            panelMenu.StyleHover.Border.Radius = 15;

            button = new Button();
            button.Text = "button";
            button.Name = "button";
            button.Dock = DockStyle.Top;
            button.CurrentStyle.Border.Radius = 15;
            button.StyleHover.Border.Radius = 15;

            Text = "My Application";
            this.TitleBar.Style.BackgroundColor = new SkiaSharp.SKColor(0,0,0);

            this.panelMenu.Controls.Add(button);
            this.Controls.Add(panelMenu);
        }

image

jpobst commented 1 year ago

Weird, we use the layout engine from Winforms, so it should behave the same, but it's not...