Skip to content

RichTextPopup: scrollbar drag + track-click not wired in either backend #215

Description

@JDonaghy

Problem

After #214's first cut, the popup's scrollbar is rendered with correct geometry (track + thumb proportional to content) on both TUI and GTK, but neither backend wires up drag or track-click handlers for it. Mouse wheel scrolling works (existing engine path); only the bar itself is non-interactive.

Repro

  1. Trigger an LSP hover popup on a long doc string (any std lib symbol works).
  2. Try to drag the scrollbar thumb — nothing happens.
  3. Try to click the track outside the thumb to page-jump — nothing happens.

Fix shape

Mirror the pattern from #cb84f82 / #3e5d7d3 for sidebar scrollbars:

  • The popup primitive's layout already returns Option<PopupScrollbar> with track + thumb Rects.
  • Backends record the scrollbar bounds in a per-frame cell.
  • Click handler: if click lands on track, jump-scroll. If on thumb, arm DragState::ScrollbarY with the popup's id.
  • dispatch_mouse_drag already does the math correctly.
  • On UiEvent::ScrollOffsetChanged { widget, new_offset } where widget == popup id, update engine.editor_hover.scroll_top.

Files

  • quadraui/src/primitives/rich_text_popup.rs — already exposes PopupScrollbar + RichTextPopupHit::ScrollbarThumb / ScrollbarTrack.
  • src/tui_main/mouse.rs — wire popup scrollbar drag + track click.
  • src/gtk/mod.rs — wire popup scrollbar drag + track click. Cell width: pass through from draw_rich_text_popup's render so click handler knows the actual scrollbar pixel bounds.
  • src/core/engine/panels.rseditor_hover.scroll_top setter.

Surfaced by

#214 first-cut smoke test.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginfrastructureBuild, CI, distributionuiUI/rendering

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions