Fix Image Width Handling #490
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:cwtch/config.dart';
|
import 'package:cwtch/config.dart';
|
||||||
import 'package:cwtch/models/contact.dart';
|
import 'package:cwtch/models/contact.dart';
|
||||||
|
@ -53,7 +54,7 @@ class FileBubbleState extends State<FileBubble> {
|
||||||
filterQuality: FilterQuality.medium,
|
filterQuality: FilterQuality.medium,
|
||||||
fit: BoxFit.scaleDown,
|
fit: BoxFit.scaleDown,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
height: MediaQuery.of(context).size.height * 0.30,
|
height: min(MediaQuery.of(context).size.height * 0.30, 150),
|
||||||
isAntiAlias: false,
|
isAntiAlias: false,
|
||||||
errorBuilder: (context, error, stackTrace) {
|
errorBuilder: (context, error, stackTrace) {
|
||||||
return MalformedBubble();
|
return MalformedBubble();
|
||||||
|
@ -153,6 +154,7 @@ 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(
|
||||||
|
widthFactor: 1.0,
|
||||||
child: MouseRegion(
|
child: MouseRegion(
|
||||||
cursor: SystemMouseCursors.click,
|
cursor: SystemMouseCursors.click,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
|
@ -223,7 +225,18 @@ class FileBubbleState extends State<FileBubble> {
|
||||||
crossAxisAlignment: fromMe ? CrossAxisAlignment.end : CrossAxisAlignment.start,
|
crossAxisAlignment: fromMe ? CrossAxisAlignment.end : CrossAxisAlignment.start,
|
||||||
mainAxisAlignment: fromMe ? MainAxisAlignment.end : MainAxisAlignment.start,
|
mainAxisAlignment: fromMe ? MainAxisAlignment.end : MainAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [wdgSender, isPreview ? Container() : wdgMessage, wdgDecorations, messageStatusWidget]),
|
children: [
|
||||||
|
wdgSender,
|
||||||
|
isPreview
|
||||||
|
? Container(
|
||||||
|
width: 0,
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
margin: EdgeInsets.zero,
|
||||||
|
)
|
||||||
|
: wdgMessage,
|
||||||
|
wdgDecorations,
|
||||||
|
messageStatusWidget
|
||||||
|
]),
|
||||||
));
|
));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue