This commit is contained in:
2026-03-21 11:27:16 +03:00
parent 5c88248cf5
commit 3e7242cc23
@@ -30,10 +30,8 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
final mq = MediaQuery.of(widget.context); final mq = MediaQuery.of(widget.context);
final cardTop = mq.padding.top + kToolbarHeight + 16; final cardTop = mq.padding.top + kToolbarHeight + 16;
const cardHeight = 220.0; const cardHeight = 220.0;
final panelTop = cardTop + cardHeight + 16; final panelTop = cardTop + cardHeight + 32;
const panelHeight = 460.0;
// Fixed panel height — smaller than before, no bottom stretching
const panelHeight = 310.0;
return Material( return Material(
color: Colors.transparent, color: Colors.transparent,
@@ -71,7 +69,6 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
top: panelTop, top: panelTop,
left: 20, left: 20,
right: 20, right: 20,
// No bottom — height is explicit, panel won't stretch to screen bottom
child: GestureDetector( child: GestureDetector(
onTap: () {}, onTap: () {},
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
@@ -113,7 +110,6 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
dash.overlayEntry?.markNeedsBuild(); dash.overlayEntry?.markNeedsBuild();
} }
// In solid mode, editing is always "primary" (the solid color)
final currentHSV = dash.editingPrimary final currentHSV = dash.editingPrimary
? dash.tempPrimaryHSV ? dash.tempPrimaryHSV
: dash.tempSecondaryHSV; : dash.tempSecondaryHSV;
@@ -125,18 +121,19 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// ── Row 1: [──Primary──] [──Secondary──] | [Solid] [X] ──
Row( Row(
children: [ children: [
// Expanded tabs fill available width equally
Expanded( Expanded(
child: PanelTab( child: PanelTab(
label: 'Primary', label: 'Primary',
isSelected: dash.editingPrimary && !isSolid, isSelected: dash.editingPrimary,
color: dash.tempPrimary, color: dash.tempPrimary,
onTap: isSolid ? null : () { isDimmed: isSolid,
dash.setState(() => dash.editingPrimary = true); onTap: () {
dash.setState(() {
if (isSolid) dash.tempGradientType = GradientType.linear;
dash.editingPrimary = true;
});
setPanelState(() {}); setPanelState(() {});
dash.overlayEntry?.markNeedsBuild(); dash.overlayEntry?.markNeedsBuild();
}, },
@@ -146,10 +143,14 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
Expanded( Expanded(
child: PanelTab( child: PanelTab(
label: 'Secondary', label: 'Secondary',
isSelected: !dash.editingPrimary && !isSolid, isSelected: !dash.editingPrimary,
color: dash.tempSecondary, color: dash.tempSecondary,
onTap: isSolid ? null : () { isDimmed: isSolid,
dash.setState(() => dash.editingPrimary = false); onTap: () {
dash.setState(() {
if (isSolid) dash.tempGradientType = GradientType.linear;
dash.editingPrimary = false;
});
setPanelState(() {}); setPanelState(() {});
dash.overlayEntry?.markNeedsBuild(); dash.overlayEntry?.markNeedsBuild();
}, },
@@ -166,7 +167,6 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
.withOpacity(0.15), .withOpacity(0.15),
), ),
), ),
// Solid toggle
GestureDetector( GestureDetector(
onTap: () { onTap: () {
dash.setState(() { dash.setState(() {
@@ -214,7 +214,6 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
), ),
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
// Close button
GestureDetector( GestureDetector(
onTap: () => dash.closeOverlay(apply: false), onTap: () => dash.closeOverlay(apply: false),
child: Container( child: Container(
@@ -230,17 +229,10 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
), ),
], ],
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
// ── Spectrum + hue + preview ──
// LayoutBuilder captures finite height from Expanded.
// Spectrum alone is wrapped in IgnorePointer when solid.
// Hue slider is ALWAYS active (used to pick the solid color too).
Expanded( Expanded(
child: LayoutBuilder( child: LayoutBuilder(
builder: (lbCtx, constraints) { builder: (lbCtx, constraints) {
// Reserve space for: hue(20) + gap(8) + preview(26) + 2×gap(8) = 62
const reservedBelow = 62.0; const reservedBelow = 62.0;
final spectrumH = final spectrumH =
(constraints.maxHeight - reservedBelow).clamp( (constraints.maxHeight - reservedBelow).clamp(
@@ -250,13 +242,7 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
// Spectrum — dimmed & blocked in Solid mode ClipRRect(
IgnorePointer(
ignoring: isSolid,
child: AnimatedOpacity(
duration: const Duration(milliseconds: 200),
opacity: isSolid ? 0.3 : 1.0,
child: ClipRRect(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
child: SizedBox( child: SizedBox(
height: spectrumH, height: spectrumH,
@@ -267,11 +253,21 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
), ),
), ),
), ),
),
),
const SizedBox(height: 8), const SizedBox(height: 8),
// Hue slider — ALWAYS active (works for both gradient & solid) Theme(
ClipRRect( 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), borderRadius: BorderRadius.circular(6),
child: SizedBox( child: SizedBox(
height: 20, height: 20,
@@ -283,8 +279,8 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
), ),
), ),
), ),
),
const SizedBox(height: 8), const SizedBox(height: 8),
// Color hex preview row
IgnorePointer( IgnorePointer(
ignoring: isSolid, ignoring: isSolid,
child: AnimatedOpacity( child: AnimatedOpacity(
@@ -401,10 +397,7 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
}, },
), ),
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
// ── Gradient type row (dimmed when Solid) ──
IgnorePointer( IgnorePointer(
ignoring: isSolid, ignoring: isSolid,
child: AnimatedOpacity( child: AnimatedOpacity(
@@ -497,10 +490,7 @@ class _FullScreenBlurOverlayState extends State<FullScreenBlurOverlay> {
), ),
), ),
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
// ── Reset + Apply ──
Row( Row(
children: [ children: [
Expanded( Expanded(
@@ -577,14 +567,16 @@ class PanelTab extends StatelessWidget {
final String label; final String label;
final bool isSelected; final bool isSelected;
final Color color; final Color color;
final VoidCallback? onTap; final bool isDimmed;
final VoidCallback onTap;
const PanelTab({ const PanelTab({
super.key, super.key,
required this.label, required this.label,
required this.isSelected, required this.isSelected,
required this.color, required this.color,
this.onTap, required this.isDimmed,
required this.onTap,
}); });
@override @override
@@ -598,9 +590,11 @@ class PanelTab extends StatelessWidget {
return GestureDetector( return GestureDetector(
onTap: onTap, onTap: onTap,
child: AnimatedOpacity(
duration: const Duration(milliseconds: 200),
opacity: isDimmed ? 0.5 : 1.0,
child: AnimatedContainer( child: AnimatedContainer(
duration: const Duration(milliseconds: 150), duration: const Duration(milliseconds: 150),
// Fill full width of Expanded slot (no padding-based width)
width: double.infinity, width: double.infinity,
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
@@ -645,6 +639,7 @@ class PanelTab extends StatelessWidget {
], ],
), ),
), ),
),
); );
} }
} }