mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -231,7 +231,7 @@ Widget defaultUser({
|
|||||||
width: 38,
|
width: 38,
|
||||||
height: 38,
|
height: 38,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
tooltip: '默认用户头像',
|
tooltip: '点击登录',
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: const WidgetStatePropertyAll(EdgeInsets.zero),
|
padding: const WidgetStatePropertyAll(EdgeInsets.zero),
|
||||||
backgroundColor: WidgetStatePropertyAll(
|
backgroundColor: WidgetStatePropertyAll(
|
||||||
|
|||||||
@@ -140,18 +140,19 @@ List<SettingsModel> get playSettings => [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SettingsModel(
|
if (Utils.isDesktop)
|
||||||
settingsType: SettingsType.sw1tch,
|
SettingsModel(
|
||||||
title: '最小化时暂停/还原时播放',
|
settingsType: SettingsType.sw1tch,
|
||||||
leading: const Icon(Icons.pause_circle_outline),
|
title: '最小化时暂停/还原时播放',
|
||||||
setKey: SettingBoxKey.pauseOnMinimize,
|
leading: const Icon(Icons.pause_circle_outline),
|
||||||
defaultVal: false,
|
setKey: SettingBoxKey.pauseOnMinimize,
|
||||||
onChanged: (value) {
|
defaultVal: false,
|
||||||
try {
|
onChanged: (value) {
|
||||||
Get.find<MainController>().pauseOnMinimize = value;
|
try {
|
||||||
} catch (_) {}
|
Get.find<MainController>().pauseOnMinimize = value;
|
||||||
},
|
} catch (_) {}
|
||||||
),
|
},
|
||||||
|
),
|
||||||
const SettingsModel(
|
const SettingsModel(
|
||||||
settingsType: SettingsType.sw1tch,
|
settingsType: SettingsType.sw1tch,
|
||||||
title: '启用键盘控制',
|
title: '启用键盘控制',
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 播放器状态监听
|
// 播放器状态监听
|
||||||
Future<void> playerListener(PlayerStatus? status) async {
|
Future<void> playerListener(PlayerStatus status) async {
|
||||||
try {
|
try {
|
||||||
if (videoDetailController.scrollCtr.hasClients) {
|
if (videoDetailController.scrollCtr.hasClients) {
|
||||||
bool isPlaying = status == PlayerStatus.playing;
|
bool isPlaying = status == PlayerStatus.playing;
|
||||||
|
|||||||
@@ -2192,9 +2192,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _overlaySpacing = 10.0;
|
static const _overlaySpacing = 5.0;
|
||||||
static const _overlayItemWidth = 40.0;
|
static const _actionItemWidth = 40.0;
|
||||||
static const _overlayHeight = 35.0;
|
static const _actionItemHeight = 35.0 - _triangleHeight;
|
||||||
|
|
||||||
DanmakuItem<DanmakuExtra>? _suspendedDm;
|
DanmakuItem<DanmakuExtra>? _suspendedDm;
|
||||||
Offset? _dmOffset;
|
Offset? _dmOffset;
|
||||||
@@ -2215,8 +2215,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
onTap();
|
onTap();
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: _overlayHeight,
|
width: _actionItemWidth,
|
||||||
width: _overlayItemWidth,
|
height: _actionItemHeight,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: child,
|
child: child,
|
||||||
),
|
),
|
||||||
@@ -2250,12 +2250,12 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
|
|
||||||
final seekOffset = _getValidOffset(item.content.text);
|
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
|
final dy = item.content.type == DanmakuItemType.bottom
|
||||||
? maxHeight - item.yPosition - item.height
|
? maxHeight - item.yPosition - item.height
|
||||||
: item.yPosition;
|
: item.yPosition;
|
||||||
final top = dy + item.height + 4;
|
final top = dy + item.height + _triangleHeight + 2;
|
||||||
|
|
||||||
final realLeft = dx + overlayWidth / 2;
|
final realLeft = dx + overlayWidth / 2;
|
||||||
|
|
||||||
@@ -2277,112 +2277,114 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
return Positioned(
|
return Positioned(
|
||||||
right: right,
|
right: right,
|
||||||
top: top,
|
top: top,
|
||||||
child: CustomPaint(
|
child: RepaintBoundary(
|
||||||
painter: _DanmakuTipPainter(offset: triangleOffset),
|
child: CustomPaint(
|
||||||
child: Row(
|
painter: _DanmakuTipPainter(offset: triangleOffset),
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: switch (extra) {
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
null => throw UnimplementedError(),
|
children: switch (extra) {
|
||||||
VideoDanmaku() => [
|
null => throw UnimplementedError(),
|
||||||
_dmActionItem(
|
VideoDanmaku() => [
|
||||||
extra.isLike
|
_dmActionItem(
|
||||||
? const Icon(
|
extra.isLike
|
||||||
size: 20,
|
? const Icon(
|
||||||
CustomIcons.player_dm_tip_like_solid,
|
size: 20,
|
||||||
color: Colors.white,
|
CustomIcons.player_dm_tip_like_solid,
|
||||||
)
|
color: Colors.white,
|
||||||
: const Icon(
|
)
|
||||||
size: 20,
|
: const Icon(
|
||||||
CustomIcons.player_dm_tip_like,
|
size: 20,
|
||||||
color: Colors.white,
|
CustomIcons.player_dm_tip_like,
|
||||||
),
|
color: Colors.white,
|
||||||
onTap: () => HeaderControl.likeDanmaku(
|
),
|
||||||
extra,
|
onTap: () => HeaderControl.likeDanmaku(
|
||||||
plPlayerController.cid!,
|
extra,
|
||||||
|
plPlayerController.cid!,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
_dmActionItem(
|
||||||
_dmActionItem(
|
const Icon(
|
||||||
const Icon(
|
size: 19,
|
||||||
size: 19,
|
CustomIcons.player_dm_tip_copy,
|
||||||
CustomIcons.player_dm_tip_copy,
|
color: Colors.white,
|
||||||
color: Colors.white,
|
),
|
||||||
|
onTap: () => Utils.copyText(item.content.text),
|
||||||
),
|
),
|
||||||
onTap: () => Utils.copyText(item.content.text),
|
if (item.content.selfSend)
|
||||||
),
|
_dmActionItem(
|
||||||
if (item.content.selfSend)
|
const Icon(
|
||||||
|
size: 20,
|
||||||
|
CustomIcons.player_dm_tip_recall,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
onTap: () => HeaderControl.deleteDanmaku(
|
||||||
|
extra.id,
|
||||||
|
plPlayerController.cid!,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
else
|
||||||
|
_dmActionItem(
|
||||||
|
const Icon(
|
||||||
|
size: 20,
|
||||||
|
CustomIcons.player_dm_tip_back,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
onTap: () => HeaderControl.reportDanmaku(
|
||||||
|
context,
|
||||||
|
extra: extra,
|
||||||
|
ctr: plPlayerController,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (seekOffset != null)
|
||||||
|
_dmActionItem(
|
||||||
|
const Icon(
|
||||||
|
size: 18,
|
||||||
|
Icons.gps_fixed_outlined,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
onTap: () => plPlayerController.seekTo(
|
||||||
|
Duration(seconds: seekOffset),
|
||||||
|
isSeek: false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
LiveDanmaku() => [
|
||||||
_dmActionItem(
|
_dmActionItem(
|
||||||
const Icon(
|
const Icon(
|
||||||
size: 20,
|
size: 20,
|
||||||
CustomIcons.player_dm_tip_recall,
|
MdiIcons.accountOutline,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
onTap: () => HeaderControl.deleteDanmaku(
|
onTap: () => Get.toNamed('/member?mid=${extra.mid}'),
|
||||||
extra.id,
|
),
|
||||||
plPlayerController.cid!,
|
_dmActionItem(
|
||||||
|
const Icon(
|
||||||
|
size: 19,
|
||||||
|
CustomIcons.player_dm_tip_copy,
|
||||||
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
)
|
onTap: () => Utils.copyText(item.content.text),
|
||||||
else
|
),
|
||||||
_dmActionItem(
|
_dmActionItem(
|
||||||
const Icon(
|
const Icon(
|
||||||
size: 20,
|
size: 20,
|
||||||
CustomIcons.player_dm_tip_back,
|
CustomIcons.player_dm_tip_back,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
onTap: () => HeaderControl.reportDanmaku(
|
onTap: () => HeaderControl.reportLiveDanmaku(
|
||||||
context,
|
context,
|
||||||
|
roomId: (widget.bottomControl as live_bottom.BottomControl)
|
||||||
|
.liveRoomCtr
|
||||||
|
.roomId,
|
||||||
|
msg: item.content.text,
|
||||||
extra: extra,
|
extra: extra,
|
||||||
ctr: plPlayerController,
|
ctr: plPlayerController,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (seekOffset != null)
|
],
|
||||||
_dmActionItem(
|
},
|
||||||
const Icon(
|
),
|
||||||
size: 20,
|
|
||||||
Icons.gps_fixed_outlined,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
onTap: () => plPlayerController.seekTo(
|
|
||||||
Duration(seconds: seekOffset),
|
|
||||||
isSeek: false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
LiveDanmaku() => [
|
|
||||||
_dmActionItem(
|
|
||||||
const Icon(
|
|
||||||
size: 20,
|
|
||||||
MdiIcons.accountOutline,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
onTap: () => Get.toNamed('/member?mid=${extra.mid}'),
|
|
||||||
),
|
|
||||||
_dmActionItem(
|
|
||||||
const Icon(
|
|
||||||
size: 19,
|
|
||||||
CustomIcons.player_dm_tip_copy,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
onTap: () => Utils.copyText(item.content.text),
|
|
||||||
),
|
|
||||||
_dmActionItem(
|
|
||||||
const Icon(
|
|
||||||
size: 20,
|
|
||||||
CustomIcons.player_dm_tip_back,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
onTap: () => HeaderControl.reportLiveDanmaku(
|
|
||||||
context,
|
|
||||||
roomId: (widget.bottomControl as live_bottom.BottomControl)
|
|
||||||
.liveRoomCtr
|
|
||||||
.roomId,
|
|
||||||
msg: item.content.text,
|
|
||||||
extra: extra,
|
|
||||||
ctr: plPlayerController,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -2732,6 +2734,8 @@ Widget buildViewPointWidget(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const double _triangleHeight = 5.6;
|
||||||
|
|
||||||
class _DanmakuTipPainter extends CustomPainter {
|
class _DanmakuTipPainter extends CustomPainter {
|
||||||
final double offset;
|
final double offset;
|
||||||
|
|
||||||
@@ -2747,11 +2751,10 @@ class _DanmakuTipPainter extends CustomPainter {
|
|||||||
final strokePaint = Paint()
|
final strokePaint = Paint()
|
||||||
..color = const Color(0x7EFFFFFF)
|
..color = const Color(0x7EFFFFFF)
|
||||||
..style = PaintingStyle.stroke
|
..style = PaintingStyle.stroke
|
||||||
..strokeWidth = 1.5;
|
..strokeWidth = 1.25;
|
||||||
|
|
||||||
final radius = size.height / 2;
|
final radius = size.height / 2;
|
||||||
final triangleHeight = size.height / 6;
|
const triangleBase = _triangleHeight * 2 / 3;
|
||||||
final triangleBase = triangleHeight * 2 / 3;
|
|
||||||
|
|
||||||
final triangleCenterX = (size.width / 2 + offset).clamp(
|
final triangleCenterX = (size.width / 2 + offset).clamp(
|
||||||
radius + triangleBase,
|
radius + triangleBase,
|
||||||
@@ -2760,7 +2763,7 @@ class _DanmakuTipPainter extends CustomPainter {
|
|||||||
final path = Path()
|
final path = Path()
|
||||||
// triangle (exceed)
|
// triangle (exceed)
|
||||||
..moveTo(triangleCenterX - triangleBase, 0)
|
..moveTo(triangleCenterX - triangleBase, 0)
|
||||||
..lineTo(triangleCenterX, -triangleHeight)
|
..lineTo(triangleCenterX, -_triangleHeight)
|
||||||
..lineTo(triangleCenterX + triangleBase, 0)
|
..lineTo(triangleCenterX + triangleBase, 0)
|
||||||
// top
|
// top
|
||||||
..lineTo(size.width - radius, 0)
|
..lineTo(size.width - radius, 0)
|
||||||
|
|||||||
@@ -860,7 +860,7 @@ abstract class Pref {
|
|||||||
_setting.get(SettingBoxKey.enablePlayAll, defaultValue: true);
|
_setting.get(SettingBoxKey.enablePlayAll, defaultValue: true);
|
||||||
|
|
||||||
static bool get enableTapDm =>
|
static bool get enableTapDm =>
|
||||||
_setting.get(SettingBoxKey.enableTapDm, defaultValue: Utils.isMobile);
|
_setting.get(SettingBoxKey.enableTapDm, defaultValue: true);
|
||||||
|
|
||||||
static bool get showTrayIcon =>
|
static bool get showTrayIcon =>
|
||||||
_setting.get(SettingBoxKey.showTrayIcon, defaultValue: true);
|
_setting.get(SettingBoxKey.showTrayIcon, defaultValue: true);
|
||||||
|
|||||||
Reference in New Issue
Block a user