Implement commit sudoku button
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user