From 89540ec7ef16a85063c85337af2f192165ae024c Mon Sep 17 00:00:00 2001 From: krille-chan Date: Tue, 26 Dec 2023 14:02:07 +0100 Subject: [PATCH] fix: Darktheme contrast fixes with primary color --- lib/pages/bootstrap/bootstrap_dialog.dart | 2 +- lib/pages/chat/events/message.dart | 6 +++--- lib/pages/chat/events/message_reactions.dart | 2 +- lib/pages/chat/reply_display.dart | 2 +- lib/pages/chat_details/chat_details_view.dart | 3 ++- lib/pages/chat_list/chat_list_item.dart | 2 +- .../chat_permissions_settings_view.dart | 4 ++-- lib/pages/key_verification/key_verification_dialog.dart | 6 ++++-- lib/pages/new_private_chat/qr_scanner_modal.dart | 2 +- 9 files changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/pages/bootstrap/bootstrap_dialog.dart b/lib/pages/bootstrap/bootstrap_dialog.dart index dc8d07c5..5a635631 100644 --- a/lib/pages/bootstrap/bootstrap_dialog.dart +++ b/lib/pages/bootstrap/bootstrap_dialog.dart @@ -273,7 +273,7 @@ class BootstrapDialogState extends State { style: ElevatedButton.styleFrom( foregroundColor: Theme.of(context).colorScheme.onPrimary, - backgroundColor: Theme.of(context).primaryColor, + backgroundColor: Theme.of(context).colorScheme.primary, ), icon: _recoveryKeyInputLoading ? const CircularProgressIndicator.adaptive() diff --git a/lib/pages/chat/events/message.dart b/lib/pages/chat/events/message.dart index 12560eee..105392d3 100644 --- a/lib/pages/chat/events/message.dart +++ b/lib/pages/chat/events/message.dart @@ -391,8 +391,8 @@ class Message extends StatelessWidget { children: [ Container( color: selected - ? Theme.of(context).primaryColor.withAlpha(100) - : Theme.of(context).primaryColor.withAlpha(0), + ? Theme.of(context).colorScheme.primary.withAlpha(100) + : Colors.transparent, constraints: const BoxConstraints( maxWidth: FluffyThemes.columnWidth * 2.5, ), @@ -410,7 +410,7 @@ class Message extends StatelessWidget { child: Material( color: Theme.of(context) .colorScheme - .background + .surfaceVariant .withOpacity(0.9), elevation: Theme.of(context) .appBarTheme diff --git a/lib/pages/chat/events/message_reactions.dart b/lib/pages/chat/events/message_reactions.dart index 7e731c93..755f8992 100644 --- a/lib/pages/chat/events/message_reactions.dart +++ b/lib/pages/chat/events/message_reactions.dart @@ -154,7 +154,7 @@ class _Reaction extends StatelessWidget { border: reacted! ? Border.all( width: 1, - color: Theme.of(context).primaryColor, + color: Theme.of(context).colorScheme.primary, ) : null, borderRadius: BorderRadius.circular(AppConfig.borderRadius), diff --git a/lib/pages/chat/reply_display.dart b/lib/pages/chat/reply_display.dart index 32bec7c2..3bb638ab 100644 --- a/lib/pages/chat/reply_display.dart +++ b/lib/pages/chat/reply_display.dart @@ -64,7 +64,7 @@ class _EditContent extends StatelessWidget { children: [ Icon( Icons.edit, - color: Theme.of(context).primaryColor, + color: Theme.of(context).colorScheme.primary, ), Container(width: 15.0), FutureBuilder( diff --git a/lib/pages/chat_details/chat_details_view.dart b/lib/pages/chat_details/chat_details_view.dart index f7de39ce..f15da4fc 100644 --- a/lib/pages/chat_details/chat_details_view.dart +++ b/lib/pages/chat_details/chat_details_view.dart @@ -399,7 +399,8 @@ class ChatDetailsView extends StatelessWidget { ListTile( title: Text(L10n.of(context)!.inviteContact), leading: CircleAvatar( - backgroundColor: Theme.of(context).primaryColor, + backgroundColor: + Theme.of(context).colorScheme.primary, foregroundColor: Colors.white, radius: Avatar.defaultSize / 2, child: const Icon(Icons.add_outlined), diff --git a/lib/pages/chat_list/chat_list_item.dart b/lib/pages/chat_list/chat_list_item.dart index a7b93025..3fac2583 100644 --- a/lib/pages/chat_list/chat_list_item.dart +++ b/lib/pages/chat_list/chat_list_item.dart @@ -186,7 +186,7 @@ class ChatListItem extends StatelessWidget { width: Avatar.defaultSize, height: Avatar.defaultSize, child: Material( - color: Theme.of(context).primaryColor, + color: Theme.of(context).colorScheme.primary, borderRadius: BorderRadius.circular(Avatar.defaultSize), child: const Icon(Icons.check, color: Colors.white), ), diff --git a/lib/pages/chat_permissions_settings/chat_permissions_settings_view.dart b/lib/pages/chat_permissions_settings/chat_permissions_settings_view.dart index 072e2040..e8c34e26 100644 --- a/lib/pages/chat_permissions_settings/chat_permissions_settings_view.dart +++ b/lib/pages/chat_permissions_settings/chat_permissions_settings_view.dart @@ -59,7 +59,7 @@ class ChatPermissionsSettingsView extends StatelessWidget { title: Text( L10n.of(context)!.notifications, style: TextStyle( - color: Theme.of(context).primaryColor, + color: Theme.of(context).colorScheme.primary, fontWeight: FontWeight.bold, ), ), @@ -89,7 +89,7 @@ class ChatPermissionsSettingsView extends StatelessWidget { title: Text( L10n.of(context)!.configureChat, style: TextStyle( - color: Theme.of(context).primaryColor, + color: Theme.of(context).colorScheme.primary, fontWeight: FontWeight.bold, ), ), diff --git a/lib/pages/key_verification/key_verification_dialog.dart b/lib/pages/key_verification/key_verification_dialog.dart index 41782596..69f3a1ab 100644 --- a/lib/pages/key_verification/key_verification_dialog.dart +++ b/lib/pages/key_verification/key_verification_dialog.dart @@ -139,8 +139,10 @@ class KeyVerificationPageState extends State { obscureText: true, decoration: InputDecoration( hintText: L10n.of(context)!.passphraseOrKey, - prefixStyle: TextStyle(color: Theme.of(context).primaryColor), - suffixStyle: TextStyle(color: Theme.of(context).primaryColor), + prefixStyle: + TextStyle(color: Theme.of(context).colorScheme.primary), + suffixStyle: + TextStyle(color: Theme.of(context).colorScheme.primary), border: const OutlineInputBorder(), ), ), diff --git a/lib/pages/new_private_chat/qr_scanner_modal.dart b/lib/pages/new_private_chat/qr_scanner_modal.dart index b509941e..fbc1d5e4 100644 --- a/lib/pages/new_private_chat/qr_scanner_modal.dart +++ b/lib/pages/new_private_chat/qr_scanner_modal.dart @@ -45,7 +45,7 @@ class QrScannerModalState extends State { key: qrKey, onQRViewCreated: _onQRViewCreated, overlay: QrScannerOverlayShape( - borderColor: Theme.of(context).primaryColor, + borderColor: Theme.of(context).colorScheme.primary, borderRadius: 10, borderLength: 30, borderWidth: 8,