mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
fix: macOS Media Control not activated & remove Background Play switch on desktop (#1872)
* fix: macOS Media Control not activated * fix: remove Background Play switch on desktop asdf Update lib/main.dart Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -16,8 +16,8 @@ import 'package:PiliPlus/services/service_locator.dart';
|
|||||||
import 'package:PiliPlus/utils/cache_manager.dart';
|
import 'package:PiliPlus/utils/cache_manager.dart';
|
||||||
import 'package:PiliPlus/utils/calc_window_position.dart';
|
import 'package:PiliPlus/utils/calc_window_position.dart';
|
||||||
import 'package:PiliPlus/utils/date_utils.dart';
|
import 'package:PiliPlus/utils/date_utils.dart';
|
||||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
|
||||||
import 'package:PiliPlus/utils/extension/theme_ext.dart';
|
import 'package:PiliPlus/utils/extension/theme_ext.dart';
|
||||||
|
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||||
import 'package:PiliPlus/utils/json_file_handler.dart';
|
import 'package:PiliPlus/utils/json_file_handler.dart';
|
||||||
import 'package:PiliPlus/utils/path_utils.dart';
|
import 'package:PiliPlus/utils/path_utils.dart';
|
||||||
import 'package:PiliPlus/utils/platform_utils.dart';
|
import 'package:PiliPlus/utils/platform_utils.dart';
|
||||||
@@ -123,6 +123,8 @@ void main() async {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} else if (Platform.isMacOS) {
|
||||||
|
await setupServiceLocator();
|
||||||
}
|
}
|
||||||
|
|
||||||
Request();
|
Request();
|
||||||
|
|||||||
@@ -183,13 +183,14 @@ List<SettingsModel> get playSettings => [
|
|||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
onChanged: (value) => allowRotateScreen = value,
|
onChanged: (value) => allowRotateScreen = value,
|
||||||
),
|
),
|
||||||
const SwitchModel(
|
if (PlatformUtils.isMobile)
|
||||||
title: '后台播放',
|
const SwitchModel(
|
||||||
subtitle: '进入后台时继续播放',
|
title: '后台播放',
|
||||||
leading: Icon(Icons.motion_photos_pause_outlined),
|
subtitle: '进入后台时继续播放',
|
||||||
setKey: SettingBoxKey.continuePlayInBackground,
|
leading: Icon(Icons.motion_photos_pause_outlined),
|
||||||
defaultVal: false,
|
setKey: SettingBoxKey.continuePlayInBackground,
|
||||||
),
|
defaultVal: false,
|
||||||
|
),
|
||||||
if (Platform.isAndroid) ...[
|
if (Platform.isAndroid) ...[
|
||||||
SwitchModel(
|
SwitchModel(
|
||||||
title: '后台画中画',
|
title: '后台画中画',
|
||||||
|
|||||||
@@ -565,15 +565,18 @@ class HeaderControlState extends State<HeaderControl>
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
Obx(
|
if (PlatformUtils.isMobile)
|
||||||
() => ActionRowLineItem(
|
Obx(
|
||||||
iconData: Icons.play_circle_outline,
|
() => ActionRowLineItem(
|
||||||
onTap: plPlayerController.setContinuePlayInBackground,
|
iconData: Icons.play_circle_outline,
|
||||||
text: " 后台播放 ",
|
onTap:
|
||||||
selectStatus:
|
plPlayerController.setContinuePlayInBackground,
|
||||||
plPlayerController.continuePlayInBackground.value,
|
text: " 后台播放 ",
|
||||||
|
selectStatus: plPlayerController
|
||||||
|
.continuePlayInBackground
|
||||||
|
.value,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user