mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
bring back remove player safearea
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -1424,6 +1424,7 @@ class PlPlayerController with BlockConfigMixin {
|
||||
bool isManualFS = true;
|
||||
late final FullScreenMode mode = Pref.fullScreenMode;
|
||||
late final horizontalScreen = Pref.horizontalScreen;
|
||||
late final removeSafeArea = Pref.removeSafeArea;
|
||||
|
||||
// 全屏
|
||||
bool _fsProcessing = false;
|
||||
@@ -1475,12 +1476,26 @@ class PlPlayerController with BlockConfigMixin {
|
||||
}
|
||||
} else {
|
||||
if (PlatformUtils.isMobile) {
|
||||
showStatusBar();
|
||||
if (!removeSafeArea) {
|
||||
showStatusBar();
|
||||
}
|
||||
if (orientation == null && mode == .none) {
|
||||
return;
|
||||
}
|
||||
if (!horizontalScreen) {
|
||||
await portraitUpMode();
|
||||
} else {
|
||||
switch (_orientation) {
|
||||
case .portraitUp:
|
||||
await portraitUpMode();
|
||||
case .landscapeLeft:
|
||||
await landscapeLeftMode();
|
||||
case .portraitDown:
|
||||
await portraitDownMode();
|
||||
case .landscapeRight:
|
||||
await landscapeRightMode();
|
||||
case _:
|
||||
}
|
||||
}
|
||||
} else {
|
||||
await exitDesktopFullScreen();
|
||||
@@ -1617,6 +1632,9 @@ class PlPlayerController with BlockConfigMixin {
|
||||
}
|
||||
|
||||
_playerCount = 0;
|
||||
if (removeSafeArea) {
|
||||
showStatusBar();
|
||||
}
|
||||
danmakuController = null;
|
||||
_stopOrientationListener();
|
||||
_disableAutoEnterPip();
|
||||
|
||||
@@ -1616,6 +1616,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
isTop: true,
|
||||
controller: animationController,
|
||||
isFullScreen: isFullScreen,
|
||||
removeSafeArea: plPlayerController.removeSafeArea,
|
||||
child: plPlayerController.isDesktopPip
|
||||
? GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
@@ -1628,6 +1629,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
isTop: false,
|
||||
controller: animationController,
|
||||
isFullScreen: isFullScreen,
|
||||
removeSafeArea: plPlayerController.removeSafeArea,
|
||||
child:
|
||||
widget.bottomControl ??
|
||||
BottomControl(
|
||||
@@ -1816,6 +1818,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
if (plPlayerController.showFsLockBtn)
|
||||
ViewSafeArea(
|
||||
right: false,
|
||||
left: !plPlayerController.removeSafeArea,
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: FractionalTranslation(
|
||||
@@ -1859,6 +1862,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
if (plPlayerController.showFsScreenshotBtn)
|
||||
ViewSafeArea(
|
||||
left: false,
|
||||
right: !plPlayerController.removeSafeArea,
|
||||
child: Obx(
|
||||
() => Align(
|
||||
alignment: Alignment.centerRight,
|
||||
|
||||
@@ -8,12 +8,14 @@ class AppBarAni extends StatelessWidget {
|
||||
required this.controller,
|
||||
required this.isTop,
|
||||
required this.isFullScreen,
|
||||
required this.removeSafeArea,
|
||||
});
|
||||
|
||||
final Widget child;
|
||||
final AnimationController controller;
|
||||
final bool isTop;
|
||||
final bool isFullScreen;
|
||||
final bool removeSafeArea;
|
||||
|
||||
static final _topPos = Tween<Offset>(
|
||||
begin: const Offset(0.0, -1.0),
|
||||
@@ -53,11 +55,13 @@ class AppBarAni extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
gradient: isTop ? _topDecoration : _bottomDecoration,
|
||||
),
|
||||
child: ViewSafeArea(
|
||||
left: isFullScreen,
|
||||
right: isFullScreen,
|
||||
child: child,
|
||||
),
|
||||
child: removeSafeArea
|
||||
? child
|
||||
: ViewSafeArea(
|
||||
left: isFullScreen,
|
||||
right: isFullScreen,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user