window_manager
window_manager copied to clipboard
Can't set a custom Icon for WindowCaptionButton
This parameter is never used: https://github.com/leanflutter/window_manager/blob/main/lib/src/widgets/window_caption_button.dart#L30
And if iconName is null, we throw an error: https://github.com/leanflutter/window_manager/blob/main/lib/src/widgets/window_caption_button.dart#L174
I want to add custom button with custom icon, like this:

And if we give a Widget, le color can't be changed on hover, so I propose something like that:
Add a parameter iconData instead icon of type IconData, and do something like that
widget.iconData != null
? Icon(
color: iconColor,
widget.iconData,
size: 16,
)
: WindowCaptionButtonIcon(
name: widget.iconName!,
color: iconColor,
),
Edit: and add a verification like this assert(iconData != null || iconName != null)