mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-17 11:16:33 -07:00
fix: Only focus in dpad mode
This commit is contained in:
parent
0739247836
commit
39547163c3
1 changed files with 3 additions and 1 deletions
|
|
@ -5,6 +5,8 @@ import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
|
|
||||||
|
import 'package:fladder/util/adaptive_layout/adaptive_layout.dart';
|
||||||
|
|
||||||
abstract class ItemAction {
|
abstract class ItemAction {
|
||||||
Widget toMenuItemButton();
|
Widget toMenuItemButton();
|
||||||
PopupMenuEntry toPopupMenuItem({bool useIcons = false});
|
PopupMenuEntry toPopupMenuItem({bool useIcons = false});
|
||||||
|
|
@ -100,7 +102,7 @@ class ItemActionButton extends ItemAction {
|
||||||
final foregroundColor =
|
final foregroundColor =
|
||||||
selected ? Theme.of(context).colorScheme.onPrimaryContainer : Theme.of(context).colorScheme.onSurface;
|
selected ? Theme.of(context).colorScheme.onPrimaryContainer : Theme.of(context).colorScheme.onSurface;
|
||||||
return ElevatedButton(
|
return ElevatedButton(
|
||||||
autofocus: selected,
|
autofocus: AdaptiveLayout.inputDeviceOf(context) == InputDevice.dPad && selected,
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
backgroundColor: WidgetStatePropertyAll(
|
backgroundColor: WidgetStatePropertyAll(
|
||||||
selected ? Theme.of(context).colorScheme.primaryContainer : Colors.transparent,
|
selected ? Theme.of(context).colorScheme.primaryContainer : Colors.transparent,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue