Merge pull request #6092 from cmppoon/fix-default-predefine-color-palette

fix: default color not selected in appearance color palette
This commit is contained in:
Louis 2025-08-16 20:17:25 +07:00 committed by GitHub
commit 83b53210ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 40 additions and 30 deletions

View File

@ -8,24 +8,27 @@ import {
DropdownMenuTrigger, DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu' } from '@/components/ui/dropdown-menu'
import { useTranslation } from '@/i18n/react-i18next-compat' import { useTranslation } from '@/i18n/react-i18next-compat'
import { useTheme } from '@/hooks/useTheme'
export function ColorPickerAppBgColor() { export function ColorPickerAppBgColor() {
const { appBgColor, setAppBgColor } = useAppearance() const { appBgColor, setAppBgColor } = useAppearance()
const { isDark } = useTheme()
const { t } = useTranslation() const { t } = useTranslation()
const predefineAppBgColor: RgbaColor[] = [ const predefineAppBgColor: RgbaColor[] = [
{ isDark
r: 20, ? {
g: 20, r: 25,
b: 20, g: 25,
a: IS_WINDOWS || IS_LINUX || !IS_TAURI ? 1 : 0.4, b: 25,
}, a: IS_WINDOWS || IS_LINUX || !IS_TAURI ? 1 : 0.4,
{ }
r: 250, : {
g: 250, r: 255,
b: 250, g: 255,
a: IS_WINDOWS || IS_LINUX || !IS_TAURI ? 1 : 0.4, b: 255,
}, a: IS_WINDOWS || IS_LINUX || !IS_TAURI ? 1 : 0.4,
},
{ {
r: 70, r: 70,
g: 79, g: 79,

View File

@ -7,17 +7,21 @@ import {
DropdownMenuContent, DropdownMenuContent,
DropdownMenuTrigger, DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu' } from '@/components/ui/dropdown-menu'
import { useTheme } from '@/hooks/useTheme'
export function ColorPickerAppDestructiveColor() { export function ColorPickerAppDestructiveColor() {
const { appDestructiveBgColor, setAppDestructiveBgColor } = useAppearance() const { appDestructiveBgColor, setAppDestructiveBgColor } = useAppearance()
const { isDark } = useTheme()
const predefineAppDestructiveBgColor: RgbaColor[] = [ const predefineAppDestructiveBgColor: RgbaColor[] = [
{ isDark
r: 220, ? { r: 144, g: 60, b: 60, a: 1 }
g: 45, : {
b: 45, r: 217,
a: 1, g: 95,
}, b: 95,
a: 1,
},
{ {
r: 220, r: 220,
g: 100, g: 100,

View File

@ -7,23 +7,26 @@ import {
DropdownMenuContent, DropdownMenuContent,
DropdownMenuTrigger, DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu' } from '@/components/ui/dropdown-menu'
import { useTheme } from '@/hooks/useTheme'
export function ColorPickerAppMainView() { export function ColorPickerAppMainView() {
const { appMainViewBgColor, setAppMainViewBgColor } = useAppearance() const { appMainViewBgColor, setAppMainViewBgColor } = useAppearance()
const { isDark } = useTheme()
const predefineAppMainViewBgColor: RgbaColor[] = [ const predefineAppMainViewBgColor: RgbaColor[] = [
{ isDark
r: 251, ? {
g: 251, r: 25,
b: 251, g: 25,
a: 1, b: 25,
}, a: 1,
{ }
r: 24, : {
g: 24, r: 255,
b: 24, g: 255,
a: 1, b: 255,
}, a: 1,
},
] ]
return ( return (