Drawer tooltip on collapse mode

This commit is contained in:
LittleSheep 2024-08-21 19:35:29 +08:00
parent bc99865ba8
commit 2ec25fd1a2
2 changed files with 40 additions and 28 deletions

View File

@ -241,7 +241,9 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer>
children: AppNavigation.destinations
.map(
(e) => _isCollapsed
? InkWell(
? Tooltip(
message: e.label,
child: InkWell(
child: Icon(e.icon, size: 20).paddingSymmetric(
horizontal: 28,
vertical: 16,
@ -250,6 +252,7 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer>
AppRouter.instance.goNamed(e.page);
_closeDrawer();
},
),
)
: ListTile(
contentPadding: const EdgeInsets.symmetric(
@ -279,7 +282,9 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer>
Column(
children: [
if (_isCollapsed)
InkWell(
Tooltip(
message: 'settings'.tr,
child: InkWell(
child: const Icon(
Icons.settings,
size: 20,
@ -291,6 +296,7 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer>
AppRouter.instance.pushNamed('settings');
_closeDrawer();
},
),
)
else
ListTile(
@ -306,7 +312,9 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer>
},
),
if (_isCollapsed)
InkWell(
Tooltip(
message: 'expand'.tr,
child: InkWell(
child: const Icon(Icons.chevron_right, size: 20)
.paddingSymmetric(
horizontal: 28,
@ -315,6 +323,7 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer>
onTap: () {
_expandDrawer();
},
),
)
else
ListTile(

View File

@ -77,7 +77,10 @@ class AppNavigationRegion extends StatelessWidget {
final element = index >= noRealmGroupChannels.length
? hasRealmGroupChannels[index - noRealmGroupChannels.length]
: noRealmGroupChannels[index];
return _buildEntry(context, element);
return Tooltip(
message: element.name,
child: _buildEntry(context, element),
);
},
),
],