mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-04 11:59:18 +08:00
d81d785722
Signed-off-by: Kingtous <kingtous@qq.com>
23 lines
680 B
Dart
23 lines
680 B
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter_hbb/models/model.dart';
|
|
import 'package:tray_manager/tray_manager.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")
|
|
]);
|
|
}
|