mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-25 19:46:47 +08:00
opt mouse control
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -270,6 +270,7 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
itemCount: widget.sources.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
final item = widget.sources[index];
|
||||
final isFileImg = item.sourceType == SourceType.fileImage;
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () => EasyThrottle.throttle(
|
||||
@@ -285,9 +286,12 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
const Duration(milliseconds: 555),
|
||||
onDoubleTap,
|
||||
),
|
||||
onLongPress: item.sourceType == SourceType.fileImage
|
||||
? null
|
||||
: () => onLongPress(item),
|
||||
onLongPress: !isFileImg && Utils.isMobile
|
||||
? () => onLongPress(item)
|
||||
: null,
|
||||
onSecondaryTap: !isFileImg && !Utils.isMobile
|
||||
? () => onLongPress(item)
|
||||
: null,
|
||||
child: widget.itemBuilder != null
|
||||
? widget.itemBuilder!(
|
||||
context,
|
||||
|
||||
@@ -67,6 +67,11 @@ class VideoCardV extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
void onLongPress() => imageSaveDialog(
|
||||
title: videoItem.title,
|
||||
cover: videoItem.cover,
|
||||
bvid: videoItem.bvid,
|
||||
);
|
||||
return Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
@@ -74,11 +79,8 @@ class VideoCardV extends StatelessWidget {
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: InkWell(
|
||||
onTap: () => onPushDetail(Utils.makeHeroTag(videoItem.aid)),
|
||||
onLongPress: () => imageSaveDialog(
|
||||
title: videoItem.title,
|
||||
cover: videoItem.cover,
|
||||
bvid: videoItem.bvid,
|
||||
),
|
||||
onLongPress: Utils.isMobile ? onLongPress : null,
|
||||
onSecondaryTap: Utils.isMobile ? null : onLongPress,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user