Improve cursor style behavior for some draggable elements (#31965)
Follow-up to #24797 This PR ensures some cursor styles do not change for draggable elements during dragging. The linked PR covered this on the higher level for draggable divs. However, e.g. the pane divider inbetween two editors is not a draggable div and thus still has the issue that the cursor style changes during dragging. This PR fixes this issue by setting the hitbox to `None` in cases where the element is currently being dragged, which ensures the cursor style is applied to the cursor no matter what during dragging. Namely, this change fixes this for - non-div pane dividers - minimap slider and the - editor scrollbars and implements it for the UI scrollbars (Notably, UI scrollbars do already have `cursor_default` on their parent container but would not keep this during dragging. I opted out on removing this from the parent containers until #30194 or a similar PR is merged). https://github.com/user-attachments/assets/f97859dd-5f1d-4449-ab92-c27f2d933c4a Release Notes: - N/A
This commit is contained in:
parent
e0057ccd0f
commit
2fe1293fba
11 changed files with 88 additions and 43 deletions
|
@ -576,9 +576,9 @@ impl MarkdownElement {
|
|||
.is_some();
|
||||
|
||||
if is_hovering_link {
|
||||
window.set_cursor_style(CursorStyle::PointingHand, Some(hitbox));
|
||||
window.set_cursor_style(CursorStyle::PointingHand, hitbox);
|
||||
} else {
|
||||
window.set_cursor_style(CursorStyle::IBeam, Some(hitbox));
|
||||
window.set_cursor_style(CursorStyle::IBeam, hitbox);
|
||||
}
|
||||
|
||||
let on_open_url = self.on_url_click.take();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue