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,
inlineSpan: LinkableSpan(
mouseCursor: SystemMouseCursors.click,
inlineSpan: TextSpan(
text: element.text,
style: linkStyle,
recognizer: onOpen != null ? (TapGestureRecognizer()..onTap = () => onOpen(element)) : null,
semanticsLabel: element.text
),
inlineSpan: TextSpan(text: element.text, style: linkStyle, recognizer: onOpen != null ? (TapGestureRecognizer()..onTap = () => onOpen(element)) : null, semanticsLabel: element.text),
));
} else {
return TooltipSpan(
@ -376,56 +371,41 @@ TextSpan buildTextSpan(
));
}
} else if (element is BoldElement) {
return TextSpan(
text: element.text.replaceAll("*", ""),
style: style?.copyWith(fontWeight: FontWeight.bold),
semanticsLabel: element.text
);
return TextSpan(text: element.text.replaceAll("*", ""), style: style?.copyWith(fontWeight: FontWeight.bold), semanticsLabel: element.text);
} else if (element is ItalicElement) {
return TextSpan(
text: element.text.replaceAll("*", ""),
style: style?.copyWith(fontStyle: FontStyle.italic),
semanticsLabel: element.text
);
return TextSpan(text: element.text.replaceAll("*", ""), style: style?.copyWith(fontStyle: FontStyle.italic), semanticsLabel: element.text);
} else if (element is SuperElement) {
return WidgetSpan(
child: Transform.translate(
offset: const Offset(2, -6),
child: Text(
element.text.replaceAll("^", ""),
child: Text(element.text.replaceAll("^", ""),
//superscript is usually smaller in size
textScaleFactor: 0.7,
style: style,
semanticsLabel: element.text
),
semanticsLabel: element.text),
));
} else if (element is SubElement) {
return WidgetSpan(
child: Transform.translate(
offset: const Offset(2, 4),
child: Text(
element.text.replaceAll("_", ""),
child: Text(element.text.replaceAll("_", ""),
//superscript is usually smaller in size
textScaleFactor: 0.7,
style: style,
semanticsLabel: element.text
),
semanticsLabel: element.text),
));
} else if (element is StrikeElement) {
return TextSpan(
text: element.text.replaceAll("~~", ""),
style: style?.copyWith(decoration: TextDecoration.lineThrough, decorationColor: style.color, decorationStyle: TextDecorationStyle.solid),
semanticsLabel: element.text
);
semanticsLabel: element.text);
} else if (element is CodeElement) {
return TextSpan(
text: element.text.replaceAll("\`", ""),
// monospace fonts at the same size as regular text makes them appear
// slightly larger, so we compensate by making them slightly smaller...
style: style?.copyWith(fontFamily: "RobotoMono", fontSize: style.fontSize!-1.0),
semanticsLabel: element.text
);
style: style?.copyWith(fontFamily: "RobotoMono", fontSize: style.fontSize! - 1.0),
semanticsLabel: element.text);
} else {
return TextSpan(
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
// SOFTWARE.
import 'package:cwtch/config.dart';
import 'linkify.dart';
final _urlRegex = RegExp(
@ -209,7 +211,9 @@ class UrlLinkifier extends Linkifier {
// we can jump straight to message formatting...
list.addAll(parseFormatting(element, options));
} 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);
if (Provider.of<Settings>(context, listen: false).uiColumns(isLandscape).length == 1) _pushMessageView(context, handle);
// 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) {

View File

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