From 4e2f83ccd981828ed83d022b7bc5c8070f7aac53 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Thu, 14 Apr 2022 17:50:53 -0700 Subject: [PATCH] light theme fixes + message cache ! fix --- lib/models/messagecache.dart | 2 +- lib/views/contactsview.dart | 2 +- lib/views/groupsettingsview.dart | 2 +- lib/views/peersettingsview.dart | 2 +- lib/views/profilemgrview.dart | 1 + lib/views/serversview.dart | 1 + 6 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/models/messagecache.dart b/lib/models/messagecache.dart index fbcfb60d..1ad2ec59 100644 --- a/lib/models/messagecache.dart +++ b/lib/models/messagecache.dart @@ -165,7 +165,7 @@ class MessageCache extends ChangeNotifier { int size() { // very naive cache size, assuming MessageInfo are fairly large on average // and everything else is small in comparison - int cacheSize = cache.entries.map((e) => e.value.size()).fold(0, (previousValue, element) => previousValue! + element); + int cacheSize = cache.entries.map((e) => e.value.size()).fold(0, (previousValue, element) => previousValue + element); return cacheSize + cacheByHash.length * 64 + cacheByIndex.length * 16; } } diff --git a/lib/views/contactsview.dart b/lib/views/contactsview.dart index 4109f39f..4b36eca8 100644 --- a/lib/views/contactsview.dart +++ b/lib/views/contactsview.dart @@ -130,7 +130,7 @@ class _ContactsViewState extends State { floatingActionButton: FloatingActionButton( onPressed: _modalAddImportChoice, tooltip: AppLocalizations.of(context)!.tooltipAddContact, - child: const Icon(CwtchIcons.person_add_alt_1_24px), + child: Icon(CwtchIcons.person_add_alt_1_24px, color: Provider.of(context).theme.defaultButtonTextColor,), ), body: showSearchBar || Provider.of(context).isFiltered ? _buildFilterable() : _buildContactList()); } diff --git a/lib/views/groupsettingsview.dart b/lib/views/groupsettingsview.dart index 2962bd4d..21f92fb6 100644 --- a/lib/views/groupsettingsview.dart +++ b/lib/views/groupsettingsview.dart @@ -183,7 +183,7 @@ class _GroupSettingsViewState extends State { onPressed: () { showAlertDialog(context); }, - style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.transparent)), + style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Provider.of(context).theme.backgroundPaneColor), foregroundColor: MaterialStateProperty.all(Provider.of(context).theme.mainTextColor)), icon: Icon(CwtchIcons.leave_group), label: Text( AppLocalizations.of(context)!.leaveConversation, diff --git a/lib/views/peersettingsview.dart b/lib/views/peersettingsview.dart index 9486a98a..f391f82b 100644 --- a/lib/views/peersettingsview.dart +++ b/lib/views/peersettingsview.dart @@ -269,7 +269,7 @@ class _PeerSettingsViewState extends State { onPressed: () { showAlertDialog(context); }, - style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.transparent)), + style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Provider.of(context).theme.backgroundPaneColor), foregroundColor: MaterialStateProperty.all(Provider.of(context).theme.mainTextColor)), icon: Icon(CwtchIcons.leave_group), label: Text( AppLocalizations.of(context)!.leaveConversation, diff --git a/lib/views/profilemgrview.dart b/lib/views/profilemgrview.dart index 829ba74e..1d48ff0c 100644 --- a/lib/views/profilemgrview.dart +++ b/lib/views/profilemgrview.dart @@ -75,6 +75,7 @@ class _ProfileMgrViewState extends State { child: Icon( Icons.add, semanticLabel: AppLocalizations.of(context)!.addNewProfileBtn, + color: Provider.of(context).theme.defaultButtonTextColor, ), ), body: _buildProfileManager(), diff --git a/lib/views/serversview.dart b/lib/views/serversview.dart index d413f2b2..cb7608e6 100644 --- a/lib/views/serversview.dart +++ b/lib/views/serversview.dart @@ -41,6 +41,7 @@ class _ServersView extends State { child: Icon( Icons.add, semanticLabel: AppLocalizations.of(context)!.addServerTooltip, + color: Provider.of(context).theme.defaultButtonTextColor, ), ), body: Consumer(