diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index aded824..851228a 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -34,6 +34,10 @@ "calibrationMessageCameraOnly": "The accuracy of the readings measured by this application depends entirely on the rear camera of the device. Therefore, consider testing this application and setting up an EV calibration value that will give you the desired measurement results.", "camera": "Camera", "lightSensor": "Light sensor", + "equipment": "Equipment", + "isoValues": "ISO values", + "ndFilters": "ND filters", + "equipmentProfiles": "Equipment profiles", "general": "General", "keepScreenOn": "Keep screen on", "haptics": "Haptics", diff --git a/lib/res/dimens.dart b/lib/res/dimens.dart index 09c05a3..d9e279c 100644 --- a/lib/res/dimens.dart +++ b/lib/res/dimens.dart @@ -26,6 +26,9 @@ class Dimens { static const Duration durationML = Duration(milliseconds: 250); static const Duration durationL = Duration(milliseconds: 300); + static const double enabledOpacity = 1.0; + static const double disabledOpacity = 0.38; + // TopBar /// Probably this is a bad practice, but with text size locked, the height is always 212 static const double readingContainerHeight = 212; diff --git a/lib/screens/settings/components/equipment/components/equipment_profiles/widget_list_tile_equipment_profiles.dart b/lib/screens/settings/components/equipment/components/equipment_profiles/widget_list_tile_equipment_profiles.dart new file mode 100644 index 0000000..a99140f --- /dev/null +++ b/lib/screens/settings/components/equipment/components/equipment_profiles/widget_list_tile_equipment_profiles.dart @@ -0,0 +1,14 @@ +import 'package:flutter/material.dart'; +import 'package:lightmeter/generated/l10n.dart'; + +class EquipmentProfilesListTile extends StatelessWidget { + const EquipmentProfilesListTile({super.key}); + + @override + Widget build(BuildContext context) { + return ListTile( + leading: const Icon(Icons.camera), + title: Text(S.of(context).equipmentProfiles), + ); + } +} diff --git a/lib/screens/settings/components/equipment/components/iso_values/widget_list_tile_iso_values.dart b/lib/screens/settings/components/equipment/components/iso_values/widget_list_tile_iso_values.dart new file mode 100644 index 0000000..41f03f6 --- /dev/null +++ b/lib/screens/settings/components/equipment/components/iso_values/widget_list_tile_iso_values.dart @@ -0,0 +1,14 @@ +import 'package:flutter/material.dart'; +import 'package:lightmeter/generated/l10n.dart'; + +class IsoValuesListTile extends StatelessWidget { + const IsoValuesListTile({super.key}); + + @override + Widget build(BuildContext context) { + return ListTile( + leading: const Icon(Icons.iso), + title: Text(S.of(context).isoValues), + ); + } +} diff --git a/lib/screens/settings/components/equipment/components/nd_filters/widget_list_tile_nd_filters.dart b/lib/screens/settings/components/equipment/components/nd_filters/widget_list_tile_nd_filters.dart new file mode 100644 index 0000000..8599cc2 --- /dev/null +++ b/lib/screens/settings/components/equipment/components/nd_filters/widget_list_tile_nd_filters.dart @@ -0,0 +1,14 @@ +import 'package:flutter/material.dart'; +import 'package:lightmeter/generated/l10n.dart'; + +class NdFiltersListTile extends StatelessWidget { + const NdFiltersListTile({super.key}); + + @override + Widget build(BuildContext context) { + return ListTile( + leading: const Icon(Icons.filter_b_and_w), + title: Text(S.of(context).ndFilters), + ); + } +} diff --git a/lib/screens/settings/components/equipment/widget_settings_section_equipment.dart b/lib/screens/settings/components/equipment/widget_settings_section_equipment.dart new file mode 100644 index 0000000..179f288 --- /dev/null +++ b/lib/screens/settings/components/equipment/widget_settings_section_equipment.dart @@ -0,0 +1,25 @@ +import 'package:flutter/material.dart'; +import 'package:lightmeter/generated/l10n.dart'; +import 'package:lightmeter/screens/settings/components/shared/settings_section/widget_settings_section.dart'; + +import 'components/equipment_profiles/widget_list_tile_equipment_profiles.dart'; +import 'components/iso_values/widget_list_tile_iso_values.dart'; +import 'components/nd_filters/widget_list_tile_nd_filters.dart'; + + +class EquipmentSettingsSection extends StatelessWidget { + const EquipmentSettingsSection({super.key}); + + @override + Widget build(BuildContext context) { + return SettingsSection( + enabled: false, + title: S.of(context).equipment, + children: const [ + IsoValuesListTile(), + NdFiltersListTile(), + EquipmentProfilesListTile(), + ], + ); + } +} diff --git a/lib/screens/settings/components/shared/settings_section/widget_settings_section.dart b/lib/screens/settings/components/shared/settings_section/widget_settings_section.dart index 3bce4d8..cac35dd 100644 --- a/lib/screens/settings/components/shared/settings_section/widget_settings_section.dart +++ b/lib/screens/settings/components/shared/settings_section/widget_settings_section.dart @@ -4,10 +4,12 @@ import 'package:lightmeter/res/dimens.dart'; class SettingsSection extends StatelessWidget { final String title; final List children; + final bool enabled; const SettingsSection({ required this.title, required this.children, + this.enabled = true, super.key, }); @@ -23,22 +25,35 @@ class SettingsSection extends StatelessWidget { child: Card( child: Padding( padding: const EdgeInsets.symmetric(vertical: Dimens.paddingM), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: const EdgeInsets.only(left: Dimens.paddingM), - child: Text( - title, - style: Theme.of(context) - .textTheme - .labelLarge - ?.copyWith(color: Theme.of(context).colorScheme.onSurface), + child: Opacity( + opacity: enabled ? Dimens.enabledOpacity : Dimens.disabledOpacity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: Dimens.paddingM), + child: Row( + children: [ + Text( + title, + style: Theme.of(context) + .textTheme + .labelLarge + ?.copyWith(color: Theme.of(context).colorScheme.onSurface), + ), + const Spacer(), + if (!enabled) + const Icon( + Icons.lock, + size: Dimens.grid16, + ), + ], + ), ), - ), - ...children, - ], + ...children, + ], + ), ), ), ), diff --git a/lib/screens/settings/components/theme/components/primary_color/widget_list_tile_primary_color.dart b/lib/screens/settings/components/theme/components/primary_color/widget_list_tile_primary_color.dart index 2ed527b..760e567 100644 --- a/lib/screens/settings/components/theme/components/primary_color/widget_list_tile_primary_color.dart +++ b/lib/screens/settings/components/theme/components/primary_color/widget_list_tile_primary_color.dart @@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:lightmeter/data/models/dynamic_colors_state.dart'; import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/providers/theme_provider.dart'; +import 'package:lightmeter/res/dimens.dart'; import 'components/primary_color_picker_dialog/widget_dialog_picker_primary_color.dart'; @@ -13,7 +14,7 @@ class PrimaryColorListTile extends StatelessWidget { Widget build(BuildContext context) { if (context.watch() == DynamicColorState.enabled) { return Opacity( - opacity: 0.5, + opacity: Dimens.disabledOpacity, child: IgnorePointer( child: ListTile( leading: const Icon(Icons.palette), diff --git a/lib/screens/settings/screen_settings.dart b/lib/screens/settings/screen_settings.dart index 6f225ff..863d85d 100644 --- a/lib/screens/settings/screen_settings.dart +++ b/lib/screens/settings/screen_settings.dart @@ -3,6 +3,7 @@ import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/res/dimens.dart'; import 'components/about/widget_settings_section_about.dart'; +import 'components/equipment/widget_settings_section_equipment.dart'; import 'components/general/widget_settings_section_general.dart'; import 'components/metering/widget_settings_section_metering.dart'; import 'components/theme/widget_settings_section_theme.dart'; @@ -44,6 +45,7 @@ class SettingsScreen extends StatelessWidget { delegate: SliverChildListDelegate( [ const MeteringSettingsSection(), + const EquipmentSettingsSection(), const GeneralSettingsSection(), const ThemeSettingsSection(), const AboutSettingsSection(),