Icon and Log Error
continuous-integration/drone/pr Build is pending Details

This commit is contained in:
Sarah Jamie Lewis 2022-04-06 14:54:53 -07:00
parent a4a2af08b4
commit 0b9c159e85
4 changed files with 30 additions and 44 deletions

View File

@ -359,12 +359,7 @@ TextSpan buildTextSpan(
message: element.url, message: element.url,
inlineSpan: LinkableSpan( inlineSpan: LinkableSpan(
mouseCursor: SystemMouseCursors.click, mouseCursor: SystemMouseCursors.click,
inlineSpan: TextSpan( inlineSpan: TextSpan(text: element.text, style: linkStyle, recognizer: onOpen != null ? (TapGestureRecognizer()..onTap = () => onOpen(element)) : null, semanticsLabel: element.text),
text: element.text,
style: linkStyle,
recognizer: onOpen != null ? (TapGestureRecognizer()..onTap = () => onOpen(element)) : null,
semanticsLabel: element.text
),
)); ));
} else { } else {
return TooltipSpan( return TooltipSpan(
@ -376,56 +371,41 @@ TextSpan buildTextSpan(
)); ));
} }
} else if (element is BoldElement) { } else if (element is BoldElement) {
return TextSpan( return TextSpan(text: element.text.replaceAll("*", ""), style: style?.copyWith(fontWeight: FontWeight.bold), semanticsLabel: element.text);
text: element.text.replaceAll("*", ""),
style: style?.copyWith(fontWeight: FontWeight.bold),
semanticsLabel: element.text
);
} else if (element is ItalicElement) { } else if (element is ItalicElement) {
return TextSpan( return TextSpan(text: element.text.replaceAll("*", ""), style: style?.copyWith(fontStyle: FontStyle.italic), semanticsLabel: element.text);
text: element.text.replaceAll("*", ""),
style: style?.copyWith(fontStyle: FontStyle.italic),
semanticsLabel: element.text
);
} else if (element is SuperElement) { } else if (element is SuperElement) {
return WidgetSpan( return WidgetSpan(
child: Transform.translate( child: Transform.translate(
offset: const Offset(2, -6), offset: const Offset(2, -6),
child: Text( child: Text(element.text.replaceAll("^", ""),
element.text.replaceAll("^", ""), //superscript is usually smaller in size
//superscript is usually smaller in size textScaleFactor: 0.7,
textScaleFactor: 0.7, style: style,
style: style, semanticsLabel: element.text),
semanticsLabel: element.text
),
)); ));
} else if (element is SubElement) { } else if (element is SubElement) {
return WidgetSpan( return WidgetSpan(
child: Transform.translate( child: Transform.translate(
offset: const Offset(2, 4), offset: const Offset(2, 4),
child: Text( child: Text(element.text.replaceAll("_", ""),
element.text.replaceAll("_", ""), //superscript is usually smaller in size
//superscript is usually smaller in size textScaleFactor: 0.7,
textScaleFactor: 0.7, style: style,
style: style, semanticsLabel: element.text),
semanticsLabel: element.text
),
)); ));
} else if (element is StrikeElement) { } else if (element is StrikeElement) {
return TextSpan( return TextSpan(
text: element.text.replaceAll("~~", ""), text: element.text.replaceAll("~~", ""),
style: style?.copyWith(decoration: TextDecoration.lineThrough, decorationColor: style.color, decorationStyle: TextDecorationStyle.solid), style: style?.copyWith(decoration: TextDecoration.lineThrough, decorationColor: style.color, decorationStyle: TextDecorationStyle.solid),
semanticsLabel: element.text semanticsLabel: element.text);
);
} else if (element is CodeElement) { } else if (element is CodeElement) {
return TextSpan( return TextSpan(
text: element.text.replaceAll("\`", ""), text: element.text.replaceAll("\`", ""),
// monospace fonts at the same size as regular text makes them appear // monospace fonts at the same size as regular text makes them appear
// slightly larger, so we compensate by making them slightly smaller... // slightly larger, so we compensate by making them slightly smaller...
style: style?.copyWith(fontFamily: "RobotoMono", fontSize: style.fontSize!-1.0), style: style?.copyWith(fontFamily: "RobotoMono", fontSize: style.fontSize! - 1.0),
semanticsLabel: element.text semanticsLabel: element.text);
);
} else { } else {
return TextSpan( return TextSpan(
text: element.text, text: element.text,

View File

@ -25,6 +25,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
import 'package:cwtch/config.dart';
import 'linkify.dart'; import 'linkify.dart';
final _urlRegex = RegExp( final _urlRegex = RegExp(
@ -209,7 +211,9 @@ class UrlLinkifier extends Linkifier {
// we can jump straight to message formatting... // we can jump straight to message formatting...
list.addAll(parseFormatting(element, options)); list.addAll(parseFormatting(element, options));
} else { } else {
// unreachable // unreachable - if we get here then there is something wrong in the above logic since every combination of
// formatting options should have already been accounted for.
EnvironmentConfig.debugLog("'unreachable' code path in formatting has been triggered. this is very likely a bug - please report $options");
} }
} }
}); });

View File

@ -40,7 +40,9 @@ void selectConversation(BuildContext context, int handle) {
var isLandscape = Provider.of<AppState>(context, listen: false).isLandscape(context); var isLandscape = Provider.of<AppState>(context, listen: false).isLandscape(context);
if (Provider.of<Settings>(context, listen: false).uiColumns(isLandscape).length == 1) _pushMessageView(context, handle); if (Provider.of<Settings>(context, listen: false).uiColumns(isLandscape).length == 1) _pushMessageView(context, handle);
// Set last message seen time in backend // Set last message seen time in backend
Provider.of<FlwtchState>(context, listen: false).cwtch.SetConversationAttribute(Provider.of<ProfileInfoState>(context, listen: false).onion, handle, LastMessageSeenTimeKey, DateTime.now().toUtc().toIso8601String()); Provider.of<FlwtchState>(context, listen: false)
.cwtch
.SetConversationAttribute(Provider.of<ProfileInfoState>(context, listen: false).onion, handle, LastMessageSeenTimeKey, DateTime.now().toUtc().toIso8601String());
} }
void _pushMessageView(BuildContext context, int handle) { void _pushMessageView(BuildContext context, int handle) {

View File

@ -384,7 +384,7 @@ class _GlobalSettingsViewState extends State<GlobalSettingsView> {
}, },
activeTrackColor: settings.theme.defaultButtonActiveColor, activeTrackColor: settings.theme.defaultButtonActiveColor,
inactiveTrackColor: settings.theme.defaultButtonDisabledColor, inactiveTrackColor: settings.theme.defaultButtonDisabledColor,
secondary: Icon(Icons.link, color: settings.current().mainTextColor), secondary: Icon(Icons.text_fields, color: settings.current().mainTextColor),
)), )),
AboutListTile( AboutListTile(
icon: appIcon, icon: appIcon,