diff --git a/lib/main.dart b/lib/main.dart index 6fd9eebc..fac0c74e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -116,13 +116,13 @@ class FlwtchState extends State { // the MyBroadcastReceiver method channel Future modalShutdown(MethodCall mc) async { // set up the buttons - Widget cancelButton = TextButton( + Widget cancelButton = ElevatedButton( child: Text(AppLocalizations.of(navKey.currentContext!)!.cancel), onPressed: () { Navigator.of(navKey.currentContext!).pop(); // dismiss dialog }, ); - Widget continueButton = TextButton( + Widget continueButton = ElevatedButton( child: Text(AppLocalizations.of(navKey.currentContext!)!.shutdownCwtchAction), onPressed: () { // Directly call the shutdown command, Android will do this for us... diff --git a/lib/opaque.dart b/lib/opaque.dart index c728f2e6..882aecac 100644 --- a/lib/opaque.dart +++ b/lib/opaque.dart @@ -374,7 +374,7 @@ class OpaqueDark extends OpaqueThemeType { } Color defaultButtonDisabledColor() { - return deepPurple; + return lightGrey; } Color defaultButtonDisabledTextColor() { @@ -684,7 +684,7 @@ class OpaqueLight extends OpaqueThemeType { } Color defaultButtonDisabledColor() { - return purple; + return lightGrey; } Color defaultButtonDisabledTextColor() { @@ -969,9 +969,15 @@ ThemeData mkThemeData(Settings opaque) { ), elevatedButtonTheme: ElevatedButtonThemeData( style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(opaque.current().defaultButtonColor()), + backgroundColor: MaterialStateProperty.resolveWith((states) => states.contains(MaterialState.disabled) ? opaque.current().defaultButtonDisabledColor() : opaque.current().defaultButtonColor()), foregroundColor: MaterialStateProperty.all(opaque.current().defaultButtonTextColor()), - overlayColor: MaterialStateProperty.all(opaque.current().defaultButtonActiveColor()), + overlayColor: MaterialStateProperty.resolveWith((states) => (states.contains(MaterialState.pressed) && states.contains(MaterialState.hovered)) + ? opaque.current().defaultButtonActiveColor() + : states.contains(MaterialState.disabled) + ? opaque.current().defaultButtonDisabledColor() + : null), + enableFeedback: true, + splashFactory: InkRipple.splashFactory, padding: MaterialStateProperty.all(EdgeInsets.all(20)), shape: MaterialStateProperty.all(RoundedRectangleBorder( borderRadius: BorderRadius.circular(18.0), @@ -1004,7 +1010,11 @@ ThemeData mkThemeData(Settings opaque) { thumbColor: MaterialStateProperty.all(opaque.current().mainTextColor()), trackColor: MaterialStateProperty.all(opaque.current().dropShadowColor()), ), - floatingActionButtonTheme: FloatingActionButtonThemeData(backgroundColor: opaque.current().defaultButtonColor(), hoverColor: opaque.current().defaultButtonActiveColor()), + floatingActionButtonTheme: FloatingActionButtonThemeData( + backgroundColor: opaque.current().defaultButtonColor(), + hoverColor: opaque.current().defaultButtonActiveColor(), + enableFeedback: true, + splashColor: opaque.current().defaultButtonActiveColor()), textSelectionTheme: TextSelectionThemeData( cursorColor: opaque.current().defaultButtonActiveColor(), selectionColor: opaque.current().defaultButtonActiveColor(), selectionHandleColor: opaque.current().defaultButtonActiveColor()), ); diff --git a/lib/views/addeditprofileview.dart b/lib/views/addeditprofileview.dart index c75d68b6..97ebe133 100644 --- a/lib/views/addeditprofileview.dart +++ b/lib/views/addeditprofileview.dart @@ -263,7 +263,6 @@ class _AddEditProfileViewState extends State { onPressed: () { showAlertDialog(context); }, - style: ElevatedButton.styleFrom(primary: theme.current().defaultButtonColor()), icon: Icon(Icons.delete_forever), label: Text(AppLocalizations.of(context)!.deleteBtn), )) @@ -330,13 +329,13 @@ class _AddEditProfileViewState extends State { showAlertDialog(BuildContext context) { // set up the buttons - Widget cancelButton = TextButton( + Widget cancelButton = ElevatedButton( child: Text(AppLocalizations.of(context)!.cancel), onPressed: () { Navigator.of(context).pop(); // dismiss dialog }, ); - Widget continueButton = TextButton( + Widget continueButton = ElevatedButton( child: Text(AppLocalizations.of(context)!.deleteProfileConfirmBtn), onPressed: () { var onion = Provider.of(context, listen: false).onion; diff --git a/lib/views/groupsettingsview.dart b/lib/views/groupsettingsview.dart index a0149122..d36cc1e0 100644 --- a/lib/views/groupsettingsview.dart +++ b/lib/views/groupsettingsview.dart @@ -158,14 +158,13 @@ class _GroupSettingsViewState extends State { showAlertDialog(BuildContext context) { // set up the buttons - Widget cancelButton = TextButton( + Widget cancelButton = ElevatedButton( child: Text(AppLocalizations.of(context)!.cancel), - style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))), onPressed: () { Navigator.of(context).pop(); // dismiss dialog }, ); - Widget continueButton = TextButton( + Widget continueButton = ElevatedButton( style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))), child: Text(AppLocalizations.of(context)!.yesLeave), onPressed: () { diff --git a/lib/views/messageview.dart b/lib/views/messageview.dart index 5528d97a..625608bc 100644 --- a/lib/views/messageview.dart +++ b/lib/views/messageview.dart @@ -236,7 +236,6 @@ class _MessageViewState extends State { focusedBorder: InputBorder.none, enabled: true, suffixIcon: ElevatedButton( - style: ElevatedButton.styleFrom(primary: Provider.of(context).theme.defaultButtonColor()), child: Icon(CwtchIcons.send_24px, size: 24, color: Provider.of(context).theme.mainTextColor()), onPressed: isOffline ? null : _sendMessage, ))), diff --git a/lib/views/peersettingsview.dart b/lib/views/peersettingsview.dart index bd966efb..da8f0b50 100644 --- a/lib/views/peersettingsview.dart +++ b/lib/views/peersettingsview.dart @@ -226,7 +226,7 @@ class _PeerSettingsViewState extends State { Navigator.of(context).pop(); // dismiss dialog }, ); - Widget continueButton = TextButton( + Widget continueButton = ElevatedButton( style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))), child: Text(AppLocalizations.of(context)!.yesLeave), onPressed: () { diff --git a/lib/widgets/invitationbubble.dart b/lib/widgets/invitationbubble.dart index 9214fd69..3a9c2585 100644 --- a/lib/widgets/invitationbubble.dart +++ b/lib/widgets/invitationbubble.dart @@ -85,8 +85,8 @@ class InvitationBubbleState extends State { wdgDecorations = Center( widthFactor: 1, child: Wrap(children: [ - Padding(padding: EdgeInsets.all(5), child: TextButton(child: Text(AppLocalizations.of(context)!.rejectGroupBtn + '\u202F'), onPressed: _btnReject)), - Padding(padding: EdgeInsets.all(5), child: TextButton(child: Text(AppLocalizations.of(context)!.acceptGroupBtn + '\u202F'), onPressed: _btnAccept)), + Padding(padding: EdgeInsets.all(5), child: ElevatedButton(child: Text(AppLocalizations.of(context)!.rejectGroupBtn + '\u202F'), onPressed: _btnReject)), + Padding(padding: EdgeInsets.all(5), child: ElevatedButton(child: Text(AppLocalizations.of(context)!.acceptGroupBtn + '\u202F'), onPressed: _btnAccept)), ])); } diff --git a/lib/widgets/messagerow.dart b/lib/widgets/messagerow.dart index df9d3568..2084cca5 100644 --- a/lib/widgets/messagerow.dart +++ b/lib/widgets/messagerow.dart @@ -123,7 +123,6 @@ class MessageRowState extends State with SingleTickerProviderStateMi child: TextButton( style: ButtonStyle( backgroundColor: MaterialStateProperty.all(blockedMessageBackground), - overlayColor: MaterialStateProperty.all(blockedMessageBackground), ), child: Text( AppLocalizations.of(context)!.showMessageButton + '\u202F', @@ -242,14 +241,14 @@ class MessageRowState extends State with SingleTickerProviderStateMi showAddContactConfirmAlertDialog(BuildContext context, String profileOnion, String senderOnion) { // set up the buttons - Widget cancelButton = TextButton( + Widget cancelButton = ElevatedButton( child: Text(AppLocalizations.of(context)!.cancel), style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))), onPressed: () { Navigator.of(context).pop(); // dismiss dialog }, ); - Widget continueButton = TextButton( + Widget continueButton = ElevatedButton( style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))), child: Text(AppLocalizations.of(context)!.addContact), onPressed: () {