Skip to content

Commit

Permalink
fix linux tray: linux seems dont support setTooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
madoka773 committed Jul 28, 2024
1 parent e4b3f95 commit c8c1e1b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/app_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ class _AppWidgetState extends State<AppWidget> with TrayListener {
? 'assets/images/logo/logo_windows.ico'
: 'assets/images/logo/logo_rounded.png'
);
await trayManager.setToolTip('Kazumi');
if (!Utils.isLinux()) {
await trayManager.setToolTip('Kazumi');
}
Menu trayMenu = Menu(
items: [
MenuItem(
Expand Down
8 changes: 8 additions & 0 deletions lib/utils/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,14 @@ class Utils {
return false;
}

/// 判断是否为Linux系统
static bool isLinux() {
if (Platform.isLinux) {
return true;
}
return false;
}

/// 判断设备是否为宽屏
static bool isWideScreen() {
Box setting = GStorage.setting;
Expand Down

0 comments on commit c8c1e1b

Please sign in to comment.