From d18250d1e71ddd14b152f00ab156b01e1baf477d Mon Sep 17 00:00:00 2001 From: sahilyeole Date: Sat, 12 Aug 2023 12:51:30 +0530 Subject: [PATCH] add more peer_tab_page tooltips Signed-off-by: sahilyeole --- flutter/lib/common/widgets/peer_tab_page.dart | 87 ++++++++++++------- 1 file changed, 54 insertions(+), 33 deletions(-) diff --git a/flutter/lib/common/widgets/peer_tab_page.dart b/flutter/lib/common/widgets/peer_tab_page.dart index daf81d231..d32458514 100644 --- a/flutter/lib/common/widgets/peer_tab_page.dart +++ b/flutter/lib/common/widgets/peer_tab_page.dart @@ -121,10 +121,13 @@ class _PeerTabPageState extends State : BoxDecoration( color: Theme.of(context).colorScheme.background, borderRadius: BorderRadius.circular(6)), - child: Icon( - Icons.tag_rounded, - size: 18, - ))), + child: Tooltip( + message: translate('Toggle Tags'), + child: Icon( + Icons.tag_rounded, + size: 18, + )) + )), onTap: () async { await bind.mainSetLocalOption( key: "hideAbTagsPanel", @@ -217,11 +220,14 @@ class _PeerTabPageState extends State }, child: RotatedBox( quarterTurns: 2, - child: Icon( - Icons.refresh, - size: 18, - color: textColor, - ))), + child: Tooltip( + message: translate('Refresh'), + child: Icon( + Icons.refresh, + size: 18, + color: textColor, + )) + )), ), ); } @@ -248,14 +254,18 @@ class _PeerTabPageState extends State k: 'peer-card-ui-type', v: type.index.toString()); peerCardUiType.value = type; }, - child: Icon( - peerCardUiType.value == PeerUiType.grid - ? Icons.view_list_rounded - : Icons.grid_view_rounded, - size: 18, - color: textColor, - )), - ), + child: Tooltip( + message: peerCardUiType.value == PeerUiType.grid + ? translate('List View') + : translate('Grid View'), + child: Icon( + peerCardUiType.value == PeerUiType.grid + ? Icons.view_list_rounded + : Icons.grid_view_rounded, + size: 18, + color: textColor, + )) + )), ); } @@ -269,11 +279,13 @@ class _PeerTabPageState extends State onTap: () { model.setMultiSelectionMode(true); }, - child: Icon( - IconFont.checkbox, - size: 18, - color: textColor, - ), + child: Tooltip( + message: translate('Select'), + child: Icon( + IconFont.checkbox, + size: 18, + color: textColor, + )), ), ); } @@ -466,10 +478,13 @@ class _PeerSearchBarState extends State { drawer = true; }); }, - icon: Icon( - Icons.search_rounded, - color: Theme.of(context).hintColor, - )); + icon: Tooltip( + message: translate('Search'), + child: Icon( + Icons.search_rounded, + color: Theme.of(context).hintColor, + )) + ); } Widget _buildSearchBar() { @@ -537,10 +552,14 @@ class _PeerSearchBarState extends State { drawer = false; }); }, - icon: Icon( - Icons.close, - color: Theme.of(context).hintColor, + icon: Tooltip( + message: translate('Close'), + child: + Icon( + Icons.close, + color: Theme.of(context).hintColor, )), + ), ], ), ) @@ -604,10 +623,12 @@ class _PeerSortDropdownState extends State { var menuPos = RelativeRect.fromLTRB(0, 0, 0, 0); return InkWell( - child: Icon( - Icons.sort_rounded, - size: 18, - ), + child: Tooltip( + message: translate('Sort By'), + child: Icon( + Icons.sort_rounded, + size: 18, + )), onTapDown: (details) { final x = details.globalPosition.dx; final y = details.globalPosition.dy;