Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-02-04 19:54:44 +08:00
parent c099738802
commit 672375b925
2 changed files with 11 additions and 9 deletions

View File

@@ -708,13 +708,12 @@ class HeaderControlState extends State<HeaderControl>
onTap: () async { onTap: () async {
Get.back(); Get.back();
try { try {
final FilePickerResult? file = await FilePicker.platform final result = await FilePicker.platform.pickFiles();
.pickFiles(); if (result != null) {
if (file != null) { final file = result.files.single;
final first = file.files.first; final path = file.path;
final path = first.path;
if (path != null) { if (path != null) {
final name = first.name; final name = file.name;
final length = videoDetailCtr.subtitles.length; final length = videoDetailCtr.subtitles.length;
if (name.endsWith('.json')) { if (name.endsWith('.json')) {
final file = File(path); final file = File(path);

View File

@@ -230,6 +230,7 @@ class PlPlayerController {
late bool isDesktopPip = false; late bool isDesktopPip = false;
late Rect _lastWindowBounds; late Rect _lastWindowBounds;
late final showWindowTitleBar = Pref.showWindowTitleBar;
late final RxBool isAlwaysOnTop = false.obs; late final RxBool isAlwaysOnTop = false.obs;
Future<void> setAlwaysOnTop(bool value) { Future<void> setAlwaysOnTop(bool value) {
isAlwaysOnTop.value = value; isAlwaysOnTop.value = value;
@@ -239,8 +240,8 @@ class PlPlayerController {
Future<void> exitDesktopPip() { Future<void> exitDesktopPip() {
isDesktopPip = false; isDesktopPip = false;
return Future.wait([ return Future.wait([
windowManager.setTitleBarStyle( if (showWindowTitleBar)
Pref.showWindowTitleBar ? TitleBarStyle.normal : TitleBarStyle.hidden), windowManager.setTitleBarStyle(TitleBarStyle.normal),
windowManager.setMinimumSize(const Size(400, 700)), windowManager.setMinimumSize(const Size(400, 700)),
windowManager.setBounds(_lastWindowBounds), windowManager.setBounds(_lastWindowBounds),
setAlwaysOnTop(false), setAlwaysOnTop(false),
@@ -255,7 +256,9 @@ class PlPlayerController {
_lastWindowBounds = await windowManager.getBounds(); _lastWindowBounds = await windowManager.getBounds();
if (showWindowTitleBar) {
windowManager.setTitleBarStyle(TitleBarStyle.hidden); windowManager.setTitleBarStyle(TitleBarStyle.hidden);
}
late final Size size; late final Size size;
final state = videoController!.player.state; final state = videoController!.player.state;