[PR #3609] [MERGED] Title buttons and creative tabs show the pointing hand under the mouse (#3040, #3042) #5094

Closed
opened 2026-11-03 05:10:11 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3609
Author: @degepie
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix/issue-3040-cursor-shapes


📝 Commits (1)

  • e4568ab Title buttons and creative tabs show the pointing hand under the mouse

📊 Changes

4 files changed (+78 additions, -5 deletions)

View changed files

📝 crates/horizon-client/src/creative.rs (+42 -0)
📝 crates/horizon-client/src/game.rs (+6 -0)
📝 crates/horizon-client/src/title.rs (+4 -5)
📝 crates/horizon-client/src/title/tests.rs (+26 -0)

📄 Description

🤖 Opened by degepie's AI agent (Claude Code), not by degepie personally.

Fixes #3040.
Fixes #3042.

What

The mouse cursor stayed an arrow over the title screen's buttons and over the creative inventory's tab buttons. #1347 already taught ui::button (pause, options and the other screens drawn with it) and the resource pack screen to ask for the pointing hand, but the title screen draws its own buttons and never asked, and the creative tabs never asked either.

Vanilla

  • AbstractWidget.handleCursor: a hovered widget asks for CursorTypes.POINTING_HAND, or for NOT_ALLOWED when it is inactive. The title screen's buttons (main menu, world list, create/edit world, multiplayer) are plain widgets, so they follow it.
  • CreativeModeInventoryScreen.extractTabButton: a tab other than the selected one asks for POINTING_HAND when the integer mouse position is strictly inside its 26x32 button (> the left/top edge, < the right/bottom edge). The selected tab asks for nothing.
  • Options.allowCursorChanges turns it off; Horizon's apply_cursor_icon already honours it.

How

  • title.rs: the button loop computes "mouse inside" apart from the enabled check and calls widgets::widget_cursor(inside, enabled), so a hovered disabled button gets not-allowed, as in vanilla. The hover sprite logic doesn't change.
  • creative.rs: Creative::tab_wants_hand(tab, selected, mouse) ports the tab test (whole-pixel mouse, strict bounds), next to tab_position.
  • game.rs::draw_creative: the unselected-tab loop requests Cursor::PointingHand when tab_wants_hand says so. The selected tab is drawn elsewhere and asks for nothing.

Verified

  • New unit test title::tests::hovered_buttons_ask_for_the_hand_or_not_allowed: drawing the title screen with the mouse over "Singleplayer" asks for the pointing hand, with the mouse away it asks for the arrow, and over the world list's inactive "Edit" button it asks for not-allowed. It fails without the title.rs change (left: Arrow, right: PointingHand).
  • New unit test creative::tests::unselected_tabs_want_the_hand_strictly_inside: tab edges, whole-pixel flooring, a selected tab, and a right-aligned bottom tab.
  • In game (fixed build, offscreen, scratch home): the title screen and the creative inventory still draw as before (horizon-ctl screenshot). Hovering itself was not driven: horizon-ctl has no command that moves the GUI mouse or reports the window cursor, and the OS cursor isn't in the game's own screenshots, so the cursor change was checked only through the tests above.

Known differences (not in this PR)

26.3 asks for cursors in more places that Horizon still doesn't port: the creative scrollbar (pointing hand / RESIZE_NS while dragging / not-allowed), AbstractScrollArea scrollbars, EditBox and MultiLineEditBox (ibeam), sliders (RESIZE_EW), the stonecutter, loom, enchanting table, merchant scroller and crafter slots, advancement tabs (RESIZE_ALL while dragging), chat command suggestions and clickable chat text. The resize and ibeam variants need new widgets::Cursor variants and window mappings. They belong in follow-ups, which would also avoid a conflict with #3403, which changes the cursor mapping in apply_cursor_icon.

pr_ready (tools/pr_ready.py --quick on horizon-build, against origin/main at 11494e17f, 2 min 59 s)

Check Result
Scope ✅ 4 files, +78 −5
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 408 passed (28 s)
rustfmt ✅ (7 s)
clippy ✅ (17 s)
tests: horizon-client ✅ 800 passed (1 min 55 s)
doc tests ✅ 0 passed (9 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 345 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 333 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3609 **Author:** [@degepie](https://github.com/degepie) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/issue-3040-cursor-shapes` --- ### 📝 Commits (1) - [`e4568ab`](https://github.com/horizon-rust/horizon/commit/e4568abf6e3c44800fe01bf3a4d973b49832104b) Title buttons and creative tabs show the pointing hand under the mouse ### 📊 Changes **4 files changed** (+78 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/creative.rs` (+42 -0) 📝 `crates/horizon-client/src/game.rs` (+6 -0) 📝 `crates/horizon-client/src/title.rs` (+4 -5) 📝 `crates/horizon-client/src/title/tests.rs` (+26 -0) </details> ### 📄 Description > 🤖 Opened by degepie's AI agent (Claude Code), not by degepie personally. Fixes #3040. Fixes #3042. ## What The mouse cursor stayed an arrow over the title screen's buttons and over the creative inventory's tab buttons. #1347 already taught `ui::button` (pause, options and the other screens drawn with it) and the resource pack screen to ask for the pointing hand, but the title screen draws its own buttons and never asked, and the creative tabs never asked either. ## Vanilla - `AbstractWidget.handleCursor`: a hovered widget asks for `CursorTypes.POINTING_HAND`, or for `NOT_ALLOWED` when it is inactive. The title screen's buttons (main menu, world list, create/edit world, multiplayer) are plain widgets, so they follow it. - `CreativeModeInventoryScreen.extractTabButton`: a tab other than the selected one asks for `POINTING_HAND` when the integer mouse position is strictly inside its 26x32 button (`>` the left/top edge, `<` the right/bottom edge). The selected tab asks for nothing. - `Options.allowCursorChanges` turns it off; Horizon's `apply_cursor_icon` already honours it. ## How - `title.rs`: the button loop computes "mouse inside" apart from the enabled check and calls `widgets::widget_cursor(inside, enabled)`, so a hovered disabled button gets not-allowed, as in vanilla. The hover sprite logic doesn't change. - `creative.rs`: `Creative::tab_wants_hand(tab, selected, mouse)` ports the tab test (whole-pixel mouse, strict bounds), next to `tab_position`. - `game.rs::draw_creative`: the unselected-tab loop requests `Cursor::PointingHand` when `tab_wants_hand` says so. The selected tab is drawn elsewhere and asks for nothing. ## Verified - New unit test `title::tests::hovered_buttons_ask_for_the_hand_or_not_allowed`: drawing the title screen with the mouse over "Singleplayer" asks for the pointing hand, with the mouse away it asks for the arrow, and over the world list's inactive "Edit" button it asks for not-allowed. It fails without the `title.rs` change (`left: Arrow, right: PointingHand`). - New unit test `creative::tests::unselected_tabs_want_the_hand_strictly_inside`: tab edges, whole-pixel flooring, a selected tab, and a right-aligned bottom tab. - In game (fixed build, offscreen, scratch home): the title screen and the creative inventory still draw as before (`horizon-ctl screenshot`). Hovering itself was not driven: `horizon-ctl` has no command that moves the GUI mouse or reports the window cursor, and the OS cursor isn't in the game's own screenshots, so the cursor change was checked only through the tests above. ## Known differences (not in this PR) 26.3 asks for cursors in more places that Horizon still doesn't port: the creative scrollbar (pointing hand / `RESIZE_NS` while dragging / not-allowed), `AbstractScrollArea` scrollbars, `EditBox` and `MultiLineEditBox` (ibeam), sliders (`RESIZE_EW`), the stonecutter, loom, enchanting table, merchant scroller and crafter slots, advancement tabs (`RESIZE_ALL` while dragging), chat command suggestions and clickable chat text. The resize and ibeam variants need new `widgets::Cursor` variants and window mappings. They belong in follow-ups, which would also avoid a conflict with #3403, which changes the cursor mapping in `apply_cursor_icon`. **pr_ready** (`tools/pr_ready.py --quick` on horizon-build, against origin/main at 11494e17f, 2 min 59 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +78 −5 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 408 passed (28 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (17 s) | | tests: horizon-client | ✅ 800 passed (1 min 55 s) | | doc tests | ✅ 0 passed (9 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 345 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 333 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:10:11 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5094
No description provided.