This commit is contained in:
Dennis Fokin 2024-05-24 13:55:31 +02:00
commit efade221cd
No known key found for this signature in database
GPG Key ID: 870B88256690D8BC
3 changed files with 41 additions and 27 deletions

View File

@ -504,6 +504,12 @@ class _AppPageState extends ConsumerState<AppPage> {
widget.detailViewBuilder != null || widget.keyActionsBuilder != null; widget.detailViewBuilder != null || widget.keyActionsBuilder != null;
var body = _buildMainContent(context, hasManage); var body = _buildMainContent(context, hasManage);
var navigationText = showNavigation
? (fullyExpanded
? l10n.s_collapse_navigation
: MaterialLocalizations.of(context).openAppDrawerTooltip)
: l10n.s_expand_navigation;
if (widget.onFileDropped != null) { if (widget.onFileDropped != null) {
body = FileDropTarget( body = FileDropTarget(
onFileDropped: widget.onFileDropped!, onFileDropped: widget.onFileDropped!,
@ -631,13 +637,8 @@ class _AppPageState extends ConsumerState<AppPage> {
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8), padding: const EdgeInsets.symmetric(horizontal: 8),
child: IconButton( child: IconButton(
icon: const Icon(Symbols.menu), icon: Icon(Symbols.menu, semanticLabel: navigationText),
tooltip: showNavigation tooltip: navigationText,
? (fullyExpanded
? l10n.s_collapse_navigation
: MaterialLocalizations.of(context)
.openAppDrawerTooltip)
: l10n.s_expand_navigation,
onPressed: fullyExpanded onPressed: fullyExpanded
? () { ? () {
ref ref
@ -681,10 +682,12 @@ class _AppPageState extends ConsumerState<AppPage> {
); );
}, },
icon: widget.keyActionsBadge icon: widget.keyActionsBadge
? const Badge( ? Badge(
child: Icon(Symbols.more_vert), child: Icon(Symbols.more_vert,
semanticLabel: l10n.s_configure_yk),
) )
: const Icon(Symbols.more_vert), : Icon(Symbols.more_vert,
semanticLabel: l10n.s_configure_yk),
iconSize: 24, iconSize: 24,
tooltip: l10n.s_configure_yk, tooltip: l10n.s_configure_yk,
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),

View File

@ -285,8 +285,11 @@ class _DeviceRowState extends ConsumerState<_DeviceRow> {
overflow: TextOverflow.fade, overflow: TextOverflow.fade,
softWrap: false, softWrap: false,
), ),
subtitle: Text(widget.subtitle, subtitle: Text(
overflow: TextOverflow.fade, softWrap: false), widget.subtitle,
overflow: TextOverflow.fade,
softWrap: false,
),
dense: true, dense: true,
onTap: widget.onTap, onTap: widget.onTap,
), ),
@ -314,19 +317,23 @@ class _DeviceRowState extends ConsumerState<_DeviceRow> {
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 6.5), padding: const EdgeInsets.symmetric(vertical: 6.5),
child: widget.selected child: widget.selected
? IconButton.filled( ? Semantics(
tooltip: isDesktop ? tooltip : null, label: tooltip,
icon: widget.leading, child: IconButton.filled(
padding: const EdgeInsets.symmetric(horizontal: 8), tooltip: isDesktop ? tooltip : null,
onPressed: widget.onTap, icon: widget.leading,
) padding: const EdgeInsets.symmetric(horizontal: 8),
: IconButton( onPressed: widget.onTap,
tooltip: isDesktop ? tooltip : null, ))
icon: widget.leading, : Semantics(
padding: const EdgeInsets.symmetric(horizontal: 8), label: tooltip,
onPressed: widget.onTap, child: IconButton(
color: colorScheme.secondary, tooltip: isDesktop ? tooltip : null,
), icon: widget.leading,
padding: const EdgeInsets.symmetric(horizontal: 8),
onPressed: widget.onTap,
color: colorScheme.secondary,
)),
), ),
); );
} }

View File

@ -145,8 +145,12 @@ class NavigationContent extends ConsumerWidget {
...availableSections.map((app) => NavigationItem( ...availableSections.map((app) => NavigationItem(
key: app._key, key: app._key,
title: app.getDisplayName(l10n), title: app.getDisplayName(l10n),
leading: Icon(app._icon, leading: Icon(
fill: app == currentSection ? 1.0 : 0.0), app._icon,
fill: app == currentSection ? 1.0 : 0.0,
semanticLabel:
!extended ? app.getDisplayName(l10n) : null,
),
collapsed: !extended, collapsed: !extended,
selected: app == currentSection, selected: app == currentSection,
onTap: data == null && currentSection == Section.home || onTap: data == null && currentSection == Section.home ||