Skip to content

UI: drag across checkboxes to check or uncheck several at once (#1190) - #1283

Closed
vbasky wants to merge 1 commit into
storytold:mainfrom
vbasky:fix/1190-checkbox-drag
Closed

vbasky wants to merge 1 commit into
storytold:mainfrom
vbasky:fix/1190-checkbox-drag

Conversation

@vbasky

@vbasky vbasky commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Closes #1190

Port of the shared-widget behaviour VectorCraft shipped in #1600 (#1477) and PhotoCraft in #3521, so all Craft apps work the same way.

  • Press a checkbox and drag: the first toggles and every other checkbox the pointer moves over takes the same new state, until release. A plain click toggles exactly one, as before. Mixed/dash states do not exist on these boxes, so nothing had to special-case them.
  • widgets::checkbox gains a drag sense and returns a CheckResponse that Derefs to the egui Response; its clicked() also fires when a drag paints the box. All ~20 panel call sites (Effect Controls, Timeline switches, Properties, Character/Paragraph, Render Queue, Header, Paint panels) work unchanged and get the behaviour.
  • Form dialogs' FieldKind::Bool rows now use the shared widget too, so Preferences-style dialogs drag like the panels. The Layers panel's eye/lock columns already dragged; their code is untouched.

Tests

  • New unit test widgets::tests::dragging_across_checkboxes_paints_the_state (sweep down a column, then a plain click).
  • cargo test -p effectcraft-ui-egui --lib 258 passed; ui_settings_info (5) and ui_workflow_selection (23) integration suites pass; fmt + clippy -D warnings clean.

…told#1190)

Port of the shared-widget behaviour VectorCraft (storytold#1600) and PhotoCraft
(storytold#3521) ship, so the Craft apps behave the same: press a checkbox and
drag; the first one toggles and every box the pointer passes over takes
the same new state until the button is released. A plain click still
toggles exactly one box, and the layers panel's eye/lock columns keep
their existing drag.

widgets::checkbox now senses drags and returns a CheckResponse whose
clicked() also fires when a drag paints the box (it Derefs to the
Response, so the 20 call sites are unchanged). Form dialogs' Bool fields
use the shared widget, so Preferences and Interpret-Footage-style
dialogs drag the same as the panels.

Tests: widgets::dragging_across_checkboxes_paints_the_state; the
ui-egui lib (258) and the settings/workflow/visual integration suites
pass; fmt and clippy -D warnings clean.
@bflatastic

Copy link
Copy Markdown
Member

Thanks @vbasky! On current main (egui 0.37, #2367) this fails strict clippy: egui::Id::new is deprecated ("Use Id::unique (for a globally unique id) or IdSalt::new (for a locally unique salt)") at panels/forms.rs:848 and widgets.rs:457 / :953. Please switch those to IdSalt::new (or Id::unique, as the rest of widgets.rs does) and rebase. The drag-to-paint behaviour itself looks right.

@vbasky

vbasky commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Main already has drag-to-paint checkboxes on egui 0.37, so I am closing this instead of rebasing it.

widgets::checkbox uses drag_toggle with Id::unique, forms go through labelled_checkbox, and the call sites use .changed(). Rebasing this branch would put the old Id::new / CheckResponse design back on top of that.

@vbasky vbasky closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Drag to check or uncheck multiple checkboxes

2 participants