mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-29 20:48:40 +00:00
opt mouse control
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:PiliPlus/common/widgets/select_mask.dart';
|
||||
import 'package:PiliPlus/models_new/fav/fav_note/list.dart';
|
||||
import 'package:PiliPlus/pages/fav/note/controller.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class FavNoteItem extends StatelessWidget {
|
||||
@@ -18,6 +19,13 @@ class FavNoteItem extends StatelessWidget {
|
||||
final FavNoteController ctr;
|
||||
final VoidCallback onSelect;
|
||||
|
||||
void onLongPress() {
|
||||
if (!ctr.enableMultiSelect.value) {
|
||||
ctr.enableMultiSelect.value = true;
|
||||
onSelect();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
@@ -36,12 +44,8 @@ class FavNoteItem extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
},
|
||||
onLongPress: () {
|
||||
if (!ctr.enableMultiSelect.value) {
|
||||
ctr.enableMultiSelect.value = true;
|
||||
onSelect();
|
||||
}
|
||||
},
|
||||
onLongPress: Utils.isMobile ? onLongPress : null,
|
||||
onSecondaryTap: Utils.isMobile ? null : onLongPress,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: StyleString.safeSpace,
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:PiliPlus/models/common/badge_type.dart';
|
||||
import 'package:PiliPlus/models_new/fav/fav_pgc/list.dart';
|
||||
import 'package:PiliPlus/pages/common/multi_select/base.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class FavPgcItem extends StatelessWidget {
|
||||
@@ -23,6 +24,13 @@ class FavPgcItem extends StatelessWidget {
|
||||
final VoidCallback onSelect;
|
||||
final VoidCallback onUpdateStatus;
|
||||
|
||||
void onLongPress() {
|
||||
if (!ctr.enableMultiSelect.value) {
|
||||
ctr.enableMultiSelect.value = true;
|
||||
onSelect();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
@@ -39,12 +47,8 @@ class FavPgcItem extends StatelessWidget {
|
||||
}
|
||||
PageUtils.viewPgc(seasonId: item.seasonId);
|
||||
},
|
||||
onLongPress: () {
|
||||
if (!ctr.enableMultiSelect.value) {
|
||||
ctr.enableMultiSelect.value = true;
|
||||
onSelect();
|
||||
}
|
||||
},
|
||||
onLongPress: Utils.isMobile ? onLongPress : null,
|
||||
onSecondaryTap: Utils.isMobile ? null : onLongPress,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: StyleString.safeSpace,
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models_new/fav/fav_topic/topic_item.dart';
|
||||
import 'package:PiliPlus/pages/fav/topic/controller.dart';
|
||||
import 'package:PiliPlus/utils/grid.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -78,6 +79,13 @@ class _FavTopicPageState extends State<FavTopicPage>
|
||||
_controller.onLoadMore();
|
||||
}
|
||||
final item = response[index];
|
||||
|
||||
void onLongPress() => showConfirmDialog(
|
||||
context: context,
|
||||
title: '确定取消收藏?',
|
||||
onConfirm: () => _controller.onRemove(index, item.id),
|
||||
);
|
||||
|
||||
return Material(
|
||||
color: theme.colorScheme.onInverseSurface,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(6)),
|
||||
@@ -89,13 +97,8 @@ class _FavTopicPageState extends State<FavTopicPage>
|
||||
'name': item.name!,
|
||||
},
|
||||
),
|
||||
onLongPress: () => showConfirmDialog(
|
||||
context: context,
|
||||
title: '确定取消收藏?',
|
||||
onConfirm: () {
|
||||
_controller.onRemove(index, item.id);
|
||||
},
|
||||
),
|
||||
onLongPress: Utils.isMobile ? onLongPress : null,
|
||||
onSecondaryTap: Utils.isMobile ? null : onLongPress,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(6),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user