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

View File

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

View File

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