-
-
Notifications
You must be signed in to change notification settings - Fork 8k
MEP22 Navigation toolbar coexistence TODELETE #2759
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
dda0cdc
navigation and toolbar coexistence
fariza 10f5dc7
mod keypress in figuremanager
fariza 08a6020
extra files
fariza c6c0ad3
helper methods in toolbar and navigation
fariza 1fc29fa
Adding doc to base methods
fariza 979875e
property for active_toggle
fariza c5c4f0f
simulate click
fariza 97dfda7
pep8 backend_tools
fariza 6b647ad
activate renamed to trigger
fariza 99667aa
toggle tools using enable/disable from its trigger method
fariza 6c19579
simplifying _handle_toggle
fariza 0495aac
reducing number of locks
fariza fb46fc1
pep8 correction
fariza d49c431
changing toggle and persistent attributes for issubclass
fariza 5ba6210
bug in combined key press
fariza 7ca8626
untoggle zoom and pan from keypress while toggled
fariza dcc0f16
classmethods for default tools modification
fariza bc703e0
six fixes
fariza 68dc711
adding zaxis and some pep8
fariza bb9f1c7
removing legacy method dynamic update
fariza 2c2e649
tk backend
fariza a99367f
pep8
fariza 3d1be34
example working with Tk
fariza afdd34c
cleanup
fariza 5b49c7a
duplicate code in keymap tool initialization
fariza 773db88
grammar corrections
fariza 2ca6926
moving views and positions to tools
fariza 661417d
The views positions mixin automatically adds the clear as axobserver
fariza 90ab64f
bug when navigation was not defined
fariza 55dd149
Small refactor so that we first initiate the Navigation (ToolManager)…
OceanWolf 15ac091
Update for Sphinx documentation
OceanWolf 8cd241c
Moved default_tool initilisation to FigureManagerBase and cleaned.
OceanWolf 39f5b74
Fix navigation
OceanWolf b20dade
Temporary fix to backends
OceanWolf ff94301
Merge pull request #1 from OceanWolf/navigation-toolbar-coexistence-e…
fariza 2cb4501
removing persistent tools
fariza 9d3c977
removing unregister
fariza 6e0b7e6
change cursor inmediately after toggle
fariza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
removing persistent tools
- Loading branch information
commit 2cb4501ee7eabf40b94bc604c16e8c1f8351bbcf
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this
from_toolbar
argument messy, it shouldn't matter where the request to toggle the tool between an on/off state came from. I can see why you did it but I think, we don't need it, basically rewrite the above if block as:and create the extra method in Toolbar{Base,GTK3,TK}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That implies more work for the people creating the toolbars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but not too much extra work, only a 5 lines of extra code, per backend I would imagine; and makes the method calls clearer, especially in the future if/when other methods for selecting tools come about.
If the extra work remains the only concern, then the
_toggle
method could get taken out of the specific backends entirely, replacing the_toggle
method with a_set_state
method, withToolbarBase
still having atoggle
method, but it can do the logic of which state to set instead of the specific toolbar. TakingToolbarGTK3
as an example this would use even less code.Taking these ideas one step further, what do you think about replacing my suggested codeblock above with something more like:
where the argument passed to
ToolStateChangedEvent
, either the name and the state, or the tool itself (which should encapsulate those two items).Through something like this we generalise the toggling mechanism, and allow for an arbitrary number of observers, say for example someone in the future wants to add a right click menu with tools inside.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OceanWolf can you try to make a PR against my branch with this change?
Please include only this change so I can review it easily.
Quoting #2624 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing :). Looking forward to it, my first github pull request :D.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the only difference is that you create a branch based on my branch, and that the PR is against my branch (on my repo) not master (on matplotlib repo)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually for setting the fork, is
http://matplotlib.org/devel/gitwash/forking_hell.html#forking
http://matplotlib.org/devel/gitwash/set_up_fork.html#set-up-fork
Then you go to the installation, and then to the workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I have the navigation example working! :D. Thank you for your help!
To clarify, by:
What did you consider as
this change
? As I have started coding, I have realised that:FigureManagerBase
and into a mixin, otherwise I would duplicate code.ToolbarBase
the following rough code:Otherwise:
ToolbarBase
needs to know of allNavigation
, and thus has access to all tools, and...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OceanWolf
The event framework has to remain in
FigureManagerBase
. If you want, later it can be addressed with other MEP. That is too big of a change to be included in this MEP.I know it is tempting to solve all the problems in one shot ;).
Keep in mind the MAIN GOAL is to make it easy to create
Tools
, andToolbars
, and to reconfigure them.Navigation
is just a side effect needed to get there.I think we are there, we attain the main goal, currently we are just sanding the corners to see if the core developers like what they see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fariza Yes, I see what you mean. Very tempting indeed, for me because of the desire to keep backward comparability, knowing that when other problems get solved, it may well in turn enable a better/clearer API for tools.
I have made quite a bit of progress, so I shall keep going a bit further to see the end result, if I may. Not too much further to go :).