diff --git a/app/lib/theme.dart b/app/lib/theme.dart index 4813dbdb..91c59915 100644 --- a/app/lib/theme.dart +++ b/app/lib/theme.dart @@ -13,10 +13,10 @@ extension ThemeExtension on ThemeData { double get widthLimitedContentMaxWidth => 550.0; Color get listPlaceholderBackgroundColor => - colorScheme.secondaryContainer.withOpacity(.6); + colorScheme.primaryContainer.withOpacity(.6); Color get listPlaceholderForegroundColor => - colorScheme.onSecondaryContainer.withOpacity(.7); + colorScheme.onPrimaryContainer.withOpacity(.7); Color get homeNavigationBarBackgroundColor => elevate(colorScheme.surface, 2).withOpacity(.55); @@ -148,8 +148,8 @@ ColorScheme _getColorScheme( } return SeedColorScheme.fromSeeds( brightness: brightness, - primaryKey: seedColor, tones: FlexTones.oneHue(brightness), + primaryKey: seedColor, ); } @@ -188,7 +188,7 @@ ThemeData _applyColorScheme(ColorScheme colorScheme) { return colorScheme.onSurface; } else { if (states.contains(MaterialState.selected)) { - return colorScheme.primary; + return colorScheme.secondary; } else { return Colors.transparent; } @@ -210,7 +210,7 @@ ThemeData _applyColorScheme(ColorScheme colorScheme) { } else { if (states.contains(MaterialState.selected)) { // return colorScheme.primary; - return colorScheme.primaryContainer; + return colorScheme.secondary; } else { return colorScheme.surfaceVariant; } @@ -227,7 +227,7 @@ ThemeData _applyColorScheme(ColorScheme colorScheme) { } else { if (states.contains(MaterialState.selected)) { // return colorScheme.onPrimary; - return colorScheme.primary; + return colorScheme.onSecondary; } else { return colorScheme.outline; } @@ -242,6 +242,46 @@ ThemeData _applyColorScheme(ColorScheme colorScheme) { actionTextColor: colorScheme.inversePrimary, behavior: SnackBarBehavior.floating, ), + sliderTheme: SliderThemeData( + activeTrackColor: colorScheme.secondary, + inactiveTrackColor: colorScheme.secondaryContainer, + thumbColor: colorScheme.secondary, + ), + elevatedButtonTheme: ElevatedButtonThemeData( + style: ButtonStyle( + backgroundColor: + MaterialStateProperty.all(colorScheme.secondaryContainer), + foregroundColor: MaterialStateProperty.all(colorScheme.secondary), + overlayColor: + MaterialStateProperty.all(colorScheme.secondary.withOpacity(.1)), + ), + ), + textButtonTheme: TextButtonThemeData( + style: ButtonStyle( + foregroundColor: MaterialStateProperty.all(colorScheme.secondary), + overlayColor: + MaterialStateProperty.all(colorScheme.secondary.withOpacity(.1)), + ), + ), + textSelectionTheme: TextSelectionThemeData( + cursorColor: colorScheme.secondary, + selectionHandleColor: colorScheme.secondary, + selectionColor: colorScheme.secondary.withOpacity(.4), + ), + inputDecorationTheme: InputDecorationTheme( + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide(color: colorScheme.secondary, width: 2), + ), + ), + chipTheme: ChipThemeData( + selectedColor: Color.lerp( + colorScheme.secondaryContainer, colorScheme.surfaceTint, .14), + iconTheme: IconThemeData( + color: colorScheme.secondary, + ), + ), + progressIndicatorTheme: + ProgressIndicatorThemeData(color: colorScheme.secondary), extensions: [ M3( checkbox: M3Checkbox( diff --git a/app/lib/widget/home_photos/view.dart b/app/lib/widget/home_photos/view.dart index 70248883..26f60827 100644 --- a/app/lib/widget/home_photos/view.dart +++ b/app/lib/widget/home_photos/view.dart @@ -303,7 +303,7 @@ class _ScrollLabel extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), child: DefaultTextStyle( style: Theme.of(context).textTheme.titleMedium!.copyWith( - color: Theme.of(context).colorScheme.onInverseSurface), + color: Theme.of(context).colorScheme.onSecondaryContainer), child: Text(text), ), ); diff --git a/app/lib/widget/home_photos2.dart b/app/lib/widget/home_photos2.dart index 6c607c9a..d9e22a20 100644 --- a/app/lib/widget/home_photos2.dart +++ b/app/lib/widget/home_photos2.dart @@ -322,8 +322,10 @@ class _BodyState extends State<_Body> { AppDimension.of(context).homeBottomAppBarHeight, labelTextBuilder: (_) => const _ScrollLabel(), labelPadding: const EdgeInsets.symmetric(horizontal: 40), - backgroundColor: Theme.of(context).elevate( - Theme.of(context).colorScheme.inverseSurface, 3), + backgroundColor: + Theme.of(context).colorScheme.secondaryContainer, + foregroundColor: + Theme.of(context).colorScheme.onSecondaryContainer, heightScrollThumb: 60, onScrollBegin: () { _bloc.add(const _StartScrolling()); @@ -335,6 +337,9 @@ class _BodyState extends State<_Body> { behavior: ScrollConfiguration.of(context) .copyWith(scrollbars: false), child: RefreshIndicator( + color: Theme.of(context).colorScheme.secondary, + backgroundColor: + Theme.of(context).colorScheme.secondaryContainer, onRefresh: () async { _bloc.add(const _RequestRefresh()); var hasNotNull = false; diff --git a/app/lib/widget/home_search.dart b/app/lib/widget/home_search.dart index 6dcfa3cc..3e8686af 100644 --- a/app/lib/widget/home_search.dart +++ b/app/lib/widget/home_search.dart @@ -653,8 +653,6 @@ class _FilterBubbleList extends StatelessWidget { showCheckmark: false, visualDensity: VisualDensity.compact, selected: true, - selectedColor: - Theme.of(context).elevate(Theme.of(context).colorScheme.surface, 5), label: Text(label), onSelected: (_) {}, ), diff --git a/app/lib/widget/selectable.dart b/app/lib/widget/selectable.dart index 078ccacd..39210ad1 100644 --- a/app/lib/widget/selectable.dart +++ b/app/lib/widget/selectable.dart @@ -25,7 +25,7 @@ class Selectable extends StatelessWidget { Positioned.fill( child: Container( decoration: BoxDecoration( - color: Theme.of(context).colorScheme.primaryContainer, + color: Theme.of(context).colorScheme.secondaryContainer, borderRadius: borderRadius, ), ), @@ -41,10 +41,10 @@ class Selectable extends StatelessWidget { isSelected ? childBorderRadius : BorderRadius.zero, side: BorderSide( color: isSelected - ? Theme.of(context).colorScheme.primaryContainer + ? Theme.of(context).colorScheme.secondaryContainer : Theme.of(context) .colorScheme - .primaryContainer + .secondaryContainer .withOpacity(0), width: isSelected ? 4 : 0, ), @@ -65,12 +65,12 @@ class Selectable extends StatelessWidget { Icon( Icons.circle, size: iconSize - 2, - color: Theme.of(context).colorScheme.primary, + color: Theme.of(context).colorScheme.secondary, ), Icon( Icons.check_circle_outlined, size: iconSize, - color: Theme.of(context).colorScheme.primaryContainer, + color: Theme.of(context).colorScheme.secondaryContainer, ), ], ), diff --git a/app/lib/widget/viewer_detail_pane.dart b/app/lib/widget/viewer_detail_pane.dart index ec5a566a..2bed5b39 100644 --- a/app/lib/widget/viewer_detail_pane.dart +++ b/app/lib/widget/viewer_detail_pane.dart @@ -256,8 +256,6 @@ class _ViewerDetailPaneState extends State { showCheckmark: false, visualDensity: VisualDensity.compact, selected: true, - selectedColor: Theme.of(context) - .elevate(Theme.of(context).colorScheme.surface, 5), label: Text(_tags[index]), onSelected: (_) {}, ), diff --git a/app/pubspec.lock b/app/pubspec.lock index 17d615fd..4c0995df 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -376,8 +376,8 @@ packages: dependency: "direct main" description: path: "." - ref: "v0.1.0-nc-photos-7" - resolved-ref: c2e009d371950322f67ff7ce18a67881000629ce + ref: "v0.1.0-nc-photos-8" + resolved-ref: "4fa2ca0f8bbab5c4300b242c63865e0530a173c8" url: "https://gitlab.com/nc-photos/flutter-draggable-scrollbar" source: git version: "0.1.0+7" diff --git a/app/pubspec.yaml b/app/pubspec.yaml index a89f1edf..c9695cc8 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -51,7 +51,7 @@ dependencies: draggable_scrollbar: git: url: https://gitlab.com/nc-photos/flutter-draggable-scrollbar - ref: v0.1.0-nc-photos-7 + ref: v0.1.0-nc-photos-8 dynamic_color: ^1.6.6 equatable: ^2.0.5 event_bus: ^2.0.0 diff --git a/np_ui/lib/src/fancy_option_picker.dart b/np_ui/lib/src/fancy_option_picker.dart index 6b2ceb06..12882044 100644 --- a/np_ui/lib/src/fancy_option_picker.dart +++ b/np_ui/lib/src/fancy_option_picker.dart @@ -66,13 +66,13 @@ class FancyOptionPickerItemView extends StatelessWidget { return ListTile( leading: Icon( isSelected ? Icons.check : null, - color: Theme.of(context).colorScheme.primary, + color: Theme.of(context).colorScheme.secondary, ), title: Text( label, style: isSelected ? TextStyle( - color: Theme.of(context).colorScheme.primary, + color: Theme.of(context).colorScheme.secondary, ) : null, ),