Skip to content

Add .no_drag_scroll() to OverflowBuilder #11

@TheRedDeveloper

Description

@TheRedDeveloper

Summary

Add .no_drag_scroll() to OverflowBuilder to disable mouse drag scrolling on scroll containers while keeping touch drag and scroll wheel scrolling.

Motivation

Drag scrolling on overflow containers is currently always enabled. On desktop, this can interfere with expected mouse interactions (selecting content, clicking elements during accidental micro-drags).

Proposed API

ui.element()
  .overflow(|o| o.scroll_y().no_drag_scroll())
  .children(|ui| {});

When .no_drag_scroll() is set:

  • Mouse drag: does nothing (no drag scrolling)
  • Touch drag: still scrolls
  • Scroll wheel: still scrolls

Behavior

  • Touch detection uses macroquad's touches() function. If touches() is non-empty during a press, it's touch input and drag scrolling still works.
  • .no_drag_scroll() only affects mouse drag scrolling. Scroll wheel and touch-based scrolling are unaffected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    approvedA feature that has been approvedfeatNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions