flutter_desktop: fix scroll event to rust
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
4fecbba87e
commit
98d66ed43c
@ -491,8 +491,8 @@ class _RemotePageState extends State<RemotePage>
|
|||||||
|
|
||||||
void _onPointerSignalImage(PointerSignalEvent e) {
|
void _onPointerSignalImage(PointerSignalEvent e) {
|
||||||
if (e is PointerScrollEvent) {
|
if (e is PointerScrollEvent) {
|
||||||
var dx = e.scrollDelta.dx;
|
var dx = e.scrollDelta.dx.toInt();
|
||||||
var dy = e.scrollDelta.dy;
|
var dy = e.scrollDelta.dy.toInt();
|
||||||
if (dx > 0)
|
if (dx > 0)
|
||||||
dx = -1;
|
dx = -1;
|
||||||
else if (dx < 0) dx = 1;
|
else if (dx < 0) dx = 1;
|
||||||
@ -906,24 +906,54 @@ class ImagePaint extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildCrossScrollbar(Widget child) {
|
Widget _buildCrossScrollbar(Widget child) {
|
||||||
return Scrollbar(
|
debugPrint(
|
||||||
controller: _vertical,
|
'REMOVE ME ==================================== _buildCrossScrollbar ${cursorOverImage.value}');
|
||||||
thumbVisibility: true,
|
// final physicsVertical =
|
||||||
trackVisibility: true,
|
// cursorOverImage.value ? const NeverScrollableScrollPhysics() : null;
|
||||||
child: Scrollbar(
|
// final physicsHorizontal =
|
||||||
controller: _horizontal,
|
// cursorOverImage.value ? const NeverScrollableScrollPhysics() : null;
|
||||||
|
|
||||||
|
if (cursorOverImage.value) {
|
||||||
|
return Scrollbar(
|
||||||
|
controller: _vertical,
|
||||||
thumbVisibility: true,
|
thumbVisibility: true,
|
||||||
trackVisibility: true,
|
trackVisibility: true,
|
||||||
notificationPredicate: (notif) => notif.depth == 1,
|
child: Scrollbar(
|
||||||
child: SingleChildScrollView(
|
controller: _horizontal,
|
||||||
controller: _vertical,
|
thumbVisibility: true,
|
||||||
|
trackVisibility: true,
|
||||||
|
notificationPredicate: (notif) => notif.depth == 1,
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
controller: _horizontal,
|
controller: _vertical,
|
||||||
scrollDirection: Axis.horizontal,
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
child: child,
|
child: SingleChildScrollView(
|
||||||
|
controller: _horizontal,
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
));
|
||||||
));
|
} else {
|
||||||
|
return Scrollbar(
|
||||||
|
controller: _vertical,
|
||||||
|
thumbVisibility: true,
|
||||||
|
trackVisibility: true,
|
||||||
|
child: Scrollbar(
|
||||||
|
controller: _horizontal,
|
||||||
|
thumbVisibility: true,
|
||||||
|
trackVisibility: true,
|
||||||
|
notificationPredicate: (notif) => notif.depth == 1,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
controller: _vertical,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
controller: _horizontal,
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildListener(Widget child) {
|
Widget _buildListener(Widget child) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user