forked from cwtch.im/cwtch-ui
quote message color fixes; disable swipe reply on desktop; message view alert color fix; card theme fix
This commit is contained in:
parent
464edf9aed
commit
cddf204695
|
@ -1,10 +1,12 @@
|
||||||
import 'package:cwtch/models/message.dart';
|
import 'package:cwtch/models/message.dart';
|
||||||
import 'package:cwtch/widgets/messagebubble.dart';
|
import 'package:cwtch/widgets/messagebubble.dart';
|
||||||
import 'package:cwtch/widgets/messagerow.dart';
|
import 'package:cwtch/widgets/messagerow.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../../model.dart';
|
import '../../model.dart';
|
||||||
|
import '../../settings.dart';
|
||||||
|
|
||||||
class TextMessage extends Message {
|
class TextMessage extends Message {
|
||||||
final MessageMetadata metadata;
|
final MessageMetadata metadata;
|
||||||
|
|
|
@ -23,10 +23,11 @@ class _ContactRowState extends State<ContactRow> {
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
color: Provider.of<AppState>(context).selectedConversation == contact.onion ? Provider.of<Settings>(context).theme.backgroundHilightElementColor() : null,
|
color: Provider.of<AppState>(context).selectedConversation == contact.onion ? Provider.of<Settings>(context).theme.backgroundHilightElementColor() : null,
|
||||||
borderOnForeground: false,
|
borderOnForeground: false,
|
||||||
|
margin: EdgeInsets.all(0.0),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(2.0), //border size
|
padding: const EdgeInsets.all(6.0), //border size
|
||||||
child: ProfileImage(
|
child: ProfileImage(
|
||||||
badgeCount: contact.unreadMessages,
|
badgeCount: contact.unreadMessages,
|
||||||
badgeColor: Provider.of<Settings>(context).theme.portraitContactBadgeColor(),
|
badgeColor: Provider.of<Settings>(context).theme.portraitContactBadgeColor(),
|
||||||
|
|
|
@ -41,7 +41,9 @@ class _MessageListState extends State<MessageList> {
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.all(5.0),
|
padding: EdgeInsets.all(5.0),
|
||||||
color: Provider.of<Settings>(context).theme.defaultButtonActiveColor(),
|
color: Provider.of<Settings>(context).theme.defaultButtonActiveColor(),
|
||||||
child: showSyncing
|
child: DefaultTextStyle(
|
||||||
|
style: TextStyle(color: Provider.of<Settings>(context).theme.defaultButtonTextColor()),
|
||||||
|
child: showSyncing
|
||||||
? Text(AppLocalizations.of(context)!.serverNotSynced, textAlign: TextAlign.center)
|
? Text(AppLocalizations.of(context)!.serverNotSynced, textAlign: TextAlign.center)
|
||||||
: showOfflineWarning
|
: showOfflineWarning
|
||||||
? Text(Provider.of<ContactInfoState>(context).isGroup ? AppLocalizations.of(context)!.serverConnectivityDisconnected : AppLocalizations.of(context)!.peerOfflineMessage,
|
? Text(Provider.of<ContactInfoState>(context).isGroup ? AppLocalizations.of(context)!.serverConnectivityDisconnected : AppLocalizations.of(context)!.peerOfflineMessage,
|
||||||
|
@ -52,7 +54,7 @@ class _MessageListState extends State<MessageList> {
|
||||||
:
|
:
|
||||||
// We are not allowed to put null here, so put an empty text widge
|
// We are not allowed to put null here, so put an empty text widge
|
||||||
Text("")),
|
Text("")),
|
||||||
)),
|
))),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Scrollbar(
|
child: Scrollbar(
|
||||||
controller: ctrlr1,
|
controller: ctrlr1,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:cwtch/cwtch_icons_icons.dart';
|
import 'package:cwtch/cwtch_icons_icons.dart';
|
||||||
import 'package:cwtch/models/message.dart';
|
import 'package:cwtch/models/message.dart';
|
||||||
|
@ -144,10 +145,10 @@ class MessageRowState extends State<MessageRow> {
|
||||||
},
|
},
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
|
|
||||||
// Swipe to quote
|
// Swipe to quote on Android
|
||||||
onHorizontalDragEnd: (details) {
|
onHorizontalDragEnd: Platform.isAndroid ? (details) {
|
||||||
Provider.of<AppState>(context, listen: false).selectedIndex = Provider.of<MessageMetadata>(context, listen: false).messageIndex;
|
Provider.of<AppState>(context, listen: false).selectedIndex = Provider.of<MessageMetadata>(context, listen: false).messageIndex;
|
||||||
},
|
} : null,
|
||||||
child: Padding(padding: EdgeInsets.all(2), child: Row(mainAxisAlignment: fromMe ? MainAxisAlignment.end : MainAxisAlignment.start, children: widgetRow))));
|
child: Padding(padding: EdgeInsets.all(2), child: Row(mainAxisAlignment: fromMe ? MainAxisAlignment.end : MainAxisAlignment.start, children: widgetRow))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,12 +22,13 @@ class _ProfileRowState extends State<ProfileRow> {
|
||||||
var profile = Provider.of<ProfileInfoState>(context);
|
var profile = Provider.of<ProfileInfoState>(context);
|
||||||
return Card(
|
return Card(
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
|
margin: EdgeInsets.all(0.0),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(2.0), //border size
|
padding: const EdgeInsets.all(6.0), //border size
|
||||||
child: ProfileImage(
|
child: ProfileImage(
|
||||||
badgeCount: 0,
|
badgeCount: 0,
|
||||||
badgeColor: Provider.of<Settings>(context).theme.portraitProfileBadgeColor(),
|
badgeColor: Provider.of<Settings>(context).theme.portraitProfileBadgeColor(),
|
||||||
|
|
|
@ -54,6 +54,7 @@ class QuotedMessageBubbleState extends State<QuotedMessageBubble> {
|
||||||
textWidthBasis: TextWidthBasis.longestLine,
|
textWidthBasis: TextWidthBasis.longestLine,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
var wdgQuote = FutureBuilder(
|
var wdgQuote = FutureBuilder(
|
||||||
future: widget.quotedMessage,
|
future: widget.quotedMessage,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
|
@ -61,13 +62,14 @@ class QuotedMessageBubbleState extends State<QuotedMessageBubble> {
|
||||||
try {
|
try {
|
||||||
var qMessage = (snapshot.data! as Message);
|
var qMessage = (snapshot.data! as Message);
|
||||||
// Swap the background color for quoted tweets..
|
// Swap the background color for quoted tweets..
|
||||||
|
var qTextColor = fromMe ? Provider.of<Settings>(context).theme.messageFromOtherTextColor() : Provider.of<Settings>(context).theme.messageFromMeTextColor();
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.all(5),
|
margin: EdgeInsets.all(5),
|
||||||
padding: EdgeInsets.all(5),
|
padding: EdgeInsets.all(5),
|
||||||
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(),
|
||||||
child: Wrap(runAlignment: WrapAlignment.spaceEvenly, alignment: WrapAlignment.spaceEvenly, runSpacing: 1.0, crossAxisAlignment: WrapCrossAlignment.center, children: [
|
child: Wrap(runAlignment: WrapAlignment.spaceEvenly, alignment: WrapAlignment.spaceEvenly, runSpacing: 1.0, crossAxisAlignment: WrapCrossAlignment.center, children: [
|
||||||
Center(widthFactor: 1, child: Padding(padding: EdgeInsets.all(10.0), child: Icon(Icons.reply, size: 32))),
|
Center(widthFactor: 1, child: Padding(padding: EdgeInsets.all(10.0), child: Icon(Icons.reply, size: 32, color: qTextColor))),
|
||||||
Center(widthFactor: 1.0, child: qMessage.getPreviewWidget(context))
|
Center(widthFactor: 1.0, child: DefaultTextStyle( child: qMessage.getPreviewWidget(context), style: TextStyle( color: qTextColor)))
|
||||||
]));
|
]));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
|
|
Loading…
Reference in New Issue