mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 07:20:39 +00:00
refined topbar height difference calculation
This commit is contained in:
parent
12d44d6bab
commit
f084efde5d
3 changed files with 36 additions and 22 deletions
|
@ -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;
|
||||||
|
|
|
@ -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: [
|
||||||
|
|
|
@ -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,25 +43,29 @@ class ReadingsContainer extends StatelessWidget {
|
||||||
const _EquipmentProfilePicker(),
|
const _EquipmentProfilePicker(),
|
||||||
const _InnerPadding(),
|
const _InnerPadding(),
|
||||||
],
|
],
|
||||||
ReadingValueContainer(
|
if (MeteringScreenLayout.of(context, MeteringScreenLayoutFeature.extremeExposurePairs)) ...[
|
||||||
values: [
|
ReadingValueContainer(
|
||||||
ReadingValue(
|
values: [
|
||||||
label: S.of(context).fastestExposurePair,
|
ReadingValue(
|
||||||
value: fastest != null ? fastest!.toString() : '-',
|
label: S.of(context).fastestExposurePair,
|
||||||
),
|
value: fastest != null ? fastest!.toString() : '-',
|
||||||
ReadingValue(
|
),
|
||||||
label: S.of(context).slowestExposurePair,
|
ReadingValue(
|
||||||
value: fastest != null ? slowest!.toString() : '-',
|
label: S.of(context).slowestExposurePair,
|
||||||
),
|
value: fastest != null ? slowest!.toString() : '-',
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
const _InnerPadding(),
|
),
|
||||||
_FilmPicker(
|
const _InnerPadding(),
|
||||||
values: Film.values,
|
],
|
||||||
selectedValue: film,
|
if (MeteringScreenLayout.of(context, MeteringScreenLayoutFeature.reciprocity)) ...[
|
||||||
onChanged: onFilmChanged,
|
_FilmPicker(
|
||||||
),
|
values: Film.values,
|
||||||
const _InnerPadding(),
|
selectedValue: film,
|
||||||
|
onChanged: onFilmChanged,
|
||||||
|
),
|
||||||
|
const _InnerPadding(),
|
||||||
|
],
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|
Loading…
Reference in a new issue