add mouse icon over file previews to trigger dialog; add exit button to image preview dialoge; spacing
continuous-integration/drone/pr Build is pending Details

This commit is contained in:
Dan Ballard 2021-12-20 16:34:51 -05:00
parent 936fca943a
commit 513035789d
1 changed files with 35 additions and 23 deletions

View File

@ -109,25 +109,28 @@ class FileBubbleState extends State<FileBubble> {
if (Provider.of<Settings>(context).shouldPreview(path!)) { if (Provider.of<Settings>(context).shouldPreview(path!)) {
isPreview = true; isPreview = true;
wdgDecorations = Center( wdgDecorations = Center(
child: GestureDetector( child: MouseRegion(
child: Padding( cursor: SystemMouseCursors.click,
padding: EdgeInsets.all(1.0), child: GestureDetector(
child: Image.file( child: Padding(
myFile!, padding: EdgeInsets.all(1.0),
cacheWidth: 2048, // limit the amount of space the image can decode too, we keep this high-ish to allow quality previews... child: Image.file(
filterQuality: FilterQuality.medium, myFile!,
fit: BoxFit.scaleDown, cacheWidth: 2048,
alignment: Alignment.center, // limit the amount of space the image can decode too, we keep this high-ish to allow quality previews...
height: MediaQuery.of(bcontext).size.height * 0.30, filterQuality: FilterQuality.medium,
isAntiAlias: false, fit: BoxFit.scaleDown,
errorBuilder: (context, error, stackTrace) { alignment: Alignment.center,
return MalformedBubble(); height: MediaQuery.of(bcontext).size.height * 0.30,
}, isAntiAlias: false,
)), errorBuilder: (context, error, stackTrace) {
onTap: () { return MalformedBubble();
pop(bcontext, myFile!, wdgMessage); },
}, )),
)); onTap: () {
pop(bcontext, myFile!, wdgMessage);
},
)));
} else { } else {
wdgDecorations = Visibility(visible: widget.interactive, child: Text(AppLocalizations.of(context)!.fileSavedTo + ': ' + path + '\u202F')); wdgDecorations = Visibility(visible: widget.interactive, child: Text(AppLocalizations.of(context)!.fileSavedTo + ': ' + path + '\u202F'));
} }
@ -146,9 +149,7 @@ class FileBubbleState extends State<FileBubble> {
// in this case, the download was done in a previous application launch, // in this case, the download was done in a previous application launch,
// so we probably have to request an info lookup // so we probably have to request an info lookup
if (!downloadInterrupted) { if (!downloadInterrupted) {
wdgDecorations = Text( wdgDecorations = Text(AppLocalizations.of(context)!.fileCheckingStatus + '...' + '\u202F');
AppLocalizations.of(context)!.fileCheckingStatus + '...' +
'\u202F');
} else { } else {
var path = Provider.of<ProfileInfoState>(context).downloadFinalPath(widget.fileKey()) ?? ""; var path = Provider.of<ProfileInfoState>(context).downloadFinalPath(widget.fileKey()) ?? "";
wdgDecorations = Visibility( wdgDecorations = Visibility(
@ -356,7 +357,15 @@ class FileBubbleState extends State<FileBubble> {
child: Container( child: Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Column(children: [ child: Column(children: [
meta, ListTile(
title: meta,
trailing: IconButton(
icon: Icon(Icons.close),
color: Provider.of<Settings>(context, listen: false).theme.toolbarIconColor,
iconSize: 32,
onPressed: () {
Navigator.pop(context, true);
})),
Image.file( Image.file(
myFile, myFile,
cacheWidth: (MediaQuery.of(context).size.width * 0.6).floor(), cacheWidth: (MediaQuery.of(context).size.width * 0.6).floor(),
@ -364,6 +373,9 @@ class FileBubbleState extends State<FileBubble> {
height: (MediaQuery.of(context).size.height * 0.6), height: (MediaQuery.of(context).size.height * 0.6),
fit: BoxFit.scaleDown, fit: BoxFit.scaleDown,
), ),
SizedBox(
height: 20,
),
Visibility(visible: !Platform.isAndroid, child: Text(myFile.path, textAlign: TextAlign.center)), Visibility(visible: !Platform.isAndroid, child: Text(myFile.path, textAlign: TextAlign.center)),
Visibility(visible: Platform.isAndroid, child: IconButton(icon: Icon(Icons.arrow_downward), onPressed: androidExport)), Visibility(visible: Platform.isAndroid, child: IconButton(icon: Icon(Icons.arrow_downward), onPressed: androidExport)),
]), ]),