Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-07-24 21:07:26 +08:00
parent f1b79eeafc
commit 56ca0cade4
11 changed files with 137 additions and 117 deletions

View File

@@ -26,6 +26,7 @@ Widget dynTextMenuBuilder(
},
),
);
state.addLaunchMenuIfNeeded(buttonItems, index: 5);
return AdaptiveTextSelectionToolbar.buttonItems(
buttonItems: buttonItems,
anchors: state.contextMenuAnchors,

View File

@@ -53,9 +53,7 @@ void showReplyCopyDialog(
},
),
);
if (showEmote) {
state.addLaunchMenuIfNeeded(buttonItems, index: 4);
}
state.addLaunchMenuIfNeeded(buttonItems, index: 4);
}
if (state.isUncollapsed) {
buttonItems.add(

View File

@@ -499,7 +499,7 @@ class ImageGridRenderObjectElement extends RenderObjectElement {
List<ImageModel> picArr,
BoxConstraints layoutInfo,
) {
final maxWidth = layoutInfo.maxWidth;
final maxWidth = math.min(525.0, layoutInfo.maxWidth);
double imageWidth;
double imageHeight;
final length = picArr.length;

View File

@@ -609,13 +609,13 @@ class _GalleryViewerState extends State<GalleryViewer>
items: [
PopupMenuItem(
height: 42,
onTap: () => Utils.copyText(item.url),
child: const Text('复制链接', style: TextStyle(fontSize: 14)),
onTap: () => ImageUtils.downloadImg([item.url]),
child: const Text('保存图片', style: TextStyle(fontSize: 14)),
),
PopupMenuItem(
height: 42,
onTap: () => ImageUtils.downloadImg([item.url]),
child: const Text('保存图片', style: TextStyle(fontSize: 14)),
onTap: () => Utils.copyText(item.url),
child: const Text('复制链接', style: TextStyle(fontSize: 14)),
),
PopupMenuItem(
height: 42,

View File

@@ -5,7 +5,6 @@ import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
import 'package:PiliPlus/common/widgets/stat/stat.dart';
import 'package:PiliPlus/common/widgets/video_popup_menu.dart';
import 'package:PiliPlus/http/search.dart';
import 'package:PiliPlus/models/common/stat_type.dart';
import 'package:PiliPlus/models/home/rcmd/result.dart';
import 'package:PiliPlus/models/model_rec_video_item.dart';
import 'package:PiliPlus/models_new/video/video_detail/dimension.dart';
@@ -97,7 +96,7 @@ class VideoCardV extends StatelessWidget {
onLongPress: onLongPress,
onSecondaryTap: PlatformUtils.isMobile ? null : onLongPress,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: .start,
children: [
AspectRatio(
aspectRatio: Style.aspectRatio,
@@ -154,21 +153,19 @@ class VideoCardV extends StatelessWidget {
final theme = Theme.of(context);
return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(6, 5, 6, 5),
padding: const .fromLTRB(6, 5, 6, 5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: .start,
children: [
Expanded(
child: Text(
"${videoItem.title}\n",
videoItem.title,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
height: 1.38,
),
overflow: .ellipsis,
style: const TextStyle(height: 1.38),
),
),
videoStat(context, theme),
videoStat(theme),
Row(
spacing: 2,
children: [
@@ -207,7 +204,7 @@ class VideoCardV extends StatelessWidget {
child: Text(
videoItem.owner.name.toString(),
maxLines: 1,
overflow: TextOverflow.clip,
overflow: .clip,
semanticsLabel: 'UP${videoItem.owner.name}',
style: TextStyle(
height: 1.5,
@@ -228,17 +225,17 @@ class VideoCardV extends StatelessWidget {
static final shortFormat = DateFormat('M-d');
static final longFormat = DateFormat('yy-M-d');
Widget videoStat(BuildContext context, ThemeData theme) {
Widget videoStat(ThemeData theme) {
return Row(
children: [
StatWidget(
type: StatType.play,
type: .play,
value: videoItem.stat.view,
),
if (videoItem.goto != 'picture') ...[
const SizedBox(width: 4),
StatWidget(
type: StatType.danmaku,
type: .danmaku,
value: videoItem.stat.danmu,
),
],
@@ -260,23 +257,6 @@ class VideoCardV extends StatelessWidget {
),
const SizedBox(width: 2),
],
// deprecated
// else if (videoItem is RcmdVideoItemAppModel &&
// videoItem.desc != null &&
// videoItem.desc!.contains(' · ')) ...[
// const Spacer(),
// Text.rich(
// maxLines: 1,
// TextSpan(
// style: TextStyle(
// fontSize: theme.textTheme.labelSmall!.fontSize,
// color: theme.colorScheme.outline.withValues(alpha: 0.8),
// ),
// text: Utils.shortenChineseDateString(
// videoItem.desc!.split(' · ').last)),
// ),
// const SizedBox(width: 2),
// ]
],
);
}