Update Tor Icons
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Sarah Jamie Lewis 2021-04-27 13:07:59 -07:00
parent dfe9467f0c
commit fb9322dad1
14 changed files with 185 additions and 42 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
assets/core/Tor_OFF.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

63
assets/core/Tor_OFF.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 575 B

After

Width:  |  Height:  |  Size: 919 B

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -97,13 +97,8 @@ class CwtchNotifier {
print("new group invite: $data");
// TODO Add Group Dynamically
dynamic groupInvite = jsonDecode(data["GroupInvite"]);
profileCN.getProfile(data["ProfileOnion"]).contactList.add(ContactInfoState(
onion: groupInvite["GroupID"],
isInvitation: true,
imagePath: data["PicturePath"],
nickname: groupInvite["GroupName"],
server: groupInvite["ServerHost"],
isGroup: true));
profileCN.getProfile(data["ProfileOnion"]).contactList.add(
ContactInfoState(onion: groupInvite["GroupID"], isInvitation: true, imagePath: data["PicturePath"], nickname: groupInvite["GroupName"], server: groupInvite["ServerHost"], isGroup: true));
break;
case "ServerStateChange":
print("server state change: $data");

View File

@ -36,9 +36,9 @@ class DiskAssetBundle extends CachingAssetBundle {
/// Creates a [DiskAssetBundle] by loading [globs] of assets under `assets/`.
static Future<AssetBundle> loadGlob(
Iterable<String> globs, {
String from = 'assets',
}) async {
Iterable<String> globs, {
String from = 'assets',
}) async {
final cache = <String, ByteData>{};
for (final pattern in globs) {
await for (final path in Glob(pattern).list(root: from)) {
@ -68,4 +68,4 @@ class DiskAssetBundle extends CachingAssetBundle {
Future<ByteData> load(String key) async {
return _cache[key];
}
}
}

View File

@ -83,7 +83,12 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
Visibility(
visible: Provider.of<ProfileInfoState>(context).onion.isNotEmpty,
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
ProfileImage(imagePath: Provider.of<ProfileInfoState>(context).imagePath, diameter: 120, maskOut: false, border: theme.theme.portraitOnlineBorderColor(),)
ProfileImage(
imagePath: Provider.of<ProfileInfoState>(context).imagePath,
diameter: 120,
maskOut: false,
border: theme.theme.portraitOnlineBorderColor(),
)
])),
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
CwtchLabel(label: AppLocalizations.of(context).displayNameLabel),

View File

@ -70,6 +70,6 @@ class _ContactsViewState extends State<ContactsView> {
}
void _debugFakeMessage() {
Provider.of<ProfileInfoState>(context, listen:false).contactList.getContact("44pknjvf4ju46nbuyn5getuayb6dj6z6zoppl56syn7pmscptoahlaid").unreadMessages++;
Provider.of<ProfileInfoState>(context, listen: false).contactList.getContact("44pknjvf4ju46nbuyn5getuayb6dj6z6zoppl56syn7pmscptoahlaid").unreadMessages++;
}
}

View File

@ -97,12 +97,12 @@ class _MessageViewState extends State<MessageView> {
child: Row(
children: <Widget>[
Expanded(
child: TextField(
key: Key('txtCompose'),
controller: ctrlrCompose,
focusNode: focusNode,
textInputAction: TextInputAction.send,
onSubmitted: _sendMessage,
child: TextField(
key: Key('txtCompose'),
controller: ctrlrCompose,
focusNode: focusNode,
textInputAction: TextInputAction.send,
onSubmitted: _sendMessage,
)),
SizedBox(
width: 90,

View File

@ -5,6 +5,7 @@ import 'package:flutter_app/settings.dart';
import 'package:flutter_app/torstatus.dart';
import 'package:flutter_app/views/torstatusview.dart';
import 'package:flutter_app/widgets/passwordfield.dart';
import 'package:flutter_app/widgets/tor_icon.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_app/widgets/profilerow.dart';
import 'package:provider/provider.dart';
@ -36,15 +37,7 @@ class _ProfileMgrViewState extends State<ProfileMgrView> {
appBar: AppBar(
title: Text(AppLocalizations.of(context).titleManageProfiles),
actions: [
IconButton(
icon: Image(
image: AssetImage(Provider.of<TorStatus>(context).progress == 100 ? "assets/core/Tor_icon.png" : "assets/core/Tor_icon_error.png"),
filterQuality: FilterQuality.low,
isAntiAlias: false,
color: Provider.of<Settings>(context).theme.mainTextColor(),
colorBlendMode: BlendMode.srcIn,
),
onPressed: _pushTorStatus),
IconButton(icon: TorIcon(), onPressed: _pushTorStatus),
IconButton(icon: Icon(Icons.bug_report_outlined), onPressed: _setLoggingLevelDebug),
IconButton(
icon: Icon(Icons.lock_open),

View File

@ -3,6 +3,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_app/settings.dart';
import 'package:flutter_app/torstatus.dart';
import 'package:flutter_app/widgets/tor_icon.dart';
import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
@ -44,14 +45,7 @@ class _TorStatusView extends State<TorStatusView> {
),
child: Column(children: [
ListTile(
leading: Image(
image: AssetImage(torStatus.progress == 100 ? "assets/core/Tor_icon.png" : "assets/core/Tor_icon_error.png"),
filterQuality: FilterQuality.low,
isAntiAlias: false,
// Color the onion per the text color...
color: Provider.of<Settings>(context).theme.mainTextColor(),
colorBlendMode: BlendMode.srcIn,
),
leading: TorIcon(),
title: Text("Tor Status"),
subtitle: Text(torStatus.progress == 100 ? AppLocalizations.of(context).networkStatusOnline : torStatus.status),
trailing: ElevatedButton(

30
lib/widgets/tor_icon.dart Normal file
View File

@ -0,0 +1,30 @@
import 'package:flutter/cupertino.dart';
import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import '../settings.dart';
import '../torstatus.dart';
/// A reusable Tor Icon Widget that displays the current status of the underlying Tor connections
class TorIcon extends StatefulWidget {
TorIcon();
@override
State<StatefulWidget> createState() => _TorIconState();
}
class _TorIconState extends State<TorIcon> {
@override
Widget build(BuildContext context) {
return Image(
image: AssetImage(Provider.of<TorStatus>(context).progress == 0
? "assets/core/Tor_OFF.png"
: (Provider.of<TorStatus>(context).progress == 100 ? "assets/core/Tor_icon.png" : "assets/core/Tor_Booting_up.png")),
// Color the onion per the text color...
color: Provider.of<Settings>(context).theme.mainTextColor(),
colorBlendMode: BlendMode.srcIn,
semanticLabel: Provider.of<TorStatus>(context).progress == 100
? AppLocalizations.of(context).networkStatusOnline
: (Provider.of<TorStatus>(context).progress == 0 ? AppLocalizations.of(context).networkStatusDisconnected : AppLocalizations.of(context).networkStatusAttemptingTor),
);
}
}