diff --git a/src/components/settings/BackgroundSettings.tsx b/src/components/settings/BackgroundSettings.tsx index 1fd524f..dbc234a 100644 --- a/src/components/settings/BackgroundSettings.tsx +++ b/src/components/settings/BackgroundSettings.tsx @@ -10,7 +10,7 @@ import { Button } from "@/components/ui/button"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { GRADIENT_PRESETS } from "@/types/preferences"; import type { BackgroundType } from "@/types/preferences"; -import { Check } from "lucide-react"; +import { Check, Minus, Plus } from "lucide-react"; import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"; import { Slider } from "@/components/ui/slider"; @@ -121,6 +121,26 @@ export function BackgroundSettings() { } }; + const adjustOpacity = async (delta: number) => { + try { + const currentOpacity = preferences.background.opacity || 10; + const newOpacity = Math.max(0, Math.min(100, currentOpacity + delta)); + await handleOpacityChange([newOpacity]); + } catch (error) { + console.error("Erreur ajustement opacité:", error); + } + }; + + const adjustBlur = async (delta: number) => { + try { + const currentBlur = preferences.background.blur || 0; + const newBlur = Math.max(0, Math.min(20, currentBlur + delta)); + await handleBlurChange([newBlur]); + } catch (error) { + console.error("Erreur ajustement flou:", error); + } + }; + return ( @@ -218,16 +238,36 @@ export function BackgroundSettings() {
- {preferences.background.opacity || 100}% + {preferences.background.opacity || 10}% +
+
+
+ + + +
-

Contrôle la transparence du contenu par rapport au background

@@ -238,14 +278,34 @@ export function BackgroundSettings() { {preferences.background.blur || 0}px
- +
+
+ + + +
+

Applique un effet de flou au background

diff --git a/src/components/ui/slider.tsx b/src/components/ui/slider.tsx index fa20878..1d16806 100644 --- a/src/components/ui/slider.tsx +++ b/src/components/ui/slider.tsx @@ -12,15 +12,16 @@ const Slider = React.forwardRef< - + - + )) Slider.displayName = SliderPrimitive.Root.displayName diff --git a/src/types/preferences.ts b/src/types/preferences.ts index 227e88a..947401d 100644 --- a/src/types/preferences.ts +++ b/src/types/preferences.ts @@ -29,7 +29,7 @@ export const defaultPreferences: UserPreferences = { }, background: { type: "default", - opacity: 100, + opacity: 10, blur: 0, }, };