From 7faa01f67aac71db01bc3ef1acf003722bcaa072 Mon Sep 17 00:00:00 2001 From: Krille Date: Fri, 11 Aug 2023 13:55:38 +0200 Subject: [PATCH] design: Redesign style page --- assets/colors.png | Bin 4363 -> 0 bytes assets/l10n/intl_en.arb | 7 +- lib/pages/settings_style/settings_style.dart | 2 +- .../settings_style/settings_style_view.dart | 80 ++++++++++++++++-- 4 files changed, 77 insertions(+), 12 deletions(-) delete mode 100644 assets/colors.png diff --git a/assets/colors.png b/assets/colors.png deleted file mode 100644 index 27c996adb6329a0ce74fc309d2d3ae5bb8ef7a77..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4363 zcmXX~2{hE*`@b`ceH}Z)4B16Uq8MY0EHAPvDce+PB3s!8gGu(iELl>rv}o1h%}$M% zLP%*rw93*xW4r(F{Q5s<=04l!`P}EZ_ntH7Os1=gov4ta5CA~b!Jgud==0pK01vW0 zlq|&qfd1y{; zo+8E{0L=hsfjc3Rik?CiNVmYk7(}xGfd4Ea7!U%|k@W!tdC&l)BbXFjzXC`DGY}kvz!-u)h>%A+Bk>ae%tP=3 z;jjM*!CoZt3>Y1NaJMUHf|^^QsVcn5?V$s}8&I0Z6=s585WIt+1_|DP;9M9|5&)nb zLg)pZ(clbJGJ~bu_9_58fN(bg=)#@n9)N|=8#zI!y#vA!2FQhZ01iTc>3|SoRA4PM z+SR=UvOgI@$7tAzLP2x~FXV;EkT=;1(N???*2o^RP*Y3K5Q-raZ^sk-p$0Sz-U^}q z8{+}E6&6e_+jc?}j}=^R7Zry(cT}Js+`1WB@WW09>U&u*p2$%sOjC`v#K6_^AKw!v-i(`KYR32B&tNt1(6&aOiYLh)p1Ep83P z@C+^z9?|)r@zi4@eEYV%yzrhYPo7+DC@xB((P#?a zKTnUaxYAf$T%4Vf!ibCU^z>Yr9vNtFZ)@9nfofC*lAAdFW;^cF-wiqQHr>(`(zO*Znln_+m ztTPs(rmuH|M$1++f8V=(o^<8Kv$Of%z0}^HBXe{od5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&8CM5`qU^29m|wSDjL- zug8b6Bw({--nQWnmKE8a%8KxiVA$WMxHQYkq{$X$xoPkadT5VD;?{3fmNT_6qOSHV zq1)A^?Fw3|7Z9rJRo5#7CpA{Fp((9YKy@OQ7MorZmlE%Fv<59qho#DvBd`*Ns9Cs!(QO+m3<>ZPI4LAji|VV&WroJMIKuSLq-3rCbaxO$yFAXF|XpC>WqwZCa`XUz9h0;t8Nc}$+)=-K7 diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index 25037b60c..17a34c734 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -1225,6 +1225,7 @@ "placeholders": {} }, "messages": "Messages", + "messagesStyle": "Messages:", "@messages": { "type": "text", "placeholders": {} @@ -2132,7 +2133,7 @@ "type": "text", "placeholders": {} }, - "wallpaper": "Wallpaper", + "wallpaper": "Wallpaper:", "@wallpaper": { "type": "text", "placeholders": {} @@ -2501,5 +2502,7 @@ "provider": {} } }, - "profileNotFound": "The user could not be found on the server. Maybe there is a connection problem or the user doesn't exist." + "profileNotFound": "The user could not be found on the server. Maybe there is a connection problem or the user doesn't exist.", + "setTheme": "Set theme:", + "setColorTheme": "Set color theme:" } diff --git a/lib/pages/settings_style/settings_style.dart b/lib/pages/settings_style/settings_style.dart index 97313cc46..e46392c39 100644 --- a/lib/pages/settings_style/settings_style.dart +++ b/lib/pages/settings_style/settings_style.dart @@ -46,13 +46,13 @@ class SettingsStyleController extends State { Color? get currentColor => ThemeController.of(context).primaryColor; static final List customColors = [ + null, AppConfig.chatColor, Colors.indigo, Colors.green, Colors.orange, Colors.pink, Colors.blueGrey, - null, ]; void switchTheme(ThemeMode? newTheme) { diff --git a/lib/pages/settings_style/settings_style_view.dart b/lib/pages/settings_style/settings_style_view.dart index 8967aa959..c74176fbe 100644 --- a/lib/pages/settings_style/settings_style_view.dart +++ b/lib/pages/settings_style/settings_style_view.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; +import 'package:fluffychat/config/themes.dart'; import 'package:fluffychat/widgets/layouts/max_width_body.dart'; import '../../config/app_config.dart'; import '../../widgets/matrix.dart'; @@ -26,6 +27,15 @@ class SettingsStyleView extends StatelessWidget { withScrolling: true, child: Column( children: [ + ListTile( + title: Text( + L10n.of(context)!.setColorTheme, + style: TextStyle( + color: Theme.of(context).colorScheme.secondary, + fontWeight: FontWeight.bold, + ), + ), + ), SizedBox( height: colorPickerSize + 24, child: ListView( @@ -40,17 +50,59 @@ class SettingsStyleView extends StatelessWidget { onTap: () => controller.setChatColor(color), child: color == null ? Material( - elevation: - AppConfig.colorSchemeSeed?.value == null - ? 100 - : 0, + elevation: 6, shadowColor: AppConfig.colorSchemeSeed, borderRadius: BorderRadius.circular(colorPickerSize), - child: Image.asset( - 'assets/colors.png', - width: colorPickerSize, - height: colorPickerSize, + child: DecoratedBox( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular( + colorPickerSize, + ), + gradient: FluffyThemes.backgroundGradient( + context, + 255, + ), + ), + child: SizedBox( + height: colorPickerSize, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0, + ), + child: Center( + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + if (controller.currentColor == + null) + Padding( + padding: + const EdgeInsets.only( + right: 8.0, + ), + child: Icon( + Icons.check, + size: 16, + color: Theme.of(context) + .colorScheme + .onBackground, + ), + ), + Text( + L10n.of(context)!.systemTheme, + textAlign: TextAlign.center, + style: TextStyle( + color: Theme.of(context) + .colorScheme + .onBackground, + ), + ), + ], + ), + ), + ), + ), ), ) : Material( @@ -78,7 +130,17 @@ class SettingsStyleView extends StatelessWidget { .toList(), ), ), + const SizedBox(height: 8), const Divider(height: 1), + ListTile( + title: Text( + L10n.of(context)!.setTheme, + style: TextStyle( + color: Theme.of(context).colorScheme.secondary, + fontWeight: FontWeight.bold, + ), + ), + ), RadioListTile( groupValue: controller.currentTheme, value: ThemeMode.system, @@ -135,7 +197,7 @@ class SettingsStyleView extends StatelessWidget { const Divider(height: 1), ListTile( title: Text( - L10n.of(context)!.messages, + L10n.of(context)!.messagesStyle, style: TextStyle( color: Theme.of(context).colorScheme.secondary, fontWeight: FontWeight.bold,