Compare commits
No commits in common. "ad0ee971c19696d9481d48073dcbf871ce327f6a" and "2027eab49b6e635e678cfa56a19829fcc89950ba" have entirely different histories.
ad0ee971c1
...
2027eab49b
@ -719,7 +719,6 @@
|
||||
"stickersNewDescription": "Create a new sticker belongs to this pack.",
|
||||
"stickersPackNew": "New Sticker Pack",
|
||||
"trayMenuShow": "Show",
|
||||
"trayMenuMuteNotification": "Do Not Disturb",
|
||||
"update": "Update",
|
||||
"forceUpdate": "Force Update",
|
||||
"forceUpdateDescription": "Force to show the application update popup, even the new version is not available."
|
||||
|
@ -717,7 +717,6 @@
|
||||
"stickersNewDescription": "创建一个新的贴图。",
|
||||
"stickersPackNew": "新建贴图包",
|
||||
"trayMenuShow": "显示",
|
||||
"trayMenuMuteNotification": "静音通知",
|
||||
"update": "更新",
|
||||
"forceUpdate": "强制更新",
|
||||
"forceUpdateDescription": "强制更新应用程序,即使有更新的版本可能不可用。"
|
||||
|
@ -717,7 +717,6 @@
|
||||
"stickersNewDescription": "創建一個新的貼圖。",
|
||||
"stickersPackNew": "新建貼圖包",
|
||||
"trayMenuShow": "顯示",
|
||||
"trayMenuMuteNotification": "靜音通知",
|
||||
"update": "更新",
|
||||
"forceUpdate": "強制更新",
|
||||
"forceUpdateDescription": "強制更新應用程序,即使有更新的版本可能不可用。"
|
||||
|
@ -717,7 +717,6 @@
|
||||
"stickersNewDescription": "創建一個新的貼圖。",
|
||||
"stickersPackNew": "新建貼圖包",
|
||||
"trayMenuShow": "顯示",
|
||||
"trayMenuMuteNotification": "靜音通知",
|
||||
"update": "更新",
|
||||
"forceUpdate": "強制更新",
|
||||
"forceUpdateDescription": "強制更新應用程序,即使有更新的版本可能不可用。"
|
||||
|
@ -333,31 +333,6 @@ class _AppSplashScreenState extends State<_AppSplashScreen> with TrayListener {
|
||||
}
|
||||
}
|
||||
|
||||
final Menu _appTrayMenu = Menu(
|
||||
items: [
|
||||
MenuItem(
|
||||
key: 'version_label',
|
||||
label: 'Solian',
|
||||
disabled: true,
|
||||
),
|
||||
MenuItem.separator(),
|
||||
MenuItem.checkbox(
|
||||
checked: false,
|
||||
key: 'mute_notification',
|
||||
label: 'trayMenuMuteNotification'.tr(),
|
||||
),
|
||||
MenuItem.separator(),
|
||||
MenuItem(
|
||||
key: 'window_show',
|
||||
label: 'trayMenuShow'.tr(),
|
||||
),
|
||||
MenuItem(
|
||||
key: 'exit',
|
||||
label: 'trayMenuExit'.tr(),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Future<void> _trayInitialization() async {
|
||||
if (kIsWeb || Platform.isAndroid || Platform.isIOS) return;
|
||||
|
||||
@ -369,13 +344,25 @@ class _AppSplashScreenState extends State<_AppSplashScreen> with TrayListener {
|
||||
trayManager.addListener(this);
|
||||
await trayManager.setIcon(icon);
|
||||
|
||||
_appTrayMenu.items![0] = MenuItem(
|
||||
key: 'version_label',
|
||||
label: 'Solian ${appVersion.version}+${appVersion.buildNumber}',
|
||||
disabled: true,
|
||||
Menu menu = Menu(
|
||||
items: [
|
||||
MenuItem(
|
||||
key: 'version_label',
|
||||
label: 'Solian ${appVersion.version}+${appVersion.buildNumber}',
|
||||
disabled: true,
|
||||
),
|
||||
MenuItem.separator(),
|
||||
MenuItem(
|
||||
key: 'window_show',
|
||||
label: 'trayMenuShow'.tr(),
|
||||
),
|
||||
MenuItem(
|
||||
key: 'exit',
|
||||
label: 'trayMenuExit'.tr(),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
await trayManager.setContextMenu(_appTrayMenu);
|
||||
await trayManager.setContextMenu(menu);
|
||||
}
|
||||
|
||||
Future<void> _notifyInitialization() async {
|
||||
@ -437,15 +424,8 @@ class _AppSplashScreenState extends State<_AppSplashScreen> with TrayListener {
|
||||
@override
|
||||
void onTrayMenuItemClick(MenuItem menuItem) {
|
||||
switch (menuItem.key) {
|
||||
case 'mute_notification':
|
||||
final nty = context.read<NotificationProvider>();
|
||||
nty.isMuted = !nty.isMuted;
|
||||
_appTrayMenu.items![2].checked = nty.isMuted;
|
||||
trayManager.setContextMenu(_appTrayMenu);
|
||||
break;
|
||||
case 'window_show':
|
||||
// To prevent the window from being hide after just show on macOS
|
||||
Timer(const Duration(milliseconds: 100), () => appWindow.show());
|
||||
appWindow.show();
|
||||
break;
|
||||
case 'exit':
|
||||
_appLifecycleListener?.dispose();
|
||||
|
@ -79,7 +79,6 @@ class NotificationProvider extends ChangeNotifier {
|
||||
List<SnNotification> notifications = List.empty(growable: true);
|
||||
|
||||
int? skippableNotifyChannel;
|
||||
bool isMuted = false;
|
||||
|
||||
void listen() {
|
||||
_ws.pk.stream.listen((event) {
|
||||
@ -108,7 +107,7 @@ class NotificationProvider extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
updateTray();
|
||||
|
||||
if (!kIsWeb && !isMuted) {
|
||||
if (!kIsWeb) {
|
||||
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
|
||||
LocalNotification notify = LocalNotification(
|
||||
title: notification.title,
|
||||
|
@ -188,9 +188,6 @@ class AppRootScaffold extends StatelessWidget {
|
||||
child: Text(
|
||||
'Solar Network',
|
||||
style: GoogleFonts.spaceGrotesk(),
|
||||
textAlign: Platform.isMacOS
|
||||
? TextAlign.center
|
||||
: TextAlign.start,
|
||||
).padding(horizontal: 12, vertical: 5),
|
||||
),
|
||||
if (!Platform.isMacOS)
|
||||
|
Loading…
x
Reference in New Issue
Block a user