picoe / Eto

Cross platform GUI framework for desktop and mobile applications in .NET
Other
3.57k stars 325 forks source link

Wpf: Allow ToolItem and MenuItem to have different icon sizes #2481

Closed cwensley closed 1 year ago

cwensley commented 1 year ago

This allows ToolItem and MenuItem to have different icon sizes other than 16,16. Note that the MenuItem icon size is hard coded in WPF, so changing the size may not have an affect unless you define your own MenuItem styling.

This also removes the gripper as it is useless and adjusts the margins a little between the label and image and with splitters.

You can use Eto styles to define the sizes for individual items, or change the default like so:

// change for all
Eto.Wpf.Forms.ToolBar.ToolItemHandler.DefaultImageSize = new Size(24, 24);

// change only for specific items
Styles.Add<ButtonToolItemHandler>("my-style", c => c.ImageSize = new Size(24, 24));