[pr-fix][input] F1: the lists stay put under the mouse; the wheel scrolls them; tabs light on hover #297
Loading…
Reference in a new issue
No description provided.
Delete branch "berkai/f1-menu-scroll"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Contributor role (optional)
What it changes
380a066). Hovering a row moves the list under the mouse.Every F1 list (the settings of a tab, IMPORT's saves, KEY BINDINGS, AUTO-DETECT's changes) was centred on the highlighted row (
at.saturating_sub(ROWS / 2)). Hovering highlights the row under the mouse, so with 9 rows shown the list slid away under the cursor at almost every move. Hovering the tab strip jumped the settings list back to its top, and hovering a button jumped it to its end. The wheel moved the highlight instead of the list, and wrapped around the ends.This keeps each list's scroll position, as desktop lists do:
All in
crates/darner-gpu/src/host/menu.rs.How it was tested
4e6e80d(onf3840d7)cargo test --locked -p darner-gpu --lib menu: 57 passed, 0 failed, 2 ignored. New tests:wheel_scrolls_the_list_and_drains_notches(rewritten),a_list_scrolls_only_past_its_edge_never_under_the_mouse,a_tab_under_the_mouse_is_lit. One assertion inhit_test_finds_rows_tabs_and_buttons_where_they_are_drawnchanged on purpose: with a button picked, the list now stays where it was instead of jumping to its end.cargo clippy -p darner-gpu --all-targets --locked -- -D warnings: cleancargo clippy -p darner-gpu --all-targets --all-features --locked -- -D warnings: cleancargo xtask policy --staged: okdarner-gpu. Not the fullcargo test --workspace.--profile fastbuild. GPU: NVIDIA GeForce RTX 4060 Ti.Checklist
main.docs/asset-policy.md.Checked for overlap
menu/look.rs; it does not change how the current lists scroll). Other open PRs touchingmenu.rsadd rows or text only: #289, #255, #217, #205, #196, #175, #146, #145, #143, #80, #75, #48, #47, #16, #12, #9.There are two Windows wheel settings that this branch interprets differently from the system. A setting of zero disables wheel scrolling, and a value larger than the visible list scrolls by one page. With a nine-row viewport, the current code scrolls one row for
0and fourteen rows for14. Microsoft's mouse input documentationI prepared a cherry-pickable follow-up which keeps zero disabled and caps one notch at the visible row count, including the page-scroll value. A fixture with the production scroll logic verified
0,3,14andWHEEL_PAGESCROLL. It returned0,3,9and9rows with the follow-up. The new in-tree test supplies the setting directly, and the focused Cargo type check and asset policy passed.If you cherry-pick or rebase the contribution, please keep the Git author. If you fold it into your own commit, please add this trailer.
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.