Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove WidgetState::Cursor #710

Merged
merged 4 commits into from
Oct 22, 2024
Merged

Remove WidgetState::Cursor #710

merged 4 commits into from
Oct 22, 2024

Conversation

PoignardAzur
Copy link
Contributor

No description provided.

Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some docs improvements are needed here.

masonry/src/widget/widget.rs Show resolved Hide resolved
fn get_cursor(&self) -> CursorIcon {
/// Return the cursor icon for this widget.
///
/// **pos** - the position in global coordinates (e.g. `(0,0)` is the top-left corner of the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the position of what? I presume the mouse?

// TODO - Add &UpdateCtx argument
fn get_cursor(&self) -> CursorIcon {
/// Return the cursor icon for this widget.
///
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this mention cursor_icon_changed here?

Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some slightly expanded documentation to make the semantics crystal clear would be good, otherwise this is looking good. Thanks!

// TODO - Document
// TODO - Add &UpdateCtx argument
fn get_cursor(&self) -> CursorIcon {
/// Return the cursor icon for this widget.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should document when this will be called here as well, i.e. something like when the mouse cursor moves. It may also be called due to cursor_icon_changed, for cases when the state under the cursor might have changed (consider for example a link moving under the cursor due to a keypress in a rich text box)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll re-write the doc in a follow-up PR.

@PoignardAzur PoignardAzur added this pull request to the merge queue Oct 22, 2024
Merged via the queue into main with commit 30dba40 Oct 22, 2024
17 checks passed
@PoignardAzur PoignardAzur deleted the remove_cursor branch October 22, 2024 13:48
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.

2 participants