Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Keyboard shortcuts work when toolbar not displayed#1830

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
warrd wants to merge1 commit intomatplotlib:masterfromwarrd:master
Closed

Keyboard shortcuts work when toolbar not displayed#1830

warrd wants to merge1 commit intomatplotlib:masterfromwarrd:master

Conversation

@warrd
Copy link

Following from issue#1829, I've implemented a fix for keyboard shortcuts when the toolbar is not displayed.

In the existing code, state/logic of pan/zoom tools are coupled to the existence of a toolbar, so I went for the easiest fix possible: keeping the toolbar but setting visibility to false when None is chosen in matplotlibrc.

So far it's only implemented in the Qt and GTK backends: I don't have the others so no way to test.

@efiring
Copy link
Member

I haven't tried it out, but offhand, I don't like the approach taken. If I specify no toolbar, I really meanno toolbar, not just "don't draw it".

What might be needed is a refactoring to separate the actual functionality of zoom, pan, keypress-handling, etc. from the particular Toolbar user interface.

@warrd
Copy link
Author

Yes, fair enough, I agree it's slightly hacky. I originally thought about a major refactor but it's my first time with the codebase, so wanted to make changes to application logic as minor as possible.

The refactor would have to involve moving a lot of the behaviour inNavigationToolbar2 to the main FigureCanvasBase, or more likely a new class that keeps track of cursor state etc.
What do you think?

@efiring
Copy link
Member

Yes, it looks to me like most of the necessary functionality is already in NavigationToolbarBase, so that could be renamed (Navigation? Interaction? Control?) with the relatively small toolbar-specific parts moved into a ToolbarBase.

Or maybe there are really three components: plot manipulation state and actions, which are backend-independent; keypress-handling, which is backend-dependent; and the specific Toolbar interface, which is very backend dependent.

@dmcdougall
Copy link
Member

What might be needed is a refactoring to separate the actual functionality of zoom, pan, keypress-handling, etc. from the particular Toolbar user interface.

This gels well with the Model-View-Controller mentality in Apple's frameworks.

@warrd
Copy link
Author

I'm closing this pull request and putting in a new one with a more significant refactor

@warrd
Copy link
Author

See pull request#1849

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@warrd@efiring@dmcdougall

[8]ページ先頭

©2009-2025 Movatter.jp