Fix debug layout errors + Fix Quoted File Message Layout
continuous-integration/drone/push Build is passing Details

trunk
Sarah Jamie Lewis 1 month ago committed by Gitea
parent 23ae1ac0bb
commit bf05a52d63

@ -59,7 +59,7 @@ class FileMessage extends Message {
if (shareObj == null) {
return MessageRow(MalformedBubble(), 0);
}
String nameSuggestion = shareObj['n'] as String;
String nameSuggestion = shareObj['f'] as String;
String rootHash = shareObj['h'] as String;
String nonce = shareObj['n'] as String;
int fileSize = shareObj['s'] as int;
@ -68,8 +68,7 @@ class FileMessage extends Message {
}
return Container(
alignment: Alignment.center,
width: 50,
height: 50,
height: 100,
child: FileBubble(
nameSuggestion,
rootHash,

@ -28,12 +28,12 @@ class TextMessage extends Message {
return SelectableLinkify(
text: content + '\u202F',
options: LinkifyOptions(messageFormatting: formatMessages, parseLinks: false, looseUrl: true, defaultToHttps: true),
linkifiers: [UrlLinkifier()],
linkifiers: [],
onOpen: null,
textAlign: TextAlign.left,
style: TextStyle(overflow: TextOverflow.ellipsis),
style: TextStyle(overflow: TextOverflow.fade),
codeStyle: TextStyle(overflow: TextOverflow.ellipsis),
textWidthBasis: TextWidthBasis.longestLine,
textWidthBasis: TextWidthBasis.parent,
);
});
}

@ -333,6 +333,7 @@ class SelectableLinkify extends StatelessWidget {
cursorHeight: cursorHeight,
selectionControls: selectionControls,
onSelectionChanged: onSelectionChanged,
style: style,
);
}
}

@ -149,6 +149,8 @@ class _MessageViewState extends State<MessageView> {
backgroundColor: Provider.of<Settings>(context).theme.backgroundMainColor,
floatingActionButton: showDown
? FloatingActionButton(
// heroTags need to be unique per screen (important when we pop up and down)...
heroTag: "popDown" + Provider.of<ContactInfoState>(context, listen: false).onion,
child: Icon(Icons.arrow_downward, color: Provider.of<Settings>(context).current().defaultButtonTextColor),
onPressed: () {
Provider.of<AppState>(context, listen: false).initialScrollIndex = 0;

@ -2,6 +2,7 @@ import 'dart:io';
import 'dart:math';
import 'package:cwtch/config.dart';
import 'package:cwtch/cwtch_icons_icons.dart';
import 'package:cwtch/models/contact.dart';
import 'package:cwtch/models/filedownloadprogress.dart';
import 'package:cwtch/models/message.dart';
@ -131,6 +132,13 @@ class FileBubbleState extends State<FileBubble> {
// we don't preview a non downloaded file...
if (widget.isPreview && myFile != null) {
return getPreview(context);
} else if (widget.isPreview && myFile == null) {
return Row(
children: [
Icon(CwtchIcons.attached_file_2, size: 32, color: Provider.of<Settings>(context).theme.messageFromMeTextColor),
Flexible(child: Text(widget.nameSuggestion, style: TextStyle(color: Provider.of<Settings>(context).theme.messageFromMeTextColor)))
],
);
}
return LayoutBuilder(builder: (bcontext, constraints) {
@ -329,7 +337,7 @@ class FileBubbleState extends State<FileBubble> {
maxLines: 4,
textWidthBasis: TextWidthBasis.parent,
),
leading: Icon(Icons.attach_file, size: 32, color: Provider.of<Settings>(context).theme.messageFromMeTextColor));
leading: Icon(CwtchIcons.attached_file_2, size: 32, color: Provider.of<Settings>(context).theme.messageFromMeTextColor));
}
// Construct an file chrome
@ -377,7 +385,7 @@ class FileBubbleState extends State<FileBubble> {
maxLines: 4,
textWidthBasis: TextWidthBasis.parent,
),
leading: Icon(Icons.attach_file, size: 32, color: Provider.of<Settings>(context).theme.messageFromOtherTextColor),
leading: Icon(CwtchIcons.attached_file_2, size: 32, color: Provider.of<Settings>(context).theme.messageFromOtherTextColor),
trailing: Visibility(
visible: speed != "0 B/s",
child: SelectableText(

@ -125,16 +125,11 @@ class QuotedMessageBubbleState extends State<QuotedMessageBubble> {
height: 75,
child: Column(children: [
Align(alignment: Alignment.centerLeft, child: wdgReplyingTo),
Row(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [
Flexible(
child: Row(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [
Padding(padding: EdgeInsets.symmetric(vertical: 5.0, horizontal: 10.0), child: Icon(Icons.reply, size: 32, color: qTextColor)),
Flexible(
child: DefaultTextStyle(
textWidthBasis: TextWidthBasis.parent,
child: qMessage.getPreviewWidget(context),
style: TextStyle(color: qTextColor),
overflow: TextOverflow.fade,
))
])
Flexible(child: qMessage.getPreviewWidget(context)),
]))
]))));
} catch (e) {
return MalformedBubble();

Loading…
Cancel
Save