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

🐛 Cursors use SystemMouseCursors.click instead of SystemMouseCursors.basic #139

Closed
wilsonowilson opened this issue Jun 11, 2021 · 11 comments · Fixed by #165
Closed

🐛 Cursors use SystemMouseCursors.click instead of SystemMouseCursors.basic #139

wilsonowilson opened this issue Jun 11, 2021 · 11 comments · Fixed by #165
Labels
bug Something isn't working

Comments

@wilsonowilson
Copy link
Contributor

Description

Clickable macOS components do not use the "click cursor". They have always used the default cursor. This forms a distinction between using the web on macOS and interacting with macOS applications.

So by default, clickable elements in macos_ui should use SystemMouseCursors.basic instead of SystemMouseCursors.click. I also believe an option should be provided to customize that.

@wilsonowilson wilsonowilson added bug Something isn't working enhancement labels Jun 11, 2021
@bdlukaa
Copy link
Contributor

bdlukaa commented Jun 11, 2021

You can wrap the widget you want in a MouseRegion to add a mouse cursor.

MouseRegion(
  cursor: SystemMouseCursos.click,
  child: Checkbox(...),
),

@wilsonowilson
Copy link
Contributor Author

Yes I'm aware of that, but that's not what I'm talking about.

This is a snippet from back_button.dart.

MouseRegion(
      cursor: SystemMouseCursors.click,
      child: GestureDetector(
        behavior: HitTestBehavior.opaque,

I'm saying that the in-built widgets shouldn't use SystemMouseCursors.click by default.

@bdlukaa
Copy link
Contributor

bdlukaa commented Jun 18, 2021

Will be fixed alongside #142

@wilsonowilson
Copy link
Contributor Author

The pull request doesn't address what I'm talking about. @GroovinChip might explain better.

@GroovinChip
Copy link
Collaborator

Wasn't it that mouse cursors should never be pointers? Material State Props can help us ensure that, right? Along with making it customizable?

@wilsonowilson
Copy link
Contributor Author

It can ensure customisation yes, but it doesn't directly relate to the issue. I can open a separate PR once #142 is merged.

And I'm not sure we'd want to use MacosStateProperty on cursors. I haven't seen that usage even in the material buttons.

@GroovinChip
Copy link
Collaborator

Fair enough

@bdlukaa bdlukaa mentioned this issue Jun 20, 2021
5 tasks
@bdlukaa
Copy link
Contributor

bdlukaa commented Jun 22, 2021

I have some ideas for this. We can have a MouseCursor property in the MacosThemeData class, and all the inputs will use it.

By default, on macOS and iOS, the cursor used will be MouseCursor.defer. On the other platforms, SystemMouseCursors.click shall be used. Something like:

MouseCursor _defaultMouseCursor() {
  switch (defaultTargetPlatform) {
    case TargetPlatform.macOS:
    case TargetPlatform.iOS:
      return MouseCursor.defer;
    default:
      return SystemMouseCursors.click;
  }
}

@wilsonowilson
Copy link
Contributor Author

That sounds great!

@bdlukaa bdlukaa mentioned this issue Jun 22, 2021
5 tasks
@GroovinChip
Copy link
Collaborator

@wilsonowilson so to recap: we're saying that all mouse cursors should default to something like MouseCursor.defer, correct?

@wilsonowilson
Copy link
Contributor Author

@GroovinChip Yeah, although I'm not sure if we'd want to use MouseCursor.defer over SystemMouseCursors.basic because it defers the cursor handling to its children.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants