Fix Quoted Message Width
continuous-integration/drone/pr Build is pending
Details
continuous-integration/drone/pr Build is pending
Details
This commit is contained in:
parent
9efc3e3c4a
commit
ad9c974dbd
|
@ -65,8 +65,11 @@ class FileMessage extends Message {
|
||||||
return MalformedBubble();
|
return MalformedBubble();
|
||||||
}
|
}
|
||||||
return Container(
|
return Container(
|
||||||
alignment: Alignment.center,
|
padding: EdgeInsets.all(1.0),
|
||||||
height: 100,
|
decoration: BoxDecoration(),
|
||||||
|
clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||||
|
width: 100,
|
||||||
|
height: 50,
|
||||||
child: FileBubble(
|
child: FileBubble(
|
||||||
nameSuggestion,
|
nameSuggestion,
|
||||||
rootHash,
|
rootHash,
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
import 'package:cwtch/controllers/open_link_modal.dart';
|
|
||||||
import 'package:cwtch/models/contact.dart';
|
import 'package:cwtch/models/contact.dart';
|
||||||
import 'package:cwtch/models/message.dart';
|
import 'package:cwtch/models/message.dart';
|
||||||
import 'package:cwtch/models/profile.dart';
|
import 'package:cwtch/models/profile.dart';
|
||||||
import 'package:cwtch/third_party/linkify/flutter_linkify.dart';
|
|
||||||
import 'package:cwtch/widgets/malformedbubble.dart';
|
import 'package:cwtch/widgets/malformedbubble.dart';
|
||||||
import 'package:cwtch/widgets/messageloadingbubble.dart';
|
import 'package:cwtch/widgets/messageloadingbubble.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
@ -49,6 +46,7 @@ class QuotedMessageBubbleState extends State<QuotedMessageBubble> {
|
||||||
var formatMessages = Provider.of<Settings>(context).isExperimentEnabled(FormattingExperiment);
|
var formatMessages = Provider.of<Settings>(context).isExperimentEnabled(FormattingExperiment);
|
||||||
Size size = MediaQuery.of(context).size;
|
Size size = MediaQuery.of(context).size;
|
||||||
BoxConstraints constraints = BoxConstraints.loose(size);
|
BoxConstraints constraints = BoxConstraints.loose(size);
|
||||||
|
Widget wdgMessage = compileMessageContentWidget(context, constraints, fromMe, widget.body, _focus, formatMessages, showClickableLinks);
|
||||||
var wdgQuote = FutureBuilder(
|
var wdgQuote = FutureBuilder(
|
||||||
future: widget.quotedMessage,
|
future: widget.quotedMessage,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
|
@ -80,33 +78,34 @@ class QuotedMessageBubbleState extends State<QuotedMessageBubble> {
|
||||||
);
|
);
|
||||||
// Swap the background color for quoted tweets..
|
// Swap the background color for quoted tweets..
|
||||||
return MouseRegion(
|
return MouseRegion(
|
||||||
cursor: SystemMouseCursors.click,
|
cursor: SystemMouseCursors.click,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
var messageInfo = Provider.of<ContactInfoState>(context, listen: false).messageCache.getByContentHash(qMessage.getMetadata().contenthash);
|
var messageInfo = Provider.of<ContactInfoState>(context, listen: false).messageCache.getByContentHash(qMessage.getMetadata().contenthash);
|
||||||
if (messageInfo != null) {
|
if (messageInfo != null) {
|
||||||
var index = Provider.of<ContactInfoState>(context, listen: false).messageCache.findIndex(messageInfo.metadata.messageID);
|
var index = Provider.of<ContactInfoState>(context, listen: false).messageCache.findIndex(messageInfo.metadata.messageID);
|
||||||
if (index != null) {
|
if (index != null) {
|
||||||
Provider.of<ContactInfoState>(context, listen: false).messageScrollController.scrollTo(index: index, duration: Duration(milliseconds: 100));
|
Provider.of<ContactInfoState>(context, listen: false).messageScrollController.scrollTo(index: index, duration: Duration(milliseconds: 100));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.all(5),
|
margin: EdgeInsets.all(5),
|
||||||
padding: EdgeInsets.all(5),
|
padding: EdgeInsets.all(5),
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: fromMe ? Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor : Provider.of<Settings>(context).theme.messageFromMeBackgroundColor,
|
color: fromMe ? Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor : Provider.of<Settings>(context).theme.messageFromMeBackgroundColor,
|
||||||
),
|
),
|
||||||
height: 75,
|
height: 75,
|
||||||
child: Column(children: [
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [
|
||||||
Align(alignment: Alignment.centerLeft, child: wdgReplyingTo),
|
Align(alignment: Alignment.centerLeft, child: wdgReplyingTo),
|
||||||
Flexible(
|
Row(mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||||
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)),
|
||||||
Padding(padding: EdgeInsets.symmetric(vertical: 5.0, horizontal: 10.0), child: Icon(Icons.reply, size: 32, color: qTextColor)),
|
IntrinsicWidth(child: qMessage.getPreviewWidget(context)),
|
||||||
Flexible(child: qMessage.getPreviewWidget(context)),
|
])
|
||||||
]))
|
])),
|
||||||
]))));
|
),
|
||||||
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return MalformedBubble();
|
return MalformedBubble();
|
||||||
}
|
}
|
||||||
|
@ -120,8 +119,13 @@ class QuotedMessageBubbleState extends State<QuotedMessageBubble> {
|
||||||
var wdgDecorations = MessageBubbleDecoration(ackd: Provider.of<MessageMetadata>(context).ackd, errored: Provider.of<MessageMetadata>(context).error, fromMe: fromMe, messageDate: messageDate);
|
var wdgDecorations = MessageBubbleDecoration(ackd: Provider.of<MessageMetadata>(context).ackd, errored: Provider.of<MessageMetadata>(context).error, fromMe: fromMe, messageDate: messageDate);
|
||||||
|
|
||||||
var error = Provider.of<MessageMetadata>(context).error;
|
var error = Provider.of<MessageMetadata>(context).error;
|
||||||
|
var spacer = Container(
|
||||||
var wdgMessage = compileMessageContentWidget(context, constraints, fromMe, widget.body, _focus, formatMessages, showClickableLinks);
|
height: 75,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: fromMe ? Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor : Provider.of<Settings>(context).theme.messageFromMeBackgroundColor,
|
||||||
|
),
|
||||||
|
child: SizedBox(),
|
||||||
|
);
|
||||||
var wdgSender = compileSenderWidget(context, constraints, fromMe, senderDisplayStr);
|
var wdgSender = compileSenderWidget(context, constraints, fromMe, senderDisplayStr);
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
@ -150,10 +154,12 @@ class QuotedMessageBubbleState extends State<QuotedMessageBubble> {
|
||||||
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Provider.of<Settings>(context).theme.menuBackgroundColor)),
|
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Provider.of<Settings>(context).theme.menuBackgroundColor)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: IntrinsicWidth(
|
||||||
crossAxisAlignment: fromMe ? CrossAxisAlignment.end : CrossAxisAlignment.start,
|
child: Column(
|
||||||
mainAxisAlignment: fromMe ? MainAxisAlignment.end : MainAxisAlignment.start,
|
crossAxisAlignment: fromMe ? CrossAxisAlignment.end : CrossAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisAlignment: fromMe ? MainAxisAlignment.end : MainAxisAlignment.start,
|
||||||
children: fromMe ? [wdgQuote, wdgMessage, wdgDecorations] : [wdgSender, wdgQuote, wdgMessage, wdgDecorations]))));
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
verticalDirection: VerticalDirection.up,
|
||||||
|
children: fromMe ? [wdgDecorations, wdgMessage, wdgQuote] : [wdgDecorations, wdgMessage, wdgQuote, wdgSender])))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue