mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Exposed tooltip longPress action when available (#117338)
* Exposed tooltip longPress action when available (Trigger mode is long press)
This commit is contained in:
parent
7f7a8778d8
commit
38e3930f39
@ -751,7 +751,7 @@ class TooltipState extends State<Tooltip> with SingleTickerProviderStateMixin {
|
|||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onLongPress: (_triggerMode == TooltipTriggerMode.longPress) ? _handlePress : null,
|
onLongPress: (_triggerMode == TooltipTriggerMode.longPress) ? _handlePress : null,
|
||||||
onTap: (_triggerMode == TooltipTriggerMode.tap) ? _handleTap : null,
|
onTap: (_triggerMode == TooltipTriggerMode.tap) ? _handleTap : null,
|
||||||
excludeFromSemantics: true,
|
excludeFromSemantics: _excludeFromSemantics,
|
||||||
child: result,
|
child: result,
|
||||||
);
|
);
|
||||||
// Only check for hovering if there is a mouse connected.
|
// Only check for hovering if there is a mouse connected.
|
||||||
|
@ -172,6 +172,7 @@ void main() {
|
|||||||
hasEnabledState: true,
|
hasEnabledState: true,
|
||||||
isEnabled: true,
|
isEnabled: true,
|
||||||
hasTapAction: true,
|
hasTapAction: true,
|
||||||
|
hasLongPressAction: true,
|
||||||
isFocusable: true,
|
isFocusable: true,
|
||||||
));
|
));
|
||||||
handle.dispose();
|
handle.dispose();
|
||||||
@ -216,6 +217,7 @@ void main() {
|
|||||||
hasEnabledState: true,
|
hasEnabledState: true,
|
||||||
isEnabled: true,
|
isEnabled: true,
|
||||||
hasTapAction: true,
|
hasTapAction: true,
|
||||||
|
hasLongPressAction: true,
|
||||||
isFocusable: true,
|
isFocusable: true,
|
||||||
));
|
));
|
||||||
handle.dispose();
|
handle.dispose();
|
||||||
|
@ -672,6 +672,7 @@ void main() {
|
|||||||
tooltip: 'Previous month',
|
tooltip: 'Previous month',
|
||||||
isButton: true,
|
isButton: true,
|
||||||
hasTapAction: true,
|
hasTapAction: true,
|
||||||
|
hasLongPressAction: true,
|
||||||
isEnabled: true,
|
isEnabled: true,
|
||||||
hasEnabledState: true,
|
hasEnabledState: true,
|
||||||
isFocusable: true,
|
isFocusable: true,
|
||||||
@ -680,6 +681,7 @@ void main() {
|
|||||||
tooltip: 'Next month',
|
tooltip: 'Next month',
|
||||||
isButton: true,
|
isButton: true,
|
||||||
hasTapAction: true,
|
hasTapAction: true,
|
||||||
|
hasLongPressAction: true,
|
||||||
isEnabled: true,
|
isEnabled: true,
|
||||||
hasEnabledState: true,
|
hasEnabledState: true,
|
||||||
isFocusable: true,
|
isFocusable: true,
|
||||||
|
@ -2047,7 +2047,10 @@ void main() {
|
|||||||
children: <TestSemantics>[
|
children: <TestSemantics>[
|
||||||
TestSemantics(
|
TestSemantics(
|
||||||
tooltip: 'Delete',
|
tooltip: 'Delete',
|
||||||
actions: <SemanticsAction>[SemanticsAction.tap],
|
actions: <SemanticsAction>[
|
||||||
|
SemanticsAction.tap,
|
||||||
|
SemanticsAction.longPress
|
||||||
|
],
|
||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
flags: <SemanticsFlag>[
|
flags: <SemanticsFlag>[
|
||||||
SemanticsFlag.isButton,
|
SemanticsFlag.isButton,
|
||||||
|
@ -833,6 +833,7 @@ void main() {
|
|||||||
tooltip: 'Switch to input',
|
tooltip: 'Switch to input',
|
||||||
isButton: true,
|
isButton: true,
|
||||||
hasTapAction: true,
|
hasTapAction: true,
|
||||||
|
hasLongPressAction: true,
|
||||||
isEnabled: true,
|
isEnabled: true,
|
||||||
hasEnabledState: true,
|
hasEnabledState: true,
|
||||||
isFocusable: true,
|
isFocusable: true,
|
||||||
@ -876,6 +877,7 @@ void main() {
|
|||||||
tooltip: 'Switch to calendar',
|
tooltip: 'Switch to calendar',
|
||||||
isButton: true,
|
isButton: true,
|
||||||
hasTapAction: true,
|
hasTapAction: true,
|
||||||
|
hasLongPressAction: true,
|
||||||
isEnabled: true,
|
isEnabled: true,
|
||||||
hasEnabledState: true,
|
hasEnabledState: true,
|
||||||
isFocusable: true,
|
isFocusable: true,
|
||||||
|
@ -699,6 +699,7 @@ void main() {
|
|||||||
tooltip: 'Add Photo',
|
tooltip: 'Add Photo',
|
||||||
actions: <SemanticsAction>[
|
actions: <SemanticsAction>[
|
||||||
SemanticsAction.tap,
|
SemanticsAction.tap,
|
||||||
|
SemanticsAction.longPress,
|
||||||
],
|
],
|
||||||
flags: <SemanticsFlag>[
|
flags: <SemanticsFlag>[
|
||||||
SemanticsFlag.hasEnabledState,
|
SemanticsFlag.hasEnabledState,
|
||||||
|
@ -620,7 +620,10 @@ void main() {
|
|||||||
SemanticsFlag.isEnabled,
|
SemanticsFlag.isEnabled,
|
||||||
SemanticsFlag.isFocusable,
|
SemanticsFlag.isFocusable,
|
||||||
],
|
],
|
||||||
actions: <SemanticsAction>[SemanticsAction.tap],
|
actions: <SemanticsAction>[
|
||||||
|
SemanticsAction.tap,
|
||||||
|
SemanticsAction.longPress,
|
||||||
|
],
|
||||||
tooltip: 'Back',
|
tooltip: 'Back',
|
||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
),
|
),
|
||||||
|
@ -1450,6 +1450,9 @@ void main() {
|
|||||||
id: 1,
|
id: 1,
|
||||||
tooltip: 'TIP',
|
tooltip: 'TIP',
|
||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
|
actions: <SemanticsAction>[
|
||||||
|
SemanticsAction.longPress,
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@ -1650,6 +1653,9 @@ void main() {
|
|||||||
tooltip: 'Foo',
|
tooltip: 'Foo',
|
||||||
label: 'Bar',
|
label: 'Bar',
|
||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
|
actions: <SemanticsAction>[
|
||||||
|
SemanticsAction.longPress,
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -1105,6 +1105,9 @@ void main() {
|
|||||||
tooltip: 'Foo',
|
tooltip: 'Foo',
|
||||||
label: 'Bar',
|
label: 'Bar',
|
||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
|
actions: <SemanticsAction>[
|
||||||
|
SemanticsAction.longPress,
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -1148,6 +1151,9 @@ void main() {
|
|||||||
tooltip: 'Foo',
|
tooltip: 'Foo',
|
||||||
label: 'Bar',
|
label: 'Bar',
|
||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
|
actions: <SemanticsAction>[
|
||||||
|
SemanticsAction.longPress,
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user