Add directional sizing cursors by QuLogic · Pull Request #20589 · matplotlib/matplotlib · GitHub
Skip to content

Add directional sizing cursors - #20589

Merged
jklymak merged 4 commits into
matplotlib:masterfrom
QuLogic:size-cursors
Jul 8, 2021
Merged

jklymak merged 4 commits into
matplotlib:masterfrom
QuLogic:size-cursors

Conversation

@QuLogic

@QuLogic QuLogic commented Jul 7, 2021

Copy link
Copy Markdown
Member

PR Summary

Tested on GTK, macOS, Qt, and Tk, though for macOS, I was using VNC and couldn't see any change, so that was just a check that it didn't crash.

Also, deprecate cursord from the other backends.

I'm not sure about the names; as you can see all toolkits use different names:

  • RESIZE_EAST_WEST:
    • GTK: ew-resize
    • macOS: resizeLeftRightCursor
    • Qt: SizeHorCursor
    • Tk: sb_h_double_arrow
    • wx: CURSOR_SIZEWE
  • RESIZE_NORTH_SOUTH:
    • GTK: ns-resize
    • Tk: sb_v_double_arrow
    • wx: CURSOR_SIZENS
    • macOS: resizeUpDownCursor
    • Qt: SizeVerCursor

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • [?] New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@timhoffm

timhoffm commented Jul 7, 2021

Copy link
Copy Markdown
Member

@QuLogic

QuLogic commented Jul 7, 2021

Copy link
Copy Markdown
Member Author

I forget about nbagg; the browser uses the cardinal directions as well (though there's also col-resize and row-resize aliases.)

I suspect that the cardinal directions are used for toolkits that support diagonal resize cursors. For example, macOS doesn't have diagonal cursors and uses non-cardinal names. Though strangely the system does use them and the files are apparently named things like northWestSouthEastResizeCursor.png.

@QuLogic

QuLogic commented Jul 8, 2021

Copy link
Copy Markdown
Member Author

QuLogic added 4 commits July 7, 2021 21:53
The JavaScript side is just strings and not some special type, so it's
nicer to translate on the Python side. This way, we don't have to
remember what the Python Enum is on the JS side.
Tested on GTK, macOS, NbAgg, Qt, and Tk.
@jklymak
jklymak merged commit a080926 into matplotlib:master Jul 8, 2021
@QuLogic
QuLogic deleted the size-cursors branch July 8, 2021 19:46
@QuLogic QuLogic added this to the v3.5.0 milestone Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants