From 1cfb0d2684a2c483533a56afde2ebf8929bf6620 Mon Sep 17 00:00:00 2001 From: kolo Date: Sat, 21 Mar 2026 11:31:46 +0300 Subject: [PATCH] update --- .../widgets/color_editor_overlay.dart | 42 ++++++++----------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/lib/features/dashboard/widgets/color_editor_overlay.dart b/lib/features/dashboard/widgets/color_editor_overlay.dart index a38d8b6..12e5a78 100644 --- a/lib/features/dashboard/widgets/color_editor_overlay.dart +++ b/lib/features/dashboard/widgets/color_editor_overlay.dart @@ -30,8 +30,8 @@ class _FullScreenBlurOverlayState extends State { final mq = MediaQuery.of(widget.context); final cardTop = mq.padding.top + kToolbarHeight + 16; const cardHeight = 220.0; - final panelTop = cardTop + cardHeight + 32; - const panelHeight = 460.0; + final panelTop = cardTop + cardHeight + 82; + const panelHeight = 410.0; return Material( color: Colors.transparent, @@ -110,10 +110,10 @@ class _FullScreenBlurOverlayState extends State { dash.overlayEntry?.markNeedsBuild(); } - final currentHSV = dash.editingPrimary + final isSolid = dash.tempGradientType == GradientType.solid; + final currentHSV = (isSolid || dash.editingPrimary) ? dash.tempPrimaryHSV : dash.tempSecondaryHSV; - final isSolid = dash.tempGradientType == GradientType.solid; return Padding( padding: const EdgeInsets.fromLTRB(16, 14, 16, 14), @@ -170,9 +170,13 @@ class _FullScreenBlurOverlayState extends State { GestureDetector( onTap: () { dash.setState(() { - dash.tempGradientType = isSolid - ? GradientType.linear - : GradientType.solid; + if (isSolid) { + dash.tempGradientType = GradientType.linear; + // keep editingPrimary as is when turning off + } else { + dash.tempGradientType = GradientType.solid; + dash.editingPrimary = true; // ALWAYS switch to primary when entering Solid + } }); setPanelState(() {}); dash.overlayEntry?.markNeedsBuild(); @@ -233,7 +237,7 @@ class _FullScreenBlurOverlayState extends State { Expanded( child: LayoutBuilder( builder: (lbCtx, constraints) { - const reservedBelow = 62.0; + const reservedBelow = 66.0; final spectrumH = (constraints.maxHeight - reservedBelow).clamp( 40.0, double.infinity); @@ -254,23 +258,11 @@ class _FullScreenBlurOverlayState extends State { ), ), const SizedBox(height: 8), - Theme( - data: Theme.of(widget.context).copyWith( - sliderTheme: const SliderThemeData( - thumbShape: RoundSliderThumbShape( - enabledThumbRadius: 8, - elevation: 0, - pressedElevation: 0, - ), - overlayShape: RoundSliderOverlayShape( - overlayRadius: 0, - ), - ), - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(6), - child: SizedBox( - height: 20, + ClipRect( + child: SizedBox( + height: 24, + child: ClipRRect( + borderRadius: BorderRadius.circular(6), child: ColorPickerSlider( TrackType.hue, currentHSV,