mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-05 13:09:05 +08:00
24 lines
658 B
Dart
24 lines
658 B
Dart
import 'dart:io';
|
|
|
|
import 'package:tray_manager/tray_manager.dart';
|
|
|
|
import '../common.dart';
|
|
|
|
Future<void> initTray({List<MenuItem>? extra_item}) async {
|
|
List<MenuItem> items = [
|
|
MenuItem(key: "show", label: translate("show rustdesk")),
|
|
MenuItem.separator(),
|
|
MenuItem(key: "quit", label: translate("quit rustdesk")),
|
|
];
|
|
if (extra_item != null) {
|
|
items.insertAll(0, extra_item);
|
|
}
|
|
await Future.wait([
|
|
trayManager
|
|
.setIcon(Platform.isWindows ? "assets/logo.ico" : "assets/logo.png"),
|
|
trayManager.setContextMenu(Menu(items: items)),
|
|
trayManager.setToolTip("rustdesk"),
|
|
trayManager.setTitle("rustdesk")
|
|
]);
|
|
}
|