-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: desktopRunning on desktopRunning on desktopa: mouseIssues related to using a mouse or mouse supportIssues related to using a mouse or mouse supportc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
According to #58260, in pre flutter version, we can custom cursor shape by self image.
But, now it is not work.
Now we can achieve this by only modifying a few core methods.
var listnode = document.getElementsByTagName('flt-glass-pane')
// cast node to Element, then
node.style.setProperty('cursor', 'url(\'https://www.ernegonzal.com/wp-content/uploads/2020/02/hand-2.png\'), auto');This is according mouse_cursor.dart
static const Map<String, String> _kindToCssValueMap = <String, String>{
'alias': 'alias',
'allScroll': 'all-scroll',
// ...
};
static String _mapKindToCssValue(String? kind) {
return _kindToCssValueMap[kind] ?? 'default';
}
void activateSystemCursor(String? kind) {
DomRenderer.setElementStyle(
domRenderer.glassPaneElement!,
'cursor',
_mapKindToCssValue(kind),
);
}which is called by fellow example code
MouseRegion(
cursor: SystemMouseCursors.click,
child: Container(),
),So, can provide SystemMouseCursors.custom and trans image url to support custom cursor shape ?
osaxma, TecN01R, thibaultzanini, Correct-Syntax, Toolenaar and 2 more
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: desktopRunning on desktopRunning on desktopa: mouseIssues related to using a mouse or mouse supportIssues related to using a mouse or mouse supportc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team