Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@QuLogic
Copy link
Member

@QuLogic QuLogic commented Jul 7, 2021

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
Copy link
Member

timhoffm commented Jul 7, 2021

Naming:

  • the libraries are quite mixed (2x east-west, 2x horizontal, 1x LeftRight). No clear winner here.
  • I'm 👎 on east-west. IMHO the mapping to geographic directions is an unnecessary indirection.

Overall I would go with RESIZE_HORIZONTAL and RESIZE_VERTICAL.

@QuLogic
Copy link
Member Author

QuLogic commented Jul 7, 2021

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
Copy link
Member Author

QuLogic commented Jul 8, 2021

OK, now also tested and working in nbagg as well.

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