Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-10-17 17:35:22 +08:00
parent 57c57b02a5
commit 52498b3e34
6 changed files with 117 additions and 113 deletions

View File

@@ -231,7 +231,7 @@ Widget defaultUser({
width: 38,
height: 38,
child: IconButton(
tooltip: '默认用户头像',
tooltip: '点击登录',
style: ButtonStyle(
padding: const WidgetStatePropertyAll(EdgeInsets.zero),
backgroundColor: WidgetStatePropertyAll(

View File

@@ -140,6 +140,7 @@ List<SettingsModel> get playSettings => [
}
},
),
if (Utils.isDesktop)
SettingsModel(
settingsType: SettingsType.sw1tch,
title: '最小化时暂停/还原时播放',

View File

@@ -198,7 +198,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
}
// 播放器状态监听
Future<void> playerListener(PlayerStatus? status) async {
Future<void> playerListener(PlayerStatus status) async {
try {
if (videoDetailController.scrollCtr.hasClients) {
bool isPlaying = status == PlayerStatus.playing;

View File

@@ -2192,9 +2192,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
);
}
static const _overlaySpacing = 10.0;
static const _overlayItemWidth = 40.0;
static const _overlayHeight = 35.0;
static const _overlaySpacing = 5.0;
static const _actionItemWidth = 40.0;
static const _actionItemHeight = 35.0 - _triangleHeight;
DanmakuItem<DanmakuExtra>? _suspendedDm;
Offset? _dmOffset;
@@ -2215,8 +2215,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
onTap();
},
child: SizedBox(
height: _overlayHeight,
width: _overlayItemWidth,
width: _actionItemWidth,
height: _actionItemHeight,
child: Center(
child: child,
),
@@ -2250,12 +2250,12 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
final seekOffset = _getValidOffset(item.content.text);
final overlayWidth = _overlayItemWidth * (seekOffset == null ? 3 : 4);
final overlayWidth = _actionItemWidth * (seekOffset == null ? 3 : 4);
final dy = item.content.type == DanmakuItemType.bottom
? maxHeight - item.yPosition - item.height
: item.yPosition;
final top = dy + item.height + 4;
final top = dy + item.height + _triangleHeight + 2;
final realLeft = dx + overlayWidth / 2;
@@ -2277,6 +2277,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
return Positioned(
right: right,
top: top,
child: RepaintBoundary(
child: CustomPaint(
painter: _DanmakuTipPainter(offset: triangleOffset),
child: Row(
@@ -2338,7 +2339,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
if (seekOffset != null)
_dmActionItem(
const Icon(
size: 20,
size: 18,
Icons.gps_fixed_outlined,
color: Colors.white,
),
@@ -2385,6 +2386,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
},
),
),
),
);
}
}
@@ -2732,6 +2734,8 @@ Widget buildViewPointWidget(
);
}
const double _triangleHeight = 5.6;
class _DanmakuTipPainter extends CustomPainter {
final double offset;
@@ -2747,11 +2751,10 @@ class _DanmakuTipPainter extends CustomPainter {
final strokePaint = Paint()
..color = const Color(0x7EFFFFFF)
..style = PaintingStyle.stroke
..strokeWidth = 1.5;
..strokeWidth = 1.25;
final radius = size.height / 2;
final triangleHeight = size.height / 6;
final triangleBase = triangleHeight * 2 / 3;
const triangleBase = _triangleHeight * 2 / 3;
final triangleCenterX = (size.width / 2 + offset).clamp(
radius + triangleBase,
@@ -2760,7 +2763,7 @@ class _DanmakuTipPainter extends CustomPainter {
final path = Path()
// triangle (exceed)
..moveTo(triangleCenterX - triangleBase, 0)
..lineTo(triangleCenterX, -triangleHeight)
..lineTo(triangleCenterX, -_triangleHeight)
..lineTo(triangleCenterX + triangleBase, 0)
// top
..lineTo(size.width - radius, 0)

View File

@@ -860,7 +860,7 @@ abstract class Pref {
_setting.get(SettingBoxKey.enablePlayAll, defaultValue: true);
static bool get enableTapDm =>
_setting.get(SettingBoxKey.enableTapDm, defaultValue: Utils.isMobile);
_setting.get(SettingBoxKey.enableTapDm, defaultValue: true);
static bool get showTrayIcon =>
_setting.get(SettingBoxKey.showTrayIcon, defaultValue: true);