From 7b535e838d6d3ae4970320b7e157578811498b34 Mon Sep 17 00:00:00 2001 From: Ian Harrigan Date: Wed, 29 May 2024 11:02:47 +0200 Subject: [PATCH] allow setting scrollmode=native per scrollview instance --- haxe/ui/constants/ScrollMode.hx | 2 ++ haxe/ui/containers/ScrollView.hx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/haxe/ui/constants/ScrollMode.hx b/haxe/ui/constants/ScrollMode.hx index b88a54568..03bbf6fe3 100644 --- a/haxe/ui/constants/ScrollMode.hx +++ b/haxe/ui/constants/ScrollMode.hx @@ -7,6 +7,7 @@ enum abstract ScrollMode(String) to String { var DRAG = "drag"; var INERTIAL = "inertial"; var HYBRID = "hybrid"; + var NATIVE = "native"; @:from public static function fromString(s:String):ScrollMode { return switch (s.toLowerCase()) { @@ -14,6 +15,7 @@ enum abstract ScrollMode(String) to String { case "drag": DRAG; case "inertial": INERTIAL; case "hybrid": HYBRID; + case "native": NATIVE; case _: throw "invalid ScrollMode enum value '" + s + "'"; } } diff --git a/haxe/ui/containers/ScrollView.hx b/haxe/ui/containers/ScrollView.hx index 4a851e87a..12d88c204 100644 --- a/haxe/ui/containers/ScrollView.hx +++ b/haxe/ui/containers/ScrollView.hx @@ -575,6 +575,8 @@ private class ScrollModeBehaviour extends DataBehaviour { public override function set(value:Variant) { if (value == ScrollMode.HYBRID) { _component.isHybridScroller = true; + } else if (value == ScrollMode.NATIVE) { + _component.isNativeScroller = true; } super.set(value); }