refined topbar height difference calculation

This commit is contained in:
Vadim 2023-04-03 19:02:51 +03:00
parent 12d44d6bab
commit f084efde5d
3 changed files with 36 additions and 22 deletions

View file

@ -30,9 +30,8 @@ class Dimens {
static const double disabledOpacity = 0.38; static const double disabledOpacity = 0.38;
// TopBar // TopBar
/// Probably this is a bad practice, but with text size locked, the height is always 212 static const double readingContainerDoubleValueHeight = 128;
static const double readingContainerSingleValueHeight = 76; static const double readingContainerSingleValueHeight = 76;
static const double readingContainerDefaultHeight = 288;
// `CenteredSlider` // `CenteredSlider`
static const double cameraSliderTrackHeight = grid4; static const double cameraSliderTrackHeight = grid4;

View file

@ -4,6 +4,7 @@ import 'package:lightmeter/data/models/exposure_pair.dart';
import 'package:lightmeter/data/models/film.dart'; import 'package:lightmeter/data/models/film.dart';
import 'package:lightmeter/features.dart'; import 'package:lightmeter/features.dart';
import 'package:lightmeter/platform_config.dart'; import 'package:lightmeter/platform_config.dart';
import 'package:lightmeter/providers/features_provider.dart';
import 'package:lightmeter/res/dimens.dart'; import 'package:lightmeter/res/dimens.dart';
import 'package:lightmeter/screens/metering/components/camera_container/components/camera_view/widget_camera_view.dart'; import 'package:lightmeter/screens/metering/components/camera_container/components/camera_view/widget_camera_view.dart';
import 'package:lightmeter/screens/metering/components/camera_container/models/camera_error_type.dart'; import 'package:lightmeter/screens/metering/components/camera_container/models/camera_error_type.dart';
@ -49,11 +50,20 @@ class CameraContainer extends StatelessWidget {
((MediaQuery.of(context).size.width - Dimens.grid8 - 2 * Dimens.paddingM) / 2) / ((MediaQuery.of(context).size.width - Dimens.grid8 - 2 * Dimens.paddingM) / 2) /
PlatformConfig.cameraPreviewAspectRatio; PlatformConfig.cameraPreviewAspectRatio;
double topBarOverflow = Dimens.readingContainerDefaultHeight - cameraViewHeight; double topBarOverflow = Dimens.readingContainerSingleValueHeight + // ISO & ND
-cameraViewHeight;
if (FeaturesConfig.equipmentProfilesEnabled) { if (FeaturesConfig.equipmentProfilesEnabled) {
topBarOverflow += Dimens.readingContainerSingleValueHeight; topBarOverflow += Dimens.readingContainerSingleValueHeight;
topBarOverflow += Dimens.paddingS; topBarOverflow += Dimens.paddingS;
} }
if (MeteringScreenLayout.of(context, MeteringScreenLayoutFeature.extremeExposurePairs)) {
topBarOverflow += Dimens.readingContainerDoubleValueHeight;
topBarOverflow += Dimens.paddingS;
}
if (MeteringScreenLayout.of(context, MeteringScreenLayoutFeature.reciprocity)) {
topBarOverflow += Dimens.readingContainerSingleValueHeight;
topBarOverflow += Dimens.paddingS;
}
return Column( return Column(
children: [ children: [

View file

@ -4,6 +4,7 @@ import 'package:lightmeter/data/models/film.dart';
import 'package:lightmeter/features.dart'; import 'package:lightmeter/features.dart';
import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/generated/l10n.dart';
import 'package:lightmeter/providers/equipment_profile_provider.dart'; import 'package:lightmeter/providers/equipment_profile_provider.dart';
import 'package:lightmeter/providers/features_provider.dart';
import 'package:lightmeter/res/dimens.dart'; import 'package:lightmeter/res/dimens.dart';
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart'; import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
@ -42,6 +43,7 @@ class ReadingsContainer extends StatelessWidget {
const _EquipmentProfilePicker(), const _EquipmentProfilePicker(),
const _InnerPadding(), const _InnerPadding(),
], ],
if (MeteringScreenLayout.of(context, MeteringScreenLayoutFeature.extremeExposurePairs)) ...[
ReadingValueContainer( ReadingValueContainer(
values: [ values: [
ReadingValue( ReadingValue(
@ -55,12 +57,15 @@ class ReadingsContainer extends StatelessWidget {
], ],
), ),
const _InnerPadding(), const _InnerPadding(),
],
if (MeteringScreenLayout.of(context, MeteringScreenLayoutFeature.reciprocity)) ...[
_FilmPicker( _FilmPicker(
values: Film.values, values: Film.values,
selectedValue: film, selectedValue: film,
onChanged: onFilmChanged, onChanged: onFilmChanged,
), ),
const _InnerPadding(), const _InnerPadding(),
],
Row( Row(
children: [ children: [
Expanded( Expanded(