opt desktop pip

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-12-14 12:20:20 +08:00
parent 2bc3275c1f
commit 02bd68f697
4 changed files with 61 additions and 12 deletions

View File

@@ -227,6 +227,12 @@ class PlPlayerController {
late bool isDesktopPip = false;
late Rect _lastWindowBounds;
late final RxBool isAlwaysOnTop = false.obs;
Future<void> setAlwaysOnTop(bool value) {
isAlwaysOnTop.value = value;
return windowManager.setAlwaysOnTop(value);
}
Offset initialFocalPoint = Offset.zero;
Future<void> exitDesktopPip() {
@@ -235,18 +241,8 @@ class PlPlayerController {
windowManager.setTitleBarStyle(TitleBarStyle.normal),
windowManager.setMinimumSize(const Size(400, 700)),
windowManager.setBounds(_lastWindowBounds),
windowManager.setAlwaysOnTop(false),
setAlwaysOnTop(false),
windowManager.setAspectRatio(0),
setting.putAll({
SettingBoxKey.windowSize: [
_lastWindowBounds.width,
_lastWindowBounds.height,
],
SettingBoxKey.windowPosition: [
_lastWindowBounds.left,
_lastWindowBounds.top,
],
}),
]);
}
@@ -270,9 +266,9 @@ class PlPlayerController {
}
await windowManager.setMinimumSize(size);
setAlwaysOnTop(true);
windowManager
..setSize(size)
..setAlwaysOnTop(true)
..setAspectRatio(width / height);
}