Browse Source

Merge pull request 'Fix Image Width Handling' (#490) from fuzzbot-fixes into trunk

Reviewed-on: https://git.openprivacy.ca/cwtch.im/cwtch-ui/pulls/490
Reviewed-by: Dan Ballard <dan@openprivacy.ca>
trunk
Sarah Jamie Lewis 3 days ago
parent
commit
453feae88a
  1. 17
      lib/widgets/filebubble.dart

17
lib/widgets/filebubble.dart

@ -1,4 +1,5 @@
import 'dart:io';
import 'dart:math';
import 'package:cwtch/config.dart';
import 'package:cwtch/models/contact.dart';
@ -53,7 +54,7 @@ class FileBubbleState extends State<FileBubble> {
filterQuality: FilterQuality.medium,
fit: BoxFit.scaleDown,
alignment: Alignment.center,
height: MediaQuery.of(context).size.height * 0.30,
height: min(MediaQuery.of(context).size.height * 0.30, 150),
isAntiAlias: false,
errorBuilder: (context, error, stackTrace) {
return MalformedBubble();
@ -153,6 +154,7 @@ class FileBubbleState extends State<FileBubble> {
if (Provider.of<Settings>(context).shouldPreview(path)) {
isPreview = true;
wdgDecorations = Center(
widthFactor: 1.0,
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
@ -223,7 +225,18 @@ class FileBubbleState extends State<FileBubble> {
crossAxisAlignment: fromMe ? CrossAxisAlignment.end : CrossAxisAlignment.start,
mainAxisAlignment: fromMe ? MainAxisAlignment.end : MainAxisAlignment.start,
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…
Cancel
Save