added icon color changer everywhere

This commit is contained in:
Kima 2023-10-12 19:24:40 +02:00
parent 46e6120af3
commit 5272ac5a01
3 changed files with 33 additions and 4 deletions

View File

@ -40,6 +40,11 @@ class ShareProvider extends ChangeNotifier {
SettingsProvider.defaultSettings().customAccentColor) SettingsProvider.defaultSettings().customAccentColor)
?.value ?? ?.value ??
const Color(0xFF3D7BF4).value, const Color(0xFF3D7BF4).value,
'icon_color': (settings.customIconColor ??
SettingsProvider.defaultSettings().customIconColor)
?.value ??
const Color(0x00000000).value,
'shadow_effect': settings.shadowEffect,
}; };
SharedTheme theme = SharedTheme.fromJson(themeJson, gradeColors); SharedTheme theme = SharedTheme.fromJson(themeJson, gradeColors);

View File

@ -39,6 +39,7 @@ enum CustomColorMode {
accent, accent,
background, background,
highlight, highlight,
icon,
enterId, enterId,
} }
@ -146,6 +147,8 @@ class _PremiumCustomAccentColorSettingState
return settings.customHighlightColor; return settings.customHighlightColor;
case CustomColorMode.accent: case CustomColorMode.accent:
return settings.customAccentColor; return settings.customAccentColor;
case CustomColorMode.icon:
return settings.customIconColor;
case CustomColorMode.enterId: case CustomColorMode.enterId:
// do nothing here lol // do nothing here lol
break; break;
@ -153,7 +156,7 @@ class _PremiumCustomAccentColorSettingState
} }
void updateCustomColor(dynamic v, bool store, void updateCustomColor(dynamic v, bool store,
{Color? accent, Color? background, Color? panels}) { {Color? accent, Color? background, Color? panels, Color? icon}) {
if (colorMode != CustomColorMode.theme) { if (colorMode != CustomColorMode.theme) {
settings.update(accentColor: AccentColor.custom, store: store); settings.update(accentColor: AccentColor.custom, store: store);
} }
@ -186,10 +189,14 @@ class _PremiumCustomAccentColorSettingState
case CustomColorMode.accent: case CustomColorMode.accent:
settings.update(customAccentColor: v, store: store); settings.update(customAccentColor: v, store: store);
break; break;
case CustomColorMode.icon:
settings.update(customIconColor: v, store: store);
break;
case CustomColorMode.enterId: case CustomColorMode.enterId:
settings.update(customBackgroundColor: background, store: store); settings.update(customBackgroundColor: background, store: store);
settings.update(customHighlightColor: panels, store: store); settings.update(customHighlightColor: panels, store: store);
settings.update(customAccentColor: accent, store: store); settings.update(customAccentColor: accent, store: store);
settings.update(customIconColor: icon, store: store);
break; break;
} }
} }
@ -329,7 +336,8 @@ class _PremiumCustomAccentColorSettingState
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24), borderRadius: BorderRadius.circular(24),
gradient: LinearGradient( // https://discord.com/channels/1111649116020285532/1153619667848548452 gradient: LinearGradient(
// https://discord.com/channels/1111649116020285532/1153619667848548452
begin: Alignment.topCenter, begin: Alignment.topCenter,
end: Alignment.bottomCenter, end: Alignment.bottomCenter,
stops: const [ stops: const [
@ -337,8 +345,8 @@ class _PremiumCustomAccentColorSettingState
0.75 0.75
], ],
colors: [ colors: [
settings.customBackgroundColor settings.customBackgroundColor ??
?? Theme.of(context).colorScheme.background, Theme.of(context).colorScheme.background,
isBackgroundDifferent isBackgroundDifferent
? HSVColor.fromColor(Theme.of(context) ? HSVColor.fromColor(Theme.of(context)
.colorScheme .colorScheme
@ -704,6 +712,13 @@ class _PremiumCustomAccentColorSettingState
tab: Tab( tab: Tab(
text: "colorpicker_accent" text: "colorpicker_accent"
.i18n)), .i18n)),
ColorTab(
unlocked: hasAccess,
color: settings.customIconColor ??
unknownColor,
tab: Tab(
text:
"colorpicker_icon".i18n)),
], ],
onTap: (index) { onTap: (index) {
if (!hasAccess) { if (!hasAccess) {
@ -824,6 +839,11 @@ class _PremiumCustomAccentColorSettingState
settings.update( settings.update(
gradeColors: colors); gradeColors: colors);
// changing shadow effect
settings.update(
shadowEffect:
theme.shadowEffect);
// changing theme // changing theme
setState(() { setState(() {
updateCustomColor( updateCustomColor(
@ -833,6 +853,7 @@ class _PremiumCustomAccentColorSettingState
background: background:
theme.backgroundColor, theme.backgroundColor,
panels: theme.panelsColor, panels: theme.panelsColor,
icon: theme.iconColor,
); );
}); });
setTheme(settings.theme, true); setTheme(settings.theme, true);

View File

@ -9,6 +9,7 @@ extension SettingsLocalization on String {
"colorpicker_background": "Background", "colorpicker_background": "Background",
"colorpicker_panels": "Panels", "colorpicker_panels": "Panels",
"colorpicker_accent": "Accent", "colorpicker_accent": "Accent",
"colorpicker_icon": "Icon",
"need_sub": "You need Kupak subscription to use modify this.", "need_sub": "You need Kupak subscription to use modify this.",
"advanced": "Advanced", "advanced": "Advanced",
"enter_id": "Enter ID", "enter_id": "Enter ID",
@ -25,6 +26,7 @@ extension SettingsLocalization on String {
"colorpicker_background": "Háttér", "colorpicker_background": "Háttér",
"colorpicker_panels": "Panelek", "colorpicker_panels": "Panelek",
"colorpicker_accent": "Színtónus", "colorpicker_accent": "Színtónus",
"colorpicker_icon": "Ikon",
"need_sub": "A módosításhoz Kupak szintű támogatás szükséges.", "need_sub": "A módosításhoz Kupak szintű támogatás szükséges.",
"advanced": "Haladó", "advanced": "Haladó",
"enter_id": "ID megadása", "enter_id": "ID megadása",
@ -41,6 +43,7 @@ extension SettingsLocalization on String {
"colorpicker_background": "Hintergrund", "colorpicker_background": "Hintergrund",
"colorpicker_panels": "Tafeln", "colorpicker_panels": "Tafeln",
"colorpicker_accent": "Akzent", "colorpicker_accent": "Akzent",
"colorpicker_icon": "Ikone",
"need_sub": "need_sub":
"Sie benötigen ein Kupak-Abonnement, um diese Funktion zu ändern.", "Sie benötigen ein Kupak-Abonnement, um diese Funktion zu ändern.",
"advanced": "Fortschrittlich", "advanced": "Fortschrittlich",