From 31bf292eb873248cfe0580cedbc488bd307f7f6c Mon Sep 17 00:00:00 2001 From: jld3103 Date: Sun, 7 May 2023 15:36:40 +0200 Subject: [PATCH] Add tooltips to all IconButtons --- packages/neon/neon/lib/l10n/en.arb | 38 +++++- .../neon/neon/lib/l10n/localizations.dart | 120 ++++++++++++++++-- .../neon/neon/lib/l10n/localizations_en.dart | 62 ++++++++- .../neon/lib/src/pages/account_settings.dart | 2 + packages/neon/neon/lib/src/pages/home.dart | 68 +++++----- packages/neon/neon/lib/src/pages/login.dart | 4 +- .../lib/src/pages/nextcloud_app_settings.dart | 1 + .../neon/neon/lib/src/pages/settings.dart | 1 + .../neon/neon/lib/src/widgets/exception.dart | 29 +++-- packages/neon/neon_files/lib/pages/main.dart | 1 + .../neon_files/lib/widgets/browser_view.dart | 43 +++++-- .../neon/neon_news/lib/pages/article.dart | 8 ++ .../neon_news/lib/widgets/articles_view.dart | 11 +- .../widgets/feed_floating_action_button.dart | 1 + .../neon_news/lib/widgets/feeds_view.dart | 3 +- .../folder_floating_action_button.dart | 1 + .../lib/dialogs/select_category.dart | 2 +- packages/neon/neon_notes/lib/pages/note.dart | 10 +- .../lib/widgets/category_select.dart | 20 ++- .../widgets/notes_floating_action_button.dart | 1 + .../neon_notes/lib/widgets/notes_view.dart | 9 +- .../neon_notifications/lib/pages/main.dart | 1 + 22 files changed, 333 insertions(+), 103 deletions(-) diff --git a/packages/neon/neon/lib/l10n/en.arb b/packages/neon/neon/lib/l10n/en.arb index 545d54fd..0ddc8716 100644 --- a/packages/neon/neon/lib/l10n/en.arb +++ b/packages/neon/neon/lib/l10n/en.arb @@ -10,6 +10,7 @@ "loginOpenAgain": "Open again", "loginSwitchToBrowserWindow": "Please switch to the browser window that just opened and proceed there", "loginWorksWith": "works with", + "loginRestart": "Restart login", "errorAccountAlreadyExists": "The account you are trying to add already exists", "errorCredentialsForAccountNoLongerMatch": "The credentials for this account no longer match", "errorServerHadAProblemProcessingYourRequest": "The server had a problem while processing your request. You might want to try again", @@ -63,10 +64,20 @@ "nextPushSupportedInstall": "Install NextPush", "settings": "Settings", "settingsApps": "Apps", + "settingsAccount": "Account", "settingsExport": "Export settings", "settingsImport": "Import settings", "settingsImportWrongFileExtension": "Settings import has wrong file extension (has to be .json.base64)", + "settingsResetAll": "Reset all settings", "settingsResetAllConfirmation": "Do you want to reset all settings?", + "settingsResetFor": "Reset all settings for {name}", + "@settingsResetFor": { + "placeholders": { + "name": { + "type": "String" + } + } + }, "settingsResetForConfirmation": "Do you want to reset all settings for {name}?", "@settingsResetForConfirmation": { "placeholders": { @@ -112,6 +123,7 @@ "globalOptionsNavigationModeDrawer": "Drawer", "globalOptionsNavigationModeDrawerAlwaysVisible": "Drawer always visible", "globalOptionsNavigationModeQuickBar": "Quick bar", + "accountOptionsRemove": "Remove account", "accountOptionsRemoveConfirm": "Are you sure you want to remove the account {id}?", "@accountOptionsRemoveConfirm": { "placeholders": { @@ -195,6 +207,14 @@ } } }, + "filesGoToPath": "Go to /{path}", + "@filesGoToPath": { + "placeholders": { + "path": { + "type": "String" + } + } + }, "filesOptionsFilesSortPropertyName": "Name", "filesOptionsFilesSortPropertyModifiedDate": "Last modified", "filesOptionsFilesSortPropertySize": "Size", @@ -242,9 +262,16 @@ } } }, + "newsArticleStar": "Star article", + "newsArticleUnstar": "Unstar article", + "newsArticleMarkRead": "Mark article as read", + "newsArticleMarkUnread": "Mark article as unread", + "newsArticleOpenLink": "Open in browser", + "newsArticleShare": "Share", "newsShowFeedURL": "Show URL", "newsCopyFeedURL": "Copy URL", "newsCopiedFeedURL": "URL copied to clipboard", + "newsShowFeedErrorMessage": "Show error message", "newsCopyFeedErrorMessage": "Copy error message", "newsCopiedFeedErrorMessage": "Error message copied to clipboard", "newsOptionsDefaultCategory": "Category to show by default", @@ -273,7 +300,6 @@ "notesCategories": "Categories", "notesCreateNote": "Create note", "notesCategory": "Category", - "notesChangeCategory": "Change category", "notesSetCategory": "Set category", "notesNoteTitle": "Title", "notesNoteChangedOnServer": "The note has been changed on the server. Please refresh and try again", @@ -286,8 +312,11 @@ } }, "notesUncategorized": "Uncategorized", - "notesEdit": "Edit", - "notesPreview": "Preview", + "notesShowEditor": "Edit note", + "notesShowPreview": "Preview note", + "notesStar": "Star note", + "notesUnstar": "Unstar note", + "notesChangeCategory": "Change note category", "notesDeleteNoteConfirm": "Are you sure you want to delete the note '{name}'?", "@notesDeleteNoteConfirm": { "placeholders": { @@ -308,5 +337,6 @@ "notesOptionsCategoriesSortProperty": "How to sort categories", "notesOptionsCategoriesSortPropertyAlphabetical": "Alphabetical", "notesOptionsCategoriesSortPropertyNotesCount": "Count of notes", - "notificationsNextcloudAppNotImplementedYet": "Sorry, this Nextcloud app has not been implemented yet" + "notificationsNextcloudAppNotImplementedYet": "Sorry, this Nextcloud app has not been implemented yet", + "notificationsDismissAll": "Dismiss all notifications" } diff --git a/packages/neon/neon/lib/l10n/localizations.dart b/packages/neon/neon/lib/l10n/localizations.dart index 5c4ee6b5..463bbb20 100644 --- a/packages/neon/neon/lib/l10n/localizations.dart +++ b/packages/neon/neon/lib/l10n/localizations.dart @@ -119,6 +119,12 @@ abstract class AppLocalizations { /// **'works with'** String get loginWorksWith; + /// No description provided for @loginRestart. + /// + /// In en, this message translates to: + /// **'Restart login'** + String get loginRestart; + /// No description provided for @errorAccountAlreadyExists. /// /// In en, this message translates to: @@ -311,6 +317,12 @@ abstract class AppLocalizations { /// **'Apps'** String get settingsApps; + /// No description provided for @settingsAccount. + /// + /// In en, this message translates to: + /// **'Account'** + String get settingsAccount; + /// No description provided for @settingsExport. /// /// In en, this message translates to: @@ -329,12 +341,24 @@ abstract class AppLocalizations { /// **'Settings import has wrong file extension (has to be .json.base64)'** String get settingsImportWrongFileExtension; + /// No description provided for @settingsResetAll. + /// + /// In en, this message translates to: + /// **'Reset all settings'** + String get settingsResetAll; + /// No description provided for @settingsResetAllConfirmation. /// /// In en, this message translates to: /// **'Do you want to reset all settings?'** String get settingsResetAllConfirmation; + /// No description provided for @settingsResetFor. + /// + /// In en, this message translates to: + /// **'Reset all settings for {name}'** + String settingsResetFor(String name); + /// No description provided for @settingsResetForConfirmation. /// /// In en, this message translates to: @@ -563,6 +587,12 @@ abstract class AppLocalizations { /// **'Quick bar'** String get globalOptionsNavigationModeQuickBar; + /// No description provided for @accountOptionsRemove. + /// + /// In en, this message translates to: + /// **'Remove account'** + String get accountOptionsRemove; + /// No description provided for @accountOptionsRemoveConfirm. /// /// In en, this message translates to: @@ -737,6 +767,12 @@ abstract class AppLocalizations { /// **'Are you sure you want to download a file that is bigger than {warningSize} ({actualSize})?'** String filesConfirmDownloadSizeWarning(String warningSize, String actualSize); + /// No description provided for @filesGoToPath. + /// + /// In en, this message translates to: + /// **'Go to /{path}'** + String filesGoToPath(String path); + /// No description provided for @filesOptionsFilesSortPropertyName. /// /// In en, this message translates to: @@ -893,6 +929,42 @@ abstract class AppLocalizations { /// **'{count} unread'** String newsUnreadArticles(int count); + /// No description provided for @newsArticleStar. + /// + /// In en, this message translates to: + /// **'Star article'** + String get newsArticleStar; + + /// No description provided for @newsArticleUnstar. + /// + /// In en, this message translates to: + /// **'Unstar article'** + String get newsArticleUnstar; + + /// No description provided for @newsArticleMarkRead. + /// + /// In en, this message translates to: + /// **'Mark article as read'** + String get newsArticleMarkRead; + + /// No description provided for @newsArticleMarkUnread. + /// + /// In en, this message translates to: + /// **'Mark article as unread'** + String get newsArticleMarkUnread; + + /// No description provided for @newsArticleOpenLink. + /// + /// In en, this message translates to: + /// **'Open in browser'** + String get newsArticleOpenLink; + + /// No description provided for @newsArticleShare. + /// + /// In en, this message translates to: + /// **'Share'** + String get newsArticleShare; + /// No description provided for @newsShowFeedURL. /// /// In en, this message translates to: @@ -911,6 +983,12 @@ abstract class AppLocalizations { /// **'URL copied to clipboard'** String get newsCopiedFeedURL; + /// No description provided for @newsShowFeedErrorMessage. + /// + /// In en, this message translates to: + /// **'Show error message'** + String get newsShowFeedErrorMessage; + /// No description provided for @newsCopyFeedErrorMessage. /// /// In en, this message translates to: @@ -1079,12 +1157,6 @@ abstract class AppLocalizations { /// **'Category'** String get notesCategory; - /// No description provided for @notesChangeCategory. - /// - /// In en, this message translates to: - /// **'Change category'** - String get notesChangeCategory; - /// No description provided for @notesSetCategory. /// /// In en, this message translates to: @@ -1115,17 +1187,35 @@ abstract class AppLocalizations { /// **'Uncategorized'** String get notesUncategorized; - /// No description provided for @notesEdit. + /// No description provided for @notesShowEditor. /// /// In en, this message translates to: - /// **'Edit'** - String get notesEdit; + /// **'Edit note'** + String get notesShowEditor; - /// No description provided for @notesPreview. + /// No description provided for @notesShowPreview. /// /// In en, this message translates to: - /// **'Preview'** - String get notesPreview; + /// **'Preview note'** + String get notesShowPreview; + + /// No description provided for @notesStar. + /// + /// In en, this message translates to: + /// **'Star note'** + String get notesStar; + + /// No description provided for @notesUnstar. + /// + /// In en, this message translates to: + /// **'Unstar note'** + String get notesUnstar; + + /// No description provided for @notesChangeCategory. + /// + /// In en, this message translates to: + /// **'Change note category'** + String get notesChangeCategory; /// No description provided for @notesDeleteNoteConfirm. /// @@ -1210,6 +1300,12 @@ abstract class AppLocalizations { /// In en, this message translates to: /// **'Sorry, this Nextcloud app has not been implemented yet'** String get notificationsNextcloudAppNotImplementedYet; + + /// No description provided for @notificationsDismissAll. + /// + /// In en, this message translates to: + /// **'Dismiss all notifications'** + String get notificationsDismissAll; } class _AppLocalizationsDelegate extends LocalizationsDelegate { diff --git a/packages/neon/neon/lib/l10n/localizations_en.dart b/packages/neon/neon/lib/l10n/localizations_en.dart index 2992257d..e2f9f7a2 100644 --- a/packages/neon/neon/lib/l10n/localizations_en.dart +++ b/packages/neon/neon/lib/l10n/localizations_en.dart @@ -35,6 +35,9 @@ class AppLocalizationsEn extends AppLocalizations { @override String get loginWorksWith => 'works with'; + @override + String get loginRestart => 'Restart login'; + @override String get errorAccountAlreadyExists => 'The account you are trying to add already exists'; @@ -141,6 +144,9 @@ class AppLocalizationsEn extends AppLocalizations { @override String get settingsApps => 'Apps'; + @override + String get settingsAccount => 'Account'; + @override String get settingsExport => 'Export settings'; @@ -150,9 +156,17 @@ class AppLocalizationsEn extends AppLocalizations { @override String get settingsImportWrongFileExtension => 'Settings import has wrong file extension (has to be .json.base64)'; + @override + String get settingsResetAll => 'Reset all settings'; + @override String get settingsResetAllConfirmation => 'Do you want to reset all settings?'; + @override + String settingsResetFor(String name) { + return 'Reset all settings for $name'; + } + @override String settingsResetForConfirmation(String name) { return 'Do you want to reset all settings for $name?'; @@ -270,6 +284,9 @@ class AppLocalizationsEn extends AppLocalizations { @override String get globalOptionsNavigationModeQuickBar => 'Quick bar'; + @override + String get accountOptionsRemove => 'Remove account'; + @override String accountOptionsRemoveConfirm(String id) { return 'Are you sure you want to remove the account $id?'; @@ -369,6 +386,11 @@ class AppLocalizationsEn extends AppLocalizations { return 'Are you sure you want to download a file that is bigger than $warningSize ($actualSize)?'; } + @override + String filesGoToPath(String path) { + return 'Go to /$path'; + } + @override String get filesOptionsFilesSortPropertyName => 'Name'; @@ -453,6 +475,24 @@ class AppLocalizationsEn extends AppLocalizations { return '$count unread'; } + @override + String get newsArticleStar => 'Star article'; + + @override + String get newsArticleUnstar => 'Unstar article'; + + @override + String get newsArticleMarkRead => 'Mark article as read'; + + @override + String get newsArticleMarkUnread => 'Mark article as unread'; + + @override + String get newsArticleOpenLink => 'Open in browser'; + + @override + String get newsArticleShare => 'Share'; + @override String get newsShowFeedURL => 'Show URL'; @@ -462,6 +502,9 @@ class AppLocalizationsEn extends AppLocalizations { @override String get newsCopiedFeedURL => 'URL copied to clipboard'; + @override + String get newsShowFeedErrorMessage => 'Show error message'; + @override String get newsCopyFeedErrorMessage => 'Copy error message'; @@ -546,9 +589,6 @@ class AppLocalizationsEn extends AppLocalizations { @override String get notesCategory => 'Category'; - @override - String get notesChangeCategory => 'Change category'; - @override String get notesSetCategory => 'Set category'; @@ -567,10 +607,19 @@ class AppLocalizationsEn extends AppLocalizations { String get notesUncategorized => 'Uncategorized'; @override - String get notesEdit => 'Edit'; + String get notesShowEditor => 'Edit note'; + + @override + String get notesShowPreview => 'Preview note'; + + @override + String get notesStar => 'Star note'; @override - String get notesPreview => 'Preview'; + String get notesUnstar => 'Unstar note'; + + @override + String get notesChangeCategory => 'Change note category'; @override String notesDeleteNoteConfirm(String name) { @@ -615,4 +664,7 @@ class AppLocalizationsEn extends AppLocalizations { @override String get notificationsNextcloudAppNotImplementedYet => 'Sorry, this Nextcloud app has not been implemented yet'; + + @override + String get notificationsDismissAll => 'Dismiss all notifications'; } diff --git a/packages/neon/neon/lib/src/pages/account_settings.dart b/packages/neon/neon/lib/src/pages/account_settings.dart index fe525331..69e8bd52 100644 --- a/packages/neon/neon/lib/src/pages/account_settings.dart +++ b/packages/neon/neon/lib/src/pages/account_settings.dart @@ -33,6 +33,7 @@ class AccountSettingsPage extends StatelessWidget { Navigator.of(context).pop(); } }, + tooltip: AppLocalizations.of(context).accountOptionsRemove, icon: const Icon(MdiIcons.delete), ), IconButton( @@ -46,6 +47,7 @@ class AccountSettingsPage extends StatelessWidget { await _options.reset(); } }, + tooltip: AppLocalizations.of(context).settingsResetFor(_name), icon: const Icon(MdiIcons.cogRefresh), ), ], diff --git a/packages/neon/neon/lib/src/pages/home.dart b/packages/neon/neon/lib/src/pages/home.dart index eee88018..114fa770 100644 --- a/packages/neon/neon/lib/src/pages/home.dart +++ b/packages/neon/neon/lib/src/pages/home.dart @@ -245,16 +245,14 @@ class _HomePageState extends State { margin: const EdgeInsets.symmetric( vertical: 5, ), - child: Tooltip( - message: account.client.humanReadableID, - child: IconButton( - onPressed: () { - _accountsBloc.setActiveAccount(account); - }, - icon: IntrinsicHeight( - child: NeonAccountAvatar( - account: account, - ), + child: IconButton( + onPressed: () { + _accountsBloc.setActiveAccount(account); + }, + tooltip: account.client.humanReadableID, + icon: IntrinsicHeight( + child: NeonAccountAvatar( + account: account, ), ), ), @@ -358,17 +356,15 @@ class _HomePageState extends State { builder: (final context, final unreadCounterSnapshot) { final unreadCount = unreadCounterSnapshot.data ?? 0; if (isQuickBar) { - return Tooltip( - message: appImplementation.name(context), - child: IconButton( - onPressed: () async { - await _appsBloc.setActiveApp(appImplementation.id); - }, - icon: NeonAppImplementationIcon( - appImplementation: appImplementation, - unreadCount: unreadCount, - color: Theme.of(context).colorScheme.primary, - ), + return IconButton( + onPressed: () async { + await _appsBloc.setActiveApp(appImplementation.id); + }, + tooltip: appImplementation.name(context), + icon: NeonAppImplementationIcon( + appImplementation: appImplementation, + unreadCount: unreadCount, + color: Theme.of(context).colorScheme.primary, ), ); } @@ -413,11 +409,12 @@ class _HomePageState extends State { ), if (isQuickBar) ...[ IconButton( + onPressed: _openSettings, + tooltip: AppLocalizations.of(context).settings, icon: Icon( Icons.settings, color: Theme.of(context).appBarTheme.foregroundColor, ), - onPressed: _openSettings, ), ] else ...[ ListTile( @@ -515,6 +512,15 @@ class _HomePageState extends State { final unreadCount = unreadCounterSnapshot.data ?? 0; return IconButton( key: Key('app-${notificationsAppImplementation.data!.id}'), + onPressed: () async { + await _openNotifications( + notificationsAppImplementation.data!, + accounts, + account, + ); + }, + tooltip: AppLocalizations.of(context) + .appImplementationName(notificationsAppImplementation.data!.id), icon: NeonAppImplementationIcon( appImplementation: notificationsAppImplementation.data!, unreadCount: unreadCount, @@ -523,23 +529,11 @@ class _HomePageState extends State { : Theme.of(context).colorScheme.onBackground, size: const Size.square(kAvatarSize * 2 / 3), ), - onPressed: () async { - await _openNotifications( - notificationsAppImplementation.data!, - accounts, - account, - ); - }, ); }, ), ], IconButton( - icon: IntrinsicWidth( - child: NeonAccountAvatar( - account: account, - ), - ), onPressed: () async { await Navigator.of(context).push( MaterialPageRoute( @@ -550,6 +544,12 @@ class _HomePageState extends State { ), ); }, + tooltip: AppLocalizations.of(context).settingsAccount, + icon: IntrinsicWidth( + child: NeonAccountAvatar( + account: account, + ), + ), ), ], ), diff --git a/packages/neon/neon/lib/src/pages/login.dart b/packages/neon/neon/lib/src/pages/login.dart index ba841782..e998f2d7 100644 --- a/packages/neon/neon/lib/src/pages/login.dart +++ b/packages/neon/neon/lib/src/pages/login.dart @@ -126,7 +126,7 @@ class _LoginPageState extends State { appBar: serverConnectionStateSnapshot.data == ServerConnectionState.success || (accountsSnapshot.data?.isNotEmpty ?? false) ? AppBar( - leading: IconButton( + leading: BackButton( onPressed: () { if (accountsSnapshot.data?.isNotEmpty ?? false) { Navigator.of(context).pop(); @@ -134,12 +134,12 @@ class _LoginPageState extends State { _loginBloc.setServerURL(null); } }, - icon: const Icon(Icons.arrow_back), ), actions: [ if (serverConnectionStateSnapshot.data != null) ...[ IconButton( onPressed: _loginBloc.refresh, + tooltip: AppLocalizations.of(context).loginRestart, icon: const Icon(Icons.refresh), ), ], diff --git a/packages/neon/neon/lib/src/pages/nextcloud_app_settings.dart b/packages/neon/neon/lib/src/pages/nextcloud_app_settings.dart index 21486818..aef3b942 100644 --- a/packages/neon/neon/lib/src/pages/nextcloud_app_settings.dart +++ b/packages/neon/neon/lib/src/pages/nextcloud_app_settings.dart @@ -25,6 +25,7 @@ class NextcloudAppSettingsPage extends StatelessWidget { await appImplementation.options.reset(); } }, + tooltip: AppLocalizations.of(context).settingsResetFor(appImplementation.name(context)), icon: const Icon(MdiIcons.cogRefresh), ), ], diff --git a/packages/neon/neon/lib/src/pages/settings.dart b/packages/neon/neon/lib/src/pages/settings.dart index 7b201f8d..95c956f1 100644 --- a/packages/neon/neon/lib/src/pages/settings.dart +++ b/packages/neon/neon/lib/src/pages/settings.dart @@ -35,6 +35,7 @@ class _SettingsPageState extends State { } } }, + tooltip: AppLocalizations.of(context).settingsResetAll, icon: const Icon(MdiIcons.cogRefresh), ), ], diff --git a/packages/neon/neon/lib/src/widgets/exception.dart b/packages/neon/neon/lib/src/widgets/exception.dart index 5da96df5..df782563 100644 --- a/packages/neon/neon/lib/src/widgets/exception.dart +++ b/packages/neon/neon/lib/src/widgets/exception.dart @@ -48,15 +48,26 @@ class NeonException extends StatelessWidget { ); if (onlyIcon) { - return InkWell( - child: errorIcon, - onTap: () async { - if (details.isUnauthorized) { - await _openLoginPage(context); - } else { - onRetry(); - } - }, + return Semantics( + tooltip: details.text, + child: IconButton( + icon: errorIcon, + padding: EdgeInsets.zero, + visualDensity: const VisualDensity( + horizontal: VisualDensity.minimumDensity, + vertical: VisualDensity.minimumDensity, + ), + tooltip: details.isUnauthorized + ? AppLocalizations.of(context).loginAgain + : AppLocalizations.of(context).retry, + onPressed: () async { + if (details.isUnauthorized) { + await _openLoginPage(context); + } else { + onRetry(); + } + }, + ), ); } diff --git a/packages/neon/neon_files/lib/pages/main.dart b/packages/neon/neon_files/lib/pages/main.dart index a14b241f..7bdb6bea 100644 --- a/packages/neon/neon_files/lib/pages/main.dart +++ b/packages/neon/neon_files/lib/pages/main.dart @@ -55,6 +55,7 @@ class _FilesMainPageState extends State { ), ); }, + tooltip: AppLocalizations.of(context).filesUploadFiles, child: const Icon(Icons.add), ), ); diff --git a/packages/neon/neon_files/lib/widgets/browser_view.dart b/packages/neon/neon_files/lib/widgets/browser_view.dart index a47dca51..1756bc17 100644 --- a/packages/neon/neon_files/lib/widgets/browser_view.dart +++ b/packages/neon/neon_files/lib/widgets/browser_view.dart @@ -150,28 +150,47 @@ class _FilesBrowserViewState extends State { child: Wrap( crossAxisAlignment: WrapCrossAlignment.center, children: [ - SizedBox( - height: 40, - child: InkWell( - onTap: () { - widget.bloc.setPath([]); - }, - child: const Icon(Icons.house), + IconButton( + padding: EdgeInsets.zero, + visualDensity: const VisualDensity( + horizontal: VisualDensity.minimumDensity, + vertical: VisualDensity.minimumDensity, + ), + tooltip: AppLocalizations.of(context).filesGoToPath(''), + icon: const Icon( + Icons.house, + size: 30, ), + onPressed: () { + widget.bloc.setPath([]); + }, ), for (var i = 0; i < pathSnapshot.data!.length; i++) ...[ - InkWell( - onTap: () { - widget.bloc.setPath(pathSnapshot.data!.sublist(0, i + 1)); + Builder( + builder: (final context) { + final path = pathSnapshot.data!.sublist(0, i + 1); + return Tooltip( + message: AppLocalizations.of(context).filesGoToPath(path.join('/')), + excludeFromSemantics: true, + child: TextButton( + onPressed: () { + widget.bloc.setPath(path); + }, + child: Text( + pathSnapshot.data![i], + semanticsLabel: + AppLocalizations.of(context).filesGoToPath(path.join('/')), + ), + ), + ); }, - child: Text(pathSnapshot.data![i]), ), ], ] .intersperse( const Icon( Icons.keyboard_arrow_right, - size: 40, + size: 30, ), ) .toList(), diff --git a/packages/neon/neon_news/lib/pages/article.dart b/packages/neon/neon_news/lib/pages/article.dart index ea97c50d..e4363a08 100644 --- a/packages/neon/neon_news/lib/pages/article.dart +++ b/packages/neon/neon_news/lib/pages/article.dart @@ -123,6 +123,9 @@ class _NewsArticlePageState extends State { widget.bloc.starArticle(); } }, + tooltip: starred + ? AppLocalizations.of(context).newsArticleUnstar + : AppLocalizations.of(context).newsArticleStar, icon: Icon(starred ? Icons.star : Icons.star_outline), ); }, @@ -139,6 +142,9 @@ class _NewsArticlePageState extends State { widget.bloc.markArticleAsUnread(); } }, + tooltip: unread + ? AppLocalizations.of(context).newsArticleMarkRead + : AppLocalizations.of(context).newsArticleMarkUnread, icon: Icon(unread ? MdiIcons.email : MdiIcons.emailMarkAsUnread), ); }, @@ -151,12 +157,14 @@ class _NewsArticlePageState extends State { mode: LaunchMode.externalApplication, ); }, + tooltip: AppLocalizations.of(context).newsArticleOpenLink, icon: const Icon(Icons.open_in_new), ), IconButton( onPressed: () async { await Share.share(await _getURL()); }, + tooltip: AppLocalizations.of(context).newsArticleShare, icon: const Icon(Icons.share), ), ], diff --git a/packages/neon/neon_news/lib/widgets/articles_view.dart b/packages/neon/neon_news/lib/widgets/articles_view.dart index d6cb291f..ddf3cfa3 100644 --- a/packages/neon/neon_news/lib/widgets/articles_view.dart +++ b/packages/neon/neon_news/lib/widgets/articles_view.dart @@ -158,10 +158,6 @@ class _NewsArticlesViewState extends State { ], ), trailing: IconButton( - icon: Icon( - article.starred ? Icons.star : Icons.star_outline, - color: Theme.of(context).colorScheme.primary, - ), onPressed: () { if (article.starred) { widget.bloc.unstarArticle(article); @@ -169,6 +165,13 @@ class _NewsArticlesViewState extends State { widget.bloc.starArticle(article); } }, + tooltip: article.starred + ? AppLocalizations.of(context).newsArticleUnstar + : AppLocalizations.of(context).newsArticleStar, + icon: Icon( + article.starred ? Icons.star : Icons.star_outline, + color: Theme.of(context).colorScheme.primary, + ), ), onLongPress: () { if (article.unread) { diff --git a/packages/neon/neon_news/lib/widgets/feed_floating_action_button.dart b/packages/neon/neon_news/lib/widgets/feed_floating_action_button.dart index d48a30a7..b6d93bbc 100644 --- a/packages/neon/neon_news/lib/widgets/feed_floating_action_button.dart +++ b/packages/neon/neon_news/lib/widgets/feed_floating_action_button.dart @@ -24,6 +24,7 @@ class NewsFeedFloatingActionButton extends StatelessWidget { bloc.addFeed(result[0] as String, result[1] as int?); } }, + tooltip: AppLocalizations.of(context).newsAddFeed, child: const Icon(Icons.add), ); } diff --git a/packages/neon/neon_news/lib/widgets/feeds_view.dart b/packages/neon/neon_news/lib/widgets/feeds_view.dart index bfbee64f..9211b680 100644 --- a/packages/neon/neon_news/lib/widgets/feeds_view.dart +++ b/packages/neon/neon_news/lib/widgets/feeds_view.dart @@ -63,7 +63,6 @@ class NewsFeedsView extends StatelessWidget { children: [ if (feed.updateErrorCount > 0) ...[ IconButton( - iconSize: 30, onPressed: () async { await showDialog( context: context, @@ -72,6 +71,8 @@ class NewsFeedsView extends StatelessWidget { ), ); }, + tooltip: AppLocalizations.of(context).newsShowFeedErrorMessage, + iconSize: 30, icon: Text( feed.updateErrorCount.toString(), style: const TextStyle( diff --git a/packages/neon/neon_news/lib/widgets/folder_floating_action_button.dart b/packages/neon/neon_news/lib/widgets/folder_floating_action_button.dart index 147f45bc..39e4031a 100644 --- a/packages/neon/neon_news/lib/widgets/folder_floating_action_button.dart +++ b/packages/neon/neon_news/lib/widgets/folder_floating_action_button.dart @@ -19,6 +19,7 @@ class NewsFolderFloatingActionButton extends StatelessWidget { bloc.createFolder(result); } }, + tooltip: AppLocalizations.of(context).filesCreateFolder, child: const Icon(Icons.add), ); } diff --git a/packages/neon/neon_notes/lib/dialogs/select_category.dart b/packages/neon/neon_notes/lib/dialogs/select_category.dart index 8880ce8c..51c6a481 100644 --- a/packages/neon/neon_notes/lib/dialogs/select_category.dart +++ b/packages/neon/neon_notes/lib/dialogs/select_category.dart @@ -29,7 +29,7 @@ class _NotesSelectCategoryDialogState extends State { Widget build(final BuildContext context) => ResultBuilder>( stream: widget.bloc.notes, builder: (final context, final notes) => NeonDialog( - title: Text(AppLocalizations.of(context).notesChangeCategory), + title: Text(AppLocalizations.of(context).notesCategory), children: [ Form( key: formKey, diff --git a/packages/neon/neon_notes/lib/pages/note.dart b/packages/neon/neon_notes/lib/pages/note.dart index 837ca10e..eba064f4 100644 --- a/packages/neon/neon_notes/lib/pages/note.dart +++ b/packages/neon/neon_notes/lib/pages/note.dart @@ -89,9 +89,6 @@ class _NotesNotePageState extends State { ), actions: [ IconButton( - icon: Icon( - _showEditor ? Icons.visibility : Icons.edit, - ), onPressed: () { setState(() { _showEditor = !_showEditor; @@ -104,6 +101,12 @@ class _NotesNotePageState extends State { _titleFocusNode.unfocus(); } }, + tooltip: _showEditor + ? AppLocalizations.of(context).notesShowPreview + : AppLocalizations.of(context).notesShowEditor, + icon: Icon( + _showEditor ? Icons.visibility : Icons.edit, + ), ), StreamBuilder( stream: widget.bloc.category, @@ -123,6 +126,7 @@ class _NotesNotePageState extends State { widget.bloc.updateCategory(result); } }, + tooltip: AppLocalizations.of(context).notesChangeCategory, icon: Icon( MdiIcons.tag, color: category.isNotEmpty ? NotesCategoryColor.compute(category) : null, diff --git a/packages/neon/neon_notes/lib/widgets/category_select.dart b/packages/neon/neon_notes/lib/widgets/category_select.dart index e40c49df..5b1146ca 100644 --- a/packages/neon/neon_notes/lib/widgets/category_select.dart +++ b/packages/neon/neon_notes/lib/widgets/category_select.dart @@ -71,21 +71,17 @@ class NotesCategorySelect extends StatelessWidget { itemCount: options.length, itemBuilder: (final context, final index) { final option = options.elementAt(index); - return InkWell( + return ListTile( + leading: Icon( + MdiIcons.tag, + color: option != '' ? NotesCategoryColor.compute(option) : null, + ), + title: Text( + option != '' ? option : AppLocalizations.of(context).notesUncategorized, + ), onTap: () { onSelected(option); }, - child: Builder( - builder: (final context) => ListTile( - leading: Icon( - MdiIcons.tag, - color: option != '' ? NotesCategoryColor.compute(option) : null, - ), - title: Text( - option != '' ? option : AppLocalizations.of(context).notesUncategorized, - ), - ), - ), ); }, ), diff --git a/packages/neon/neon_notes/lib/widgets/notes_floating_action_button.dart b/packages/neon/neon_notes/lib/widgets/notes_floating_action_button.dart index 141e6b26..308ea75e 100644 --- a/packages/neon/neon_notes/lib/widgets/notes_floating_action_button.dart +++ b/packages/neon/neon_notes/lib/widgets/notes_floating_action_button.dart @@ -27,6 +27,7 @@ class NotesFloatingActionButton extends StatelessWidget { ); } }, + tooltip: AppLocalizations.of(context).notesCreateNote, child: const Icon(Icons.add), ); } diff --git a/packages/neon/neon_notes/lib/widgets/notes_view.dart b/packages/neon/neon_notes/lib/widgets/notes_view.dart index bf138478..adda7035 100644 --- a/packages/neon/neon_notes/lib/widgets/notes_view.dart +++ b/packages/neon/neon_notes/lib/widgets/notes_view.dart @@ -71,10 +71,6 @@ class NotesView extends StatelessWidget { ], ), trailing: IconButton( - icon: Icon( - note.favorite ? Icons.star : Icons.star_outline, - color: Theme.of(context).colorScheme.primary, - ), onPressed: () { bloc.updateNote( note.id, @@ -82,6 +78,11 @@ class NotesView extends StatelessWidget { favorite: !note.favorite, ); }, + tooltip: note.favorite ? AppLocalizations.of(context).notesUnstar : AppLocalizations.of(context).notesStar, + icon: Icon( + note.favorite ? Icons.star : Icons.star_outline, + color: Theme.of(context).colorScheme.primary, + ), ), onTap: () async { await Navigator.of(context).push( diff --git a/packages/neon/neon_notifications/lib/pages/main.dart b/packages/neon/neon_notifications/lib/pages/main.dart index 8ec1eddd..666d8dfe 100644 --- a/packages/neon/neon_notifications/lib/pages/main.dart +++ b/packages/neon/neon_notifications/lib/pages/main.dart @@ -31,6 +31,7 @@ class _NotificationsMainPageState extends State { onPressed: () async { widget.bloc.deleteAllNotifications(); }, + tooltip: AppLocalizations.of(context).notificationsDismissAll, child: const Icon(MdiIcons.checkAll), ), body: NeonListView(