Skip to content

Commit

Permalink
Remove back and forward buttons from viewer toolbars
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Jan 18, 2018
1 parent 76f4d3d commit 95af0dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 36 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ v0.13.0 (unreleased)
precision required given the separation of world coordinate values.
[#1500]

* Remove back/forward tools in Matplotlib viewer toolbars to
declutter. [#1505]

* Added a new component manager that makes it possible to rename,
reorder, and remove components, as well as better manage derived
components, including editing previous equations. [#1479]
Expand Down
37 changes: 1 addition & 36 deletions glue/viewers/matplotlib/qt/toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
else:
from matplotlib.backends.backend_qt4 import NavigationToolbar2QT

__all__ = ['HomeTool', 'SaveTool', 'BackTool', 'ForwardTool', 'PanTool',
'ZoomTool', 'MatplotlibViewerToolbar']
__all__ = ['HomeTool', 'SaveTool', 'PanTool', 'ZoomTool', 'MatplotlibViewerToolbar']


class HomeTool(Tool):
Expand Down Expand Up @@ -51,34 +50,6 @@ def activate(self):
self.toolbar.save_figure()


class BackTool(Tool):

def __init__(self, viewer, toolbar=None):
super(BackTool, self).__init__(viewer=viewer)
self.tool_id = 'mpl:back'
self.icon = get_icon('glue_back')
self.action_text = 'Back'
self.tool_tip = 'Back to previous view'
self.toolbar = toolbar

def activate(self):
self.toolbar.back()


class ForwardTool(Tool):

def __init__(self, viewer, toolbar=None):
super(ForwardTool, self).__init__(viewer=viewer)
self.tool_id = 'mpl:forward'
self.icon = get_icon('glue_forward')
self.action_text = 'Forward'
self.tool_tip = 'Forward to next view'
self.toolbar = toolbar

def activate(self):
self.toolbar.forward()


class PanTool(CheckableTool):

def __init__(self, viewer, toolbar=None):
Expand Down Expand Up @@ -147,12 +118,6 @@ def setup_default_modes(self):
save_mode = SaveTool(self.parent(), toolbar=self._mpl_nav)
self.add_tool(save_mode)

back_mode = BackTool(self.parent(), toolbar=self._mpl_nav)
self.add_tool(back_mode)

forward_mode = ForwardTool(self.parent(), toolbar=self._mpl_nav)
self.add_tool(forward_mode)

pan_mode = PanTool(self.parent(), toolbar=self._mpl_nav)
self.add_tool(pan_mode)

Expand Down

0 comments on commit 95af0dc

Please sign in to comment.