mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-18 12:16:33 -04:00
touchpad scroll
This commit is contained in:
parent
44f5bbeeb8
commit
b5d8a6da5a
2 changed files with 16 additions and 7 deletions
|
@ -6,12 +6,18 @@ extends ScrollContainer
|
|||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if not search.has_focus(): return
|
||||
if event is not InputEventMouseButton: return
|
||||
if event is not InputEventMouseButton and \
|
||||
event is not InputEventPanGesture: return
|
||||
|
||||
if not get_global_rect().has_point(event.position): return
|
||||
if not search.prompt_panel.get_global_rect().has_point(event.position): return
|
||||
|
||||
if event.button_index == MouseButton.MOUSE_BUTTON_WHEEL_UP:
|
||||
scroll_vertical -= scroll_speed * event.factor
|
||||
if event is InputEventMouseButton:
|
||||
if event.button_index == MOUSE_BUTTON_WHEEL_UP:
|
||||
scroll_vertical -= scroll_speed * event.factor
|
||||
|
||||
if event.button_index == MOUSE_BUTTON_WHEEL_DOWN:
|
||||
scroll_vertical += scroll_speed * event.factor
|
||||
|
||||
if event.button_index == MouseButton.MOUSE_BUTTON_WHEEL_DOWN:
|
||||
scroll_vertical += scroll_speed * event.factor
|
||||
if event is InputEventPanGesture:
|
||||
scroll_vertical += scroll_speed * event.delta.y
|
||||
|
|
|
@ -18,8 +18,11 @@ func change_size() -> void:
|
|||
func _input(event: InputEvent) -> void:
|
||||
if not search.has_focus(): return
|
||||
|
||||
if (event is InputEventMouseButton
|
||||
and event.button_index in [MOUSE_BUTTON_WHEEL_UP, MOUSE_BUTTON_WHEEL_DOWN]):
|
||||
if event is InputEventMouseButton and event.button_index in \
|
||||
[MOUSE_BUTTON_WHEEL_UP, MOUSE_BUTTON_WHEEL_DOWN]:
|
||||
update_position = true
|
||||
|
||||
if event is InputEventPanGesture:
|
||||
update_position = true
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue