Skip to content

Commit

Permalink
experimental feature: hybrid scrollers
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed May 20, 2024
1 parent ed99fbb commit 482f239
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions haxe/ui/backend/ComponentBase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,11 @@ class ComponentBase extends ComponentSurface implements IClonable<ComponentBase>
return false;
}

private var isHybridScroller(get, null):Bool;
private function get_isHybridScroller():Bool {
return false;
}

private function handleFrameworkProperty(id:String, value:Any) {

}
Expand Down
4 changes: 4 additions & 0 deletions haxe/ui/containers/ScrollView.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,10 @@ class ScrollViewEvents extends haxe.ui.events.Events {
private var _fadeTimer:Timer = null;
@:access(haxe.ui.core.Component)
private function onMouseWheel(event:MouseEvent) {
if (_scrollview.isHybridScroller) {
return;
}

// we'll default to vertical scrolling for the mouse wheel, however,
// if there is no vertical scrollbar we'll try to use horizontal
// scrolling instead - note that if the shiftkey is pressed
Expand Down
2 changes: 2 additions & 0 deletions haxe/ui/core/IScroller.hx
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ interface IScroller {
public var isScrollableHorizontally(get, null):Bool;
public var isScrollableVertically(get, null):Bool;
public var isScrollable(get, null):Bool;
public var vscrollPos(get, set):Float;
public var hscrollPos(get, set):Float;
}

0 comments on commit 482f239

Please sign in to comment.