From fec5afece7973adcb9cdc370dd1af500c35c62fa Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Mon, 18 Sep 2023 16:52:25 +0200 Subject: [PATCH] added `IconButton` tooltips --- lib/l10n/intl_en.arb | 14 +++++++++++++- lib/l10n/intl_fr.arb | 14 +++++++++++++- lib/l10n/intl_ru.arb | 14 +++++++++++++- lib/l10n/intl_zh.arb | 14 +++++++++++++- .../bottom_controls/widget_bottom_controls.dart | 6 ++++++ .../widget_slider_exposure_offset.dart | 2 ++ .../widget_container_equipment_profile.dart | 4 ++++ .../screen_equipment_profile.dart | 5 +---- .../widget_dialog_calibration.dart | 1 + .../shared/dialog_filter/widget_dialog_filter.dart | 3 +++ lib/screens/settings/screen_settings.dart | 6 ------ .../shared/sliver_screen/screen_sliver.dart | 13 +++++++++++-- 12 files changed, 80 insertions(+), 16 deletions(-) diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 4e12ad8..259fd0c 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -96,5 +96,17 @@ "buyLightmeterPro": "Buy Lightmeter Pro", "lightmeterPro": "Lightmeter Pro", "lightmeterProDescription": "Unlocks extra features, such as equipment profiles containing filters for aperture, shutter speed, and more; and a list of films with compensation for what's known as reciprocity failure.\n\nThe source code of Lightmeter is available on GitHub. You are welcome to compile it yourself. However, if you want to support the development and receive new features and updates, consider purchasing Lightmeter Pro.", - "buy": "Buy" + "buy": "Buy", + "tooltipAdd": "Add", + "tooltipClose": "Close", + "tooltipExpand": "Expand", + "tooltipCollapse": "Collapse", + "tooltipCopy": "Copy", + "tooltipDelete": "Delete", + "tooltipSelectAll": "Select all", + "tooltipDesecelectAll": "Deselect all", + "tooltipResetToZero": "Reset to zero", + "tooltipUseLightSensor": "Use lightsensor", + "tooltipUseCamera": "Use camera", + "tooltipOpenSettings": "Open settings" } \ No newline at end of file diff --git a/lib/l10n/intl_fr.arb b/lib/l10n/intl_fr.arb index 5946d5b..2d6d889 100644 --- a/lib/l10n/intl_fr.arb +++ b/lib/l10n/intl_fr.arb @@ -96,5 +96,17 @@ "buyLightmeterPro": "Acheter Lightmeter Pro", "lightmeterPro": "Lightmeter Pro", "lightmeterProDescription": "Déverrouille des fonctionnalités supplémentaires, telles que des profils d'équipement contenant des filtres pour l'ouverture, la vitesse d'obturation et plus encore, ainsi qu'une liste de films avec une compensation pour ce que l'on appelle l'échec de réciprocité.\n\nLe code source du Lightmeter est disponible sur GitHub. Vous pouvez le compiler vous-même. Cependant, si vous souhaitez soutenir le développement et recevoir de nouvelles fonctionnalités et mises à jour, envisagez d'acheter Lightmeter Pro.", - "buy": "Acheter" + "buy": "Acheter", + "tooltipAdd": "Ajouter", + "tooltipClose": "Fermer", + "tooltipExpand": "Élargir", + "tooltipCollapse": "Effondrement", + "tooltipCopy": "Copie", + "tooltipDelete": "Supprimer", + "tooltipSelectAll": "Tout sélectionner", + "tooltipDesecelectAll": "Désélectionner tout", + "tooltipResetToZero": "Remise à zéro", + "tooltipUseLightSensor": "Utiliser un capteur de lumière", + "tooltipUseCamera": "Utiliser la caméra", + "tooltipOpenSettings": "Ouvrir les paramètres" } \ No newline at end of file diff --git a/lib/l10n/intl_ru.arb b/lib/l10n/intl_ru.arb index 9f428c4..72c42f1 100644 --- a/lib/l10n/intl_ru.arb +++ b/lib/l10n/intl_ru.arb @@ -96,5 +96,17 @@ "buyLightmeterPro": "Купить Lightmeter Pro", "lightmeterPro": "Lightmeter Pro", "lightmeterProDescription": "Даёт доступ к таким функциям как профили оборудования, содержащие фильтры для диафрагмы, выдержки и других значений, а также набору пленок с компенсацией эффекта Шварцшильда.\n\nИсходный код Lightmeter доступен на GitHub. Вы можете собрать его самостоятельно. Однако если вы хотите поддержать разработку и получать новые функции и обновления, то приобретите Lightmeter Pro.", - "buy": "Купить" + "buy": "Купить", + "tooltipAdd": "Добавить", + "tooltipClose": "Закрыть", + "tooltipExpand": "Развернуть", + "tooltipCollapse": "Свернуть", + "tooltipCopy": "Скопировать", + "tooltipDelete": "Удалить", + "tooltipSelectAll": "Выбрать все", + "tooltipDesecelectAll": "Отменить все", + "tooltipResetToZero": "Сбросить до 0", + "tooltipUseLightSensor": "Использовать датчик освещенности", + "tooltipUseCamera": "Использовать камеру", + "tooltipOpenSettings": "Открыть настройки" } \ No newline at end of file diff --git a/lib/l10n/intl_zh.arb b/lib/l10n/intl_zh.arb index 92f19ee..391e268 100644 --- a/lib/l10n/intl_zh.arb +++ b/lib/l10n/intl_zh.arb @@ -96,5 +96,17 @@ "buyLightmeterPro": "Buy Lightmeter Pro", "lightmeterPro": "Lightmeter Pro", "lightmeterProDescription": "Unlocks extra features, such as equipment profiles containing filters for aperture, shutter speed, and more; and a list of films with compensation for what's known as reciprocity failure.\n\nThe source code of Lightmeter is available on GitHub. You are welcome to compile it yourself. However, if you want to support the development and receive new features and updates, consider purchasing Lightmeter Pro.", - "buy": "Buy" + "buy": "Buy", + "tooltipAdd": "Add", + "tooltipClose": "Close", + "tooltipExpand": "Expand", + "tooltipCollapse": "Collapse", + "tooltipCopy": "Copy", + "tooltipDelete": "Delete", + "tooltipSelectAll": "Select all", + "tooltipDesecelectAll": "Deselect all", + "resetToZero": "Reset to zero", + "tooltipUseLightSensor": "Use lightsensor", + "tooltipUseCamera": "Use camera", + "tooltipOpenSettings": "Open settings" } \ No newline at end of file diff --git a/lib/screens/metering/components/bottom_controls/widget_bottom_controls.dart b/lib/screens/metering/components/bottom_controls/widget_bottom_controls.dart index 54ea810..31ecac4 100644 --- a/lib/screens/metering/components/bottom_controls/widget_bottom_controls.dart +++ b/lib/screens/metering/components/bottom_controls/widget_bottom_controls.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:lightmeter/data/models/ev_source_type.dart'; +import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/providers/user_preferences_provider.dart'; import 'package:lightmeter/res/dimens.dart'; import 'package:lightmeter/screens/metering/components/bottom_controls/components/measure_button/widget_button_measure.dart'; @@ -46,6 +47,10 @@ class MeteringBottomControls extends StatelessWidget { ? Icons.camera_rear : Icons.wb_incandescent, ), + tooltip: + UserPreferencesProvider.evSourceTypeOf(context) != EvSourceType.camera + ? S.of(context).tooltipUseCamera + : S.of(context).tooltipUseLightSensor, ), ), ) @@ -61,6 +66,7 @@ class MeteringBottomControls extends StatelessWidget { child: IconButton( onPressed: onSettings, icon: const Icon(Icons.settings), + tooltip: S.of(context).tooltipOpenSettings, ), ), ), diff --git a/lib/screens/metering/components/camera_container/components/camera_controls/components/exposure_offset_slider/widget_slider_exposure_offset.dart b/lib/screens/metering/components/camera_container/components/camera_controls/components/exposure_offset_slider/widget_slider_exposure_offset.dart index 87539ee..484ee4b 100644 --- a/lib/screens/metering/components/camera_container/components/camera_controls/components/exposure_offset_slider/widget_slider_exposure_offset.dart +++ b/lib/screens/metering/components/camera_container/components/camera_controls/components/exposure_offset_slider/widget_slider_exposure_offset.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/res/dimens.dart'; import 'package:lightmeter/screens/shared/centered_slider/widget_slider_centered.dart'; import 'package:lightmeter/utils/to_string_signed.dart'; @@ -22,6 +23,7 @@ class ExposureOffsetSlider extends StatelessWidget { IconButton( icon: const Icon(Icons.sync), onPressed: value != 0.0 ? () => onChanged(0.0) : null, + tooltip: S.of(context).tooltipResetToZero, ), Expanded( child: Row( diff --git a/lib/screens/settings/components/equipment/components/equipment_profiles/components/equipment_profile_screen/components/equipment_profile_container/widget_container_equipment_profile.dart b/lib/screens/settings/components/equipment/components/equipment_profiles/components/equipment_profile_screen/components/equipment_profile_container/widget_container_equipment_profile.dart index 4c404a1..bca15d8 100644 --- a/lib/screens/settings/components/equipment/components/equipment_profiles/components/equipment_profile_screen/components/equipment_profile_container/widget_container_equipment_profile.dart +++ b/lib/screens/settings/components/equipment/components/equipment_profiles/components/equipment_profile_screen/components/equipment_profile_container/widget_container_equipment_profile.dart @@ -2,6 +2,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; +import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/res/dimens.dart'; import 'package:lightmeter/screens/settings/components/equipment/components/equipment_profiles/components/equipment_profile_screen/components/equipment_profile_container/components/equipment_list_tiles/widget_list_tiles_equipments.dart'; import 'package:lightmeter/screens/settings/components/equipment/components/equipment_profiles/components/equipment_profile_screen/components/equipment_profile_name_dialog/widget_dialog_equipment_profile_name.dart'; @@ -188,6 +189,7 @@ class _AnimatedArrowButton extends AnimatedWidget { angle: _progress.value * pi, child: const Icon(Icons.keyboard_arrow_down), ), + tooltip: _progress.value == 0 ? S.of(context).tooltipExpand : S.of(context).tooltipCollapse, ); } } @@ -246,10 +248,12 @@ class _AnimatedEquipmentListTiles extends AnimatedWidget { IconButton( onPressed: onCopy, icon: const Icon(Icons.copy), + tooltip: S.of(context).tooltipCopy, ), IconButton( onPressed: onDelete, icon: const Icon(Icons.delete), + tooltip: S.of(context).tooltipDelete, ), ], ), diff --git a/lib/screens/settings/components/equipment/components/equipment_profiles/components/equipment_profile_screen/screen_equipment_profile.dart b/lib/screens/settings/components/equipment/components/equipment_profiles/components/equipment_profile_screen/screen_equipment_profile.dart index 5bb867e..abacf7c 100644 --- a/lib/screens/settings/components/equipment/components/equipment_profiles/components/equipment_profile_screen/screen_equipment_profile.dart +++ b/lib/screens/settings/components/equipment/components/equipment_profiles/components/equipment_profile_screen/screen_equipment_profile.dart @@ -34,10 +34,7 @@ class _EquipmentProfilesScreenState extends State { IconButton( onPressed: _addProfile, icon: const Icon(Icons.add), - ), - IconButton( - onPressed: Navigator.of(context).pop, - icon: const Icon(Icons.close), + tooltip: S.of(context).tooltipAdd, ), ], slivers: profilesCount == 1 diff --git a/lib/screens/settings/components/metering/components/calibration/components/calibration_dialog/widget_dialog_calibration.dart b/lib/screens/settings/components/metering/components/calibration/components/calibration_dialog/widget_dialog_calibration.dart index 69a4f00..56c4ed0 100644 --- a/lib/screens/settings/components/metering/components/calibration/components/calibration_dialog/widget_dialog_calibration.dart +++ b/lib/screens/settings/components/metering/components/calibration/components/calibration_dialog/widget_dialog_calibration.dart @@ -117,6 +117,7 @@ class _CalibrationUnit extends StatelessWidget { IconButton( onPressed: onReset, icon: const Icon(Icons.sync), + tooltip: S.of(context).tooltipResetToZero, ), ], ) diff --git a/lib/screens/settings/components/shared/dialog_filter/widget_dialog_filter.dart b/lib/screens/settings/components/shared/dialog_filter/widget_dialog_filter.dart index 8bafcae..af2b35d 100644 --- a/lib/screens/settings/components/shared/dialog_filter/widget_dialog_filter.dart +++ b/lib/screens/settings/components/shared/dialog_filter/widget_dialog_filter.dart @@ -85,6 +85,9 @@ class _DialogFilterState extends State> { padding: EdgeInsets.zero, icon: Icon(_hasAnyUnselected ? Icons.select_all : Icons.deselect), onPressed: _toggleAll, + tooltip: _hasAnyUnselected + ? S.of(context).tooltipSelectAll + : S.of(context).tooltipDesecelectAll, ), ), const Spacer(), diff --git a/lib/screens/settings/screen_settings.dart b/lib/screens/settings/screen_settings.dart index 3f1c0a6..4102282 100644 --- a/lib/screens/settings/screen_settings.dart +++ b/lib/screens/settings/screen_settings.dart @@ -35,12 +35,6 @@ class _SettingsScreenState extends State { return ScaffoldMessenger( child: SliverScreen( title: S.of(context).settings, - appBarActions: [ - IconButton( - onPressed: Navigator.of(context).pop, - icon: const Icon(Icons.close), - ), - ], slivers: [ SliverList( delegate: SliverChildListDelegate( diff --git a/lib/screens/shared/sliver_screen/screen_sliver.dart b/lib/screens/shared/sliver_screen/screen_sliver.dart index 20d2e66..97ed830 100644 --- a/lib/screens/shared/sliver_screen/screen_sliver.dart +++ b/lib/screens/shared/sliver_screen/screen_sliver.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/res/dimens.dart'; class SliverScreen extends StatelessWidget { @@ -8,7 +9,7 @@ class SliverScreen extends StatelessWidget { const SliverScreen({ required this.title, - required this.appBarActions, + this.appBarActions = const [], required this.slivers, super.key, }); @@ -36,7 +37,15 @@ class SliverScreen extends StatelessWidget { ), ), ), - actions: appBarActions, + actions: [ + ...appBarActions, + if (Navigator.of(context).canPop()) + IconButton( + onPressed: Navigator.of(context).pop, + icon: const Icon(Icons.close), + tooltip: S.of(context).tooltipClose, + ), + ], ), ...slivers, ],