mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-25 00:40:39 +00:00
adjusted RulerSlider
ticks height
This commit is contained in:
parent
06f6e45bcb
commit
2759894397
1 changed files with 39 additions and 34 deletions
|
@ -77,10 +77,14 @@ class _Ruler extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final mainTicksFontSize = Theme.of(context).textTheme.bodySmall!.fontSize!;
|
||||||
return LayoutBuilder(
|
return LayoutBuilder(
|
||||||
builder: (context, constraints) {
|
builder: (context, constraints) {
|
||||||
final bool showAllMainTicks = Dimens.cameraSliderHandleArea * mainTicksCount <= constraints.maxHeight;
|
final bool showAllMainTicks =
|
||||||
return Column(
|
mainTicksFontSize * mainTicksCount + (1 * mainTicksCount - 1) <= constraints.maxHeight;
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: (Dimens.cameraSliderHandleArea - mainTicksFontSize) / 2),
|
||||||
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: List.generate(
|
children: List.generate(
|
||||||
|
@ -92,7 +96,7 @@ class _Ruler extends StatelessWidget {
|
||||||
}
|
}
|
||||||
final bool showValue = (index % (showAllMainTicks ? 2 : 4) == 0.0);
|
final bool showValue = (index % (showAllMainTicks ? 2 : 4) == 0.0);
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: index == itemsCount - 1 || showValue ? Dimens.cameraSliderHandleArea : 1,
|
height: index == itemsCount - 1 || showValue ? mainTicksFontSize : 1,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
|
@ -114,6 +118,7 @@ class _Ruler extends StatelessWidget {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).reversed.toList(),
|
).reversed.toList(),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue