adjusted RulerSlider ticks height

This commit is contained in:
Vadim 2024-04-11 20:10:45 +02:00
parent 06f6e45bcb
commit 2759894397

View file

@ -77,10 +77,14 @@ class _Ruler extends StatelessWidget {
@override
Widget build(BuildContext context) {
final mainTicksFontSize = Theme.of(context).textTheme.bodySmall!.fontSize!;
return LayoutBuilder(
builder: (context, constraints) {
final bool showAllMainTicks = Dimens.cameraSliderHandleArea * mainTicksCount <= constraints.maxHeight;
return Column(
final bool showAllMainTicks =
mainTicksFontSize * mainTicksCount + (1 * mainTicksCount - 1) <= constraints.maxHeight;
return Padding(
padding: EdgeInsets.symmetric(vertical: (Dimens.cameraSliderHandleArea - mainTicksFontSize) / 2),
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: List.generate(
@ -92,7 +96,7 @@ class _Ruler extends StatelessWidget {
}
final bool showValue = (index % (showAllMainTicks ? 2 : 4) == 0.0);
return SizedBox(
height: index == itemsCount - 1 || showValue ? Dimens.cameraSliderHandleArea : 1,
height: index == itemsCount - 1 || showValue ? mainTicksFontSize : 1,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
@ -114,6 +118,7 @@ class _Ruler extends StatelessWidget {
);
},
).reversed.toList(),
),
);
},
);