Implement commit sudoku button

This commit is contained in:
2025-04-21 22:35:53 +02:00
parent d788c110a7
commit d06a8d6698

View File

@@ -7,7 +7,6 @@ import 'package:system_tray/system_tray.dart';
import 'package:window_manager/window_manager.dart';
import 'package:audioplayers/audioplayers.dart';
// TODO: Add a "commit sudoku" button to the tray menu
// TODO: Add an icon to the executable, simply use the existing tray icon
// TODO: Auto focus new entry field
@@ -176,9 +175,22 @@ class _MainPageState extends State<MainPage> with WindowListener {
await _systemTray.initSystemTray(iconPath: iconPath, toolTip: "Journaler");
await _menu.buildFrom([
MenuItemLabel(
label: 'Commit Sudoku',
onClicked: (menuItem) => windowManager.destroy(),
),
]);
await _systemTray.setContextMenu(_menu);
_systemTray.registerSystemTrayEventHandler((eventName) {
debugPrint("System Tray Event: $eventName");
_showWindow();
if (eventName == kSystemTrayEventClick) {
_showWindow();
} else if (eventName == kSystemTrayEventRightClick) {
_systemTray.popUpContextMenu();
}
});
}