From 3963f293184afa355a8bbc7a583b93f35a3d427c Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 17 Mar 2023 13:12:09 -0600 Subject: [PATCH] chans theme desktop selector fix and padding fixes --- assets/svg/chanstheme.svg | 104 ++--------- .../settings_menu/appearance_settings.dart | 169 +++++++++--------- 2 files changed, 93 insertions(+), 180 deletions(-) diff --git a/assets/svg/chanstheme.svg b/assets/svg/chanstheme.svg index 76a6caa98..0a94d5f57 100644 --- a/assets/svg/chanstheme.svg +++ b/assets/svg/chanstheme.svg @@ -1,94 +1,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/lib/pages_desktop_specific/settings/settings_menu/appearance_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/appearance_settings.dart index 22727c130..a23ad962a 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/appearance_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/appearance_settings.dart @@ -136,7 +136,7 @@ class _AppearanceOptionSettings ), ), const Padding( - padding: EdgeInsets.all(10), + padding: EdgeInsets.all(2), child: ThemeToggle(), ), ], @@ -186,100 +186,95 @@ class _ThemeToggle extends ConsumerState { runSpacing: 16, children: [ for (int i = 0; i < ThemeType.values.length; i++) - Row( - mainAxisSize: MainAxisSize.min, - children: [ - if (i > 0) - const SizedBox( - width: 10, - ), - MouseRegion( - cursor: SystemMouseCursors.click, - child: GestureDetector( - onTap: () { - if (ref.read(colorThemeProvider.state).state.themeType != - ThemeType.values[i]) { - DB.instance.put( - boxName: DB.boxNameTheme, - key: "colorScheme", - value: ThemeType.values[i].name, - ); - ref.read(colorThemeProvider.state).state = - StackColors.fromStackColorTheme( - ThemeType.values[i].colorTheme); - } - }, - child: Container( - width: 200, - color: Colors.transparent, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - decoration: BoxDecoration( - border: Border.all( - width: 2.5, - color: ref - .read(colorThemeProvider.state) - .state - .themeType == - ThemeType.values[i] - ? Theme.of(context) - .extension()! - .infoItemIcons - : Theme.of(context) - .extension()! - .popupBG, - ), - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, - ), + Padding( + padding: const EdgeInsets.all(8.0), + child: MouseRegion( + cursor: SystemMouseCursors.click, + child: GestureDetector( + onTap: () { + if (ref.read(colorThemeProvider.state).state.themeType != + ThemeType.values[i]) { + DB.instance.put( + boxName: DB.boxNameTheme, + key: "colorScheme", + value: ThemeType.values[i].name, + ); + ref.read(colorThemeProvider.state).state = + StackColors.fromStackColorTheme( + ThemeType.values[i].colorTheme); + } + }, + child: Container( + width: 200, + color: Colors.transparent, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + decoration: BoxDecoration( + border: Border.all( + width: 2.5, + color: ref + .read(colorThemeProvider.state) + .state + .themeType == + ThemeType.values[i] + ? Theme.of(context) + .extension()! + .infoItemIcons + : Theme.of(context) + .extension()! + .popupBG, ), - child: SvgPicture.asset( - assetNameFor(ThemeType.values[i]), + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, ), ), - const SizedBox( - height: 12, + child: SvgPicture.asset( + assetNameFor(ThemeType.values[i]), + height: 160, ), - Row( - children: [ - SizedBox( - width: 20, - height: 20, - child: Radio( - activeColor: Theme.of(context) - .extension()! - .radioButtonIconEnabled, - value: ThemeType.values[i], - groupValue: ref - .read(colorThemeProvider.state) - .state - .themeType, - onChanged: (_) {}, - ), + ), + const SizedBox( + height: 12, + ), + Row( + children: [ + SizedBox( + width: 20, + height: 20, + child: Radio( + activeColor: Theme.of(context) + .extension()! + .radioButtonIconEnabled, + value: ThemeType.values[i], + groupValue: ref + .read(colorThemeProvider.state) + .state + .themeType, + onChanged: (_) {}, ), - const SizedBox( - width: 14, + ), + const SizedBox( + width: 14, + ), + Text( + ThemeType.values[i].prettyName, + style: STextStyles.desktopTextExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .textDark, ), - Text( - ThemeType.values[i].prettyName, - style: STextStyles.desktopTextExtraSmall(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textDark, - ), - ), - ], - ), - ], - ), + ), + ], + ), + ], ), ), - ) - ], - ), + ), + ), + ) ], ); }