Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PE-5212: fix file name shirking preview #1518

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions lib/components/details_panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,13 @@ class _DetailsPanelState extends State<DetailsPanel> {
width: 8,
),
Expanded(
child: Text(
widget.item.name,
style: ArDriveTypography.body.buttonLargeBold(),
child: Tooltip(
message: widget.item.name,
child: Text(
widget.item.name,
style: ArDriveTypography.body.buttonLargeBold(),
overflow: TextOverflow.ellipsis,
),
),
),
if (widget.item is FileDataTableItem &&
Expand Down Expand Up @@ -414,13 +418,18 @@ class _DetailsPanelState extends State<DetailsPanel> {
child: ListTile(
contentPadding: EdgeInsets.zero,
leading: DriveExplorerItemTileLeading(item: widget.item),
title: Text(
widget.item.name,
style: ArDriveTypography.body.buttonLargeBold(
color: ArDriveTheme.of(context)
.themeData
.colors
.themeFgDefault,
title: Tooltip(
message: widget.item.name,
child: Text(
widget.item.name,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: ArDriveTypography.body.buttonLargeBold(
color: ArDriveTheme.of(context)
.themeData
.colors
.themeFgDefault,
),
),
),
subtitle: Text(
Expand Down
55 changes: 35 additions & 20 deletions lib/pages/drive_detail/components/fs_entry_preview_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,18 @@ class _VideoPlayerWidgetState extends State<VideoPlayerWidget>
Padding(
padding: const EdgeInsets.fromLTRB(24, 8, 24, 32),
child: Column(children: [
Text(widget.filename,
Tooltip(
message: widget.filename,
child: Text(
widget.filename,
overflow: TextOverflow.ellipsis,
maxLines: 2,
textAlign: TextAlign.center,
style: ArDriveTypography.body
.smallBold700(color: colors.themeFgDefault)),
style: ArDriveTypography.body.smallBold700(
color: colors.themeFgDefault,
),
),
),
const SizedBox(height: 8),
Row(
children: [
Expand Down Expand Up @@ -872,10 +880,13 @@ class _FullScreenVideoPlayerWidgetState
color: colors.themeBgCanvas,
child: Column(
children: [
Text(widget.filename,
style: ArDriveTypography.body
.smallBold700(
color: colors.themeFgDefault)),
Tooltip(
message: widget.filename,
child: Text(widget.filename,
style: ArDriveTypography.body
.smallBold700(
color: colors.themeFgDefault)),
),
const SizedBox(height: 8),
Row(
children: [
Expand Down Expand Up @@ -1486,7 +1497,9 @@ class _ImagePreviewWidgetState extends State<ImagePreviewWidget> {
const SizedBox(
width: 18,
),
_buildNameAndExtension(isFileExplorer: isFileExplorer),
Flexible(
child:
_buildNameAndExtension(isFileExplorer: isFileExplorer)),
],
),
),
Expand Down Expand Up @@ -1568,25 +1581,27 @@ class _ImagePreviewWidgetState extends State<ImagePreviewWidget> {
builder: (context, imagePreview, _) {
final filename = imagePreview.filename!;
final contentType = imagePreview.contentType!;
final fileNameWithoutExtension =
getBasenameWithoutExtension(filePath: filename);
return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: isFileExplorer
? CrossAxisAlignment.center
: CrossAxisAlignment.start,
children: [
Wrap(
direction: Axis.horizontal,
children: [
Text(
getBasenameWithoutExtension(filePath: filename),
style: ArDriveTypography.body.smallBold700(
color: ArDriveTheme.of(context)
.themeData
.colors
.themeFgDefault,
),
Tooltip(
message: fileNameWithoutExtension,
child: Text(
fileNameWithoutExtension,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: ArDriveTypography.body.smallBold700(
color: ArDriveTheme.of(context)
.themeData
.colors
.themeFgDefault,
),
],
),
),
Text(
getFileTypeFromMime(
Expand Down
Loading