Fix up the system tray icon(s)
This commit is contained in:
@@ -59,7 +59,7 @@ class MainPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MainPageState extends State<MainPage> with WindowListener {
|
||||
final AppWindow _appWindow = AppWindow();
|
||||
// final AppWindow _appWindow = AppWindow(); // REMOVED - Not used
|
||||
final SystemTray _systemTray = SystemTray();
|
||||
final AudioPlayer _audioPlayer = AudioPlayer();
|
||||
|
||||
@@ -203,18 +203,30 @@ class _MainPageState extends State<MainPage> with WindowListener {
|
||||
|
||||
void _saveData() {
|
||||
// TODO: Implement logic to save the current entry and todo list
|
||||
// Example:
|
||||
// await saveEntryToDatabase(_currentEntryController.text);
|
||||
// await saveTodoListToFile(_todoController.text);
|
||||
// This is called when the window is closed (hidden) or the save button is pressed.
|
||||
String currentEntry = _currentEntryController.text;
|
||||
String todoList = _todoController.text;
|
||||
|
||||
// You might want to move the '_currentEntryController.text' to become
|
||||
// the '_previousEntryController.text' for the *next* session here or upon loading.
|
||||
|
||||
debugPrint(
|
||||
"Data saved (placeholder). Previous: [...], Current: [${_currentEntryController.text.length} chars], Todo: [${_todoController.text.length} chars]",
|
||||
print(
|
||||
"Saving data (placeholder)... Current Entry: [${currentEntry.length} chars], Todo: [${todoList.length} chars]",
|
||||
);
|
||||
|
||||
// --- Your persistence logic goes here ---
|
||||
// Example:
|
||||
// await saveEntryToDatabase(currentEntry);
|
||||
// await saveTodoListToFile(todoList);
|
||||
// ---------------------------------------
|
||||
|
||||
// You might want to update the previous entry for the *next* session here,
|
||||
// or handle this logic when loading data next time.
|
||||
// Example (simplistic, assumes immediate update for next view):
|
||||
// setState(() {
|
||||
// _previousEntryController.text = currentEntry;
|
||||
// _currentEntryController.clear(); // Clear current entry after saving
|
||||
// });
|
||||
|
||||
// Potentially clear current entry after saving, or handle it on next load
|
||||
// _currentEntryController.clear();
|
||||
// _currentEntryController.clear(); // Decide if you want to clear it immediately
|
||||
}
|
||||
|
||||
// --- UI Build --- //
|
||||
@@ -315,18 +327,18 @@ class _MainPageState extends State<MainPage> with WindowListener {
|
||||
}
|
||||
}
|
||||
|
||||
// Helper class for AppWindow interactions (optional, but good practice)
|
||||
class AppWindow {
|
||||
Future<void> init() async {
|
||||
// Can add more window setup here if needed
|
||||
}
|
||||
|
||||
Future<void> show() async {
|
||||
await windowManager.show();
|
||||
await windowManager.focus();
|
||||
}
|
||||
|
||||
Future<void> hide() async {
|
||||
await windowManager.hide();
|
||||
}
|
||||
}
|
||||
// REMOVED - Helper class for AppWindow interactions (optional, but good practice)
|
||||
// class AppWindow {
|
||||
// Future<void> init() async {
|
||||
// // Can add more window setup here if needed
|
||||
// }
|
||||
//
|
||||
// Future<void> show() async {
|
||||
// await windowManager.show();
|
||||
// await windowManager.focus();
|
||||
// }
|
||||
//
|
||||
// Future<void> hide() async {
|
||||
// await windowManager.hide();
|
||||
// }
|
||||
// }
|
||||
|
Reference in New Issue
Block a user