forked from cwtch.im/cwtch-ui
add mouse icon over file previews to trigger dialog; add exit button to image preview dialoge; spacing
This commit is contained in:
parent
936fca943a
commit
513035789d
|
@ -109,12 +109,15 @@ 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: MouseRegion(
|
||||||
|
cursor: SystemMouseCursors.click,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.all(1.0),
|
padding: EdgeInsets.all(1.0),
|
||||||
child: Image.file(
|
child: Image.file(
|
||||||
myFile!,
|
myFile!,
|
||||||
cacheWidth: 2048, // limit the amount of space the image can decode too, we keep this high-ish to allow quality previews...
|
cacheWidth: 2048,
|
||||||
|
// limit the amount of space the image can decode too, we keep this high-ish to allow quality previews...
|
||||||
filterQuality: FilterQuality.medium,
|
filterQuality: FilterQuality.medium,
|
||||||
fit: BoxFit.scaleDown,
|
fit: BoxFit.scaleDown,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
|
@ -127,7 +130,7 @@ class FileBubbleState extends State<FileBubble> {
|
||||||
onTap: () {
|
onTap: () {
|
||||||
pop(bcontext, myFile!, wdgMessage);
|
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)),
|
||||||
]),
|
]),
|
||||||
|
|
Loading…
Reference in New Issue