RobinPerris / DarkUI

Dark themed control and docking library for .NET WinForms.
MIT License
834 stars 185 forks source link

ToolStripSplitButton is not displaying dropdown arrow #44

Open danielj23 opened 3 years ago

danielj23 commented 3 years ago

I tried poking around but I couldn't see how to resolve it.

When adding a ToolStripSplitButton to a DarkToolstrip, the dropdown arrow (on the right) is missing. The dropdown menu appears when you click in the space, but the button icon itself is missing.

The focus events are not rendering the mouse over, either.

Also, thanks for all your work on this project.

danielj23 commented 3 years ago

in DarkToolStripRenderer.cs I added the code below and that triggers the proper painting of the hovered area, but I haven't yet figured out the arrow. It seems odd to me that the arrow appears on the DropDownButton.

protected override void OnRenderSplitButtonBackground(ToolStripItemRenderEventArgs e) { var g = e.Graphics;

        var rect = new Rectangle(0, 1, e.Item.Width, e.Item.Height - 2);

        if (e.Item.Selected || e.Item.Pressed)
        {
            using (var b = new SolidBrush(BackColors.GreySelection))
            {
                g.FillRectangle(b, rect);
            }
        } 
    }