CustomWindowButton constructor
Implementation
CustomWindowButton({super.key, required WindowButtonType type, this.color = kTheme1})
: action = switch (type) {
// i love pattern matching :D
WindowButtonType.MINIMIZE => appWindow.minimize,
WindowButtonType.MAXIMIZE_RESTORE => appWindow.maximizeOrRestore,
WindowButtonType.CLOSE => appWindow.close,
WindowButtonType.HIDE => appWindow.hide
},
icon = switch (type) {
// i love pattern matching :D
WindowButtonType.MINIMIZE => Ionicons.remove_circle,
WindowButtonType.MAXIMIZE_RESTORE => Ionicons.scan_circle,
WindowButtonType.CLOSE || WindowButtonType.HIDE => Ionicons.close_circle,
};