forked from cwtch.im/cwtch-ui
Improve Button Feedback
This commit is contained in:
parent
397971a181
commit
30ea12a9ce
|
@ -116,13 +116,13 @@ class FlwtchState extends State<Flwtch> {
|
||||||
// the MyBroadcastReceiver method channel
|
// the MyBroadcastReceiver method channel
|
||||||
Future<void> modalShutdown(MethodCall mc) async {
|
Future<void> modalShutdown(MethodCall mc) async {
|
||||||
// set up the buttons
|
// set up the buttons
|
||||||
Widget cancelButton = TextButton(
|
Widget cancelButton = ElevatedButton(
|
||||||
child: Text(AppLocalizations.of(navKey.currentContext!)!.cancel),
|
child: Text(AppLocalizations.of(navKey.currentContext!)!.cancel),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(navKey.currentContext!).pop(); // dismiss dialog
|
Navigator.of(navKey.currentContext!).pop(); // dismiss dialog
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
Widget continueButton = TextButton(
|
Widget continueButton = ElevatedButton(
|
||||||
child: Text(AppLocalizations.of(navKey.currentContext!)!.shutdownCwtchAction),
|
child: Text(AppLocalizations.of(navKey.currentContext!)!.shutdownCwtchAction),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// Directly call the shutdown command, Android will do this for us...
|
// Directly call the shutdown command, Android will do this for us...
|
||||||
|
|
|
@ -374,7 +374,7 @@ class OpaqueDark extends OpaqueThemeType {
|
||||||
}
|
}
|
||||||
|
|
||||||
Color defaultButtonDisabledColor() {
|
Color defaultButtonDisabledColor() {
|
||||||
return deepPurple;
|
return lightGrey;
|
||||||
}
|
}
|
||||||
|
|
||||||
Color defaultButtonDisabledTextColor() {
|
Color defaultButtonDisabledTextColor() {
|
||||||
|
@ -684,7 +684,7 @@ class OpaqueLight extends OpaqueThemeType {
|
||||||
}
|
}
|
||||||
|
|
||||||
Color defaultButtonDisabledColor() {
|
Color defaultButtonDisabledColor() {
|
||||||
return purple;
|
return lightGrey;
|
||||||
}
|
}
|
||||||
|
|
||||||
Color defaultButtonDisabledTextColor() {
|
Color defaultButtonDisabledTextColor() {
|
||||||
|
@ -969,9 +969,15 @@ ThemeData mkThemeData(Settings opaque) {
|
||||||
),
|
),
|
||||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||||
style: ButtonStyle(
|
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()),
|
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)),
|
padding: MaterialStateProperty.all(EdgeInsets.all(20)),
|
||||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(18.0),
|
borderRadius: BorderRadius.circular(18.0),
|
||||||
|
@ -1004,7 +1010,11 @@ ThemeData mkThemeData(Settings opaque) {
|
||||||
thumbColor: MaterialStateProperty.all(opaque.current().mainTextColor()),
|
thumbColor: MaterialStateProperty.all(opaque.current().mainTextColor()),
|
||||||
trackColor: MaterialStateProperty.all(opaque.current().dropShadowColor()),
|
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(
|
textSelectionTheme: TextSelectionThemeData(
|
||||||
cursorColor: opaque.current().defaultButtonActiveColor(), selectionColor: opaque.current().defaultButtonActiveColor(), selectionHandleColor: opaque.current().defaultButtonActiveColor()),
|
cursorColor: opaque.current().defaultButtonActiveColor(), selectionColor: opaque.current().defaultButtonActiveColor(), selectionHandleColor: opaque.current().defaultButtonActiveColor()),
|
||||||
);
|
);
|
||||||
|
|
|
@ -263,7 +263,6 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showAlertDialog(context);
|
showAlertDialog(context);
|
||||||
},
|
},
|
||||||
style: ElevatedButton.styleFrom(primary: theme.current().defaultButtonColor()),
|
|
||||||
icon: Icon(Icons.delete_forever),
|
icon: Icon(Icons.delete_forever),
|
||||||
label: Text(AppLocalizations.of(context)!.deleteBtn),
|
label: Text(AppLocalizations.of(context)!.deleteBtn),
|
||||||
))
|
))
|
||||||
|
@ -330,13 +329,13 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
|
||||||
|
|
||||||
showAlertDialog(BuildContext context) {
|
showAlertDialog(BuildContext context) {
|
||||||
// set up the buttons
|
// set up the buttons
|
||||||
Widget cancelButton = TextButton(
|
Widget cancelButton = ElevatedButton(
|
||||||
child: Text(AppLocalizations.of(context)!.cancel),
|
child: Text(AppLocalizations.of(context)!.cancel),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop(); // dismiss dialog
|
Navigator.of(context).pop(); // dismiss dialog
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
Widget continueButton = TextButton(
|
Widget continueButton = ElevatedButton(
|
||||||
child: Text(AppLocalizations.of(context)!.deleteProfileConfirmBtn),
|
child: Text(AppLocalizations.of(context)!.deleteProfileConfirmBtn),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
var onion = Provider.of<ProfileInfoState>(context, listen: false).onion;
|
var onion = Provider.of<ProfileInfoState>(context, listen: false).onion;
|
||||||
|
|
|
@ -158,14 +158,13 @@ class _GroupSettingsViewState extends State<GroupSettingsView> {
|
||||||
|
|
||||||
showAlertDialog(BuildContext context) {
|
showAlertDialog(BuildContext context) {
|
||||||
// set up the buttons
|
// set up the buttons
|
||||||
Widget cancelButton = TextButton(
|
Widget cancelButton = ElevatedButton(
|
||||||
child: Text(AppLocalizations.of(context)!.cancel),
|
child: Text(AppLocalizations.of(context)!.cancel),
|
||||||
style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))),
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop(); // dismiss dialog
|
Navigator.of(context).pop(); // dismiss dialog
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
Widget continueButton = TextButton(
|
Widget continueButton = ElevatedButton(
|
||||||
style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))),
|
style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))),
|
||||||
child: Text(AppLocalizations.of(context)!.yesLeave),
|
child: Text(AppLocalizations.of(context)!.yesLeave),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|
|
@ -236,7 +236,6 @@ class _MessageViewState extends State<MessageView> {
|
||||||
focusedBorder: InputBorder.none,
|
focusedBorder: InputBorder.none,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
suffixIcon: ElevatedButton(
|
suffixIcon: ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(primary: Provider.of<Settings>(context).theme.defaultButtonColor()),
|
|
||||||
child: Icon(CwtchIcons.send_24px, size: 24, color: Provider.of<Settings>(context).theme.mainTextColor()),
|
child: Icon(CwtchIcons.send_24px, size: 24, color: Provider.of<Settings>(context).theme.mainTextColor()),
|
||||||
onPressed: isOffline ? null : _sendMessage,
|
onPressed: isOffline ? null : _sendMessage,
|
||||||
))),
|
))),
|
||||||
|
|
|
@ -226,7 +226,7 @@ class _PeerSettingsViewState extends State<PeerSettingsView> {
|
||||||
Navigator.of(context).pop(); // dismiss dialog
|
Navigator.of(context).pop(); // dismiss dialog
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
Widget continueButton = TextButton(
|
Widget continueButton = ElevatedButton(
|
||||||
style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))),
|
style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))),
|
||||||
child: Text(AppLocalizations.of(context)!.yesLeave),
|
child: Text(AppLocalizations.of(context)!.yesLeave),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|
|
@ -85,8 +85,8 @@ class InvitationBubbleState extends State<InvitationBubble> {
|
||||||
wdgDecorations = Center(
|
wdgDecorations = Center(
|
||||||
widthFactor: 1,
|
widthFactor: 1,
|
||||||
child: Wrap(children: [
|
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: ElevatedButton(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)!.acceptGroupBtn + '\u202F'), onPressed: _btnAccept)),
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,6 @@ class MessageRowState extends State<MessageRow> with SingleTickerProviderStateMi
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
backgroundColor: MaterialStateProperty.all(blockedMessageBackground),
|
backgroundColor: MaterialStateProperty.all(blockedMessageBackground),
|
||||||
overlayColor: MaterialStateProperty.all(blockedMessageBackground),
|
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
AppLocalizations.of(context)!.showMessageButton + '\u202F',
|
AppLocalizations.of(context)!.showMessageButton + '\u202F',
|
||||||
|
@ -242,14 +241,14 @@ class MessageRowState extends State<MessageRow> with SingleTickerProviderStateMi
|
||||||
|
|
||||||
showAddContactConfirmAlertDialog(BuildContext context, String profileOnion, String senderOnion) {
|
showAddContactConfirmAlertDialog(BuildContext context, String profileOnion, String senderOnion) {
|
||||||
// set up the buttons
|
// set up the buttons
|
||||||
Widget cancelButton = TextButton(
|
Widget cancelButton = ElevatedButton(
|
||||||
child: Text(AppLocalizations.of(context)!.cancel),
|
child: Text(AppLocalizations.of(context)!.cancel),
|
||||||
style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))),
|
style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop(); // dismiss dialog
|
Navigator.of(context).pop(); // dismiss dialog
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
Widget continueButton = TextButton(
|
Widget continueButton = ElevatedButton(
|
||||||
style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))),
|
style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))),
|
||||||
child: Text(AppLocalizations.of(context)!.addContact),
|
child: Text(AppLocalizations.of(context)!.addContact),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|
Loading…
Reference in New Issue