From 7b7789bb62c3c7944a694bf40390959ab88ebb78 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Wed, 26 May 2021 12:56:39 -0700 Subject: [PATCH] Various Theme Updates - Moving more things to ThemeData --- lib/opaque.dart | 8 ++++++-- lib/views/groupsettingsview.dart | 3 +++ lib/views/peersettingsview.dart | 3 +++ lib/widgets/buttontextfield.dart | 3 +-- lib/widgets/passwordfield.dart | 1 - lib/widgets/textfield.dart | 1 - 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/opaque.dart b/lib/opaque.dart index 9126b4c..eff5cdd 100644 --- a/lib/opaque.dart +++ b/lib/opaque.dart @@ -1347,8 +1347,6 @@ ThemeData mkThemeData(Settings opaque) { primarySwatch: Colors.red, primaryColor: opaque.current().backgroundMainColor(), canvasColor: opaque.current().backgroundPaneColor(), - accentColor: opaque.current().defaultButtonColor(), - buttonColor: opaque.current().defaultButtonColor(), backgroundColor: opaque.current().backgroundMainColor(), highlightColor: opaque.current().hilightElementTextColor(), iconTheme: IconThemeData( @@ -1391,6 +1389,12 @@ ThemeData mkThemeData(Settings opaque) { caption: TextStyle(color: opaque.current().mainTextColor()), button: TextStyle(color: opaque.current().mainTextColor()), overline: TextStyle(color: opaque.current().mainTextColor())), + switchTheme: SwitchThemeData( + overlayColor: MaterialStateProperty.all(opaque.current().defaultButtonActiveColor()), + thumbColor: MaterialStateProperty.all(opaque.current().mainTextColor()), + trackColor: MaterialStateProperty.all(opaque.current().backgroundMainColor()), + ), + floatingActionButtonTheme: FloatingActionButtonThemeData(backgroundColor: opaque.current().defaultButtonColor(), hoverColor: opaque.current().defaultButtonActiveColor()), textSelectionTheme: TextSelectionThemeData( cursorColor: opaque.current().defaultButtonActiveColor(), selectionColor: opaque.current().defaultButtonActiveColor(), selectionHandleColor: opaque.current().defaultButtonActiveColor()), ); diff --git a/lib/views/groupsettingsview.dart b/lib/views/groupsettingsview.dart index 1425459..e7e0943 100644 --- a/lib/views/groupsettingsview.dart +++ b/lib/views/groupsettingsview.dart @@ -80,6 +80,9 @@ class _GroupSettingsViewState extends State { var handle = Provider.of(context, listen: false).onion; Provider.of(context, listen: false).nickname = ctrlrNick.text; Provider.of(context, listen: false).cwtch.SetGroupAttribute(profileOnion, handle, "local.name", ctrlrNick.text); + // todo translations + final snackBar = SnackBar(content: Text("Group Nickname changed successfully")); + ScaffoldMessenger.of(context).showSnackBar(snackBar); }, icon: Icon(Icons.save), tooltip: AppLocalizations.of(context)!.saveBtn, diff --git a/lib/views/peersettingsview.dart b/lib/views/peersettingsview.dart index 0630ec1..ca9b5d4 100644 --- a/lib/views/peersettingsview.dart +++ b/lib/views/peersettingsview.dart @@ -76,6 +76,9 @@ class _PeerSettingsViewState extends State { }; final setPeerAttributeJson = jsonEncode(setPeerAttribute); Provider.of(context, listen: false).cwtch.SendProfileEvent(profileOnion, setPeerAttributeJson); + // todo translations + final snackBar = SnackBar(content: Text("Nickname changed successfully")); + ScaffoldMessenger.of(context).showSnackBar(snackBar); }, icon: Icon(Icons.save), tooltip: AppLocalizations.of(context)!.saveBtn, diff --git a/lib/widgets/buttontextfield.dart b/lib/widgets/buttontextfield.dart index afeb050..83083fb 100644 --- a/lib/widgets/buttontextfield.dart +++ b/lib/widgets/buttontextfield.dart @@ -37,6 +37,7 @@ class _CwtchButtonTextFieldState extends State { ), floatingLabelBehavior: FloatingLabelBehavior.never, filled: true, + fillColor: theme.current().textfieldBackgroundColor(), focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(15.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor(), width: 3.0)), focusedErrorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(15.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor(), width: 3.0)), errorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(15.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor(), width: 3.0)), @@ -44,10 +45,8 @@ class _CwtchButtonTextFieldState extends State { color: theme.current().textfieldErrorColor(), fontWeight: FontWeight.bold, ), - fillColor: theme.current().textfieldBackgroundColor(), contentPadding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(15.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor(), width: 3.0))), - style: TextStyle(color: theme.current().mainTextColor(), backgroundColor: theme.current().textfieldBackgroundColor()), ); }); } diff --git a/lib/widgets/passwordfield.dart b/lib/widgets/passwordfield.dart index a260e32..d7931ef 100644 --- a/lib/widgets/passwordfield.dart +++ b/lib/widgets/passwordfield.dart @@ -59,7 +59,6 @@ class _CwtchTextFieldState extends State { fillColor: theme.current().textfieldBackgroundColor(), enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(15.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor(), width: 3.0)), ), - style: TextStyle(color: theme.current().mainTextColor(), backgroundColor: theme.current().textfieldBackgroundColor()), ); }); } diff --git a/lib/widgets/textfield.dart b/lib/widgets/textfield.dart index 1bbbf0d..4addae7 100644 --- a/lib/widgets/textfield.dart +++ b/lib/widgets/textfield.dart @@ -40,7 +40,6 @@ class _CwtchTextFieldState extends State { fillColor: theme.current().textfieldBackgroundColor(), contentPadding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(15.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor(), width: 3.0))), - style: TextStyle(color: theme.current().mainTextColor(), backgroundColor: theme.current().textfieldBackgroundColor()), ); }); }