Skip to content

Commit

Permalink
Merge pull request #6360 from jnsebgosselin/add_oe_actions_from_cm_to_tb
Browse files Browse the repository at this point in the history
PR: Harmonized the toolbar of the Outline Explorer with its context menu.
  • Loading branch information
ccordoba12 authored Feb 2, 2018
2 parents a58bff5 + 18f7472 commit d85dcbd
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions spyder/widgets/editortools.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,20 +528,24 @@ def toggle_visibility(self, state):
current_editor.setFocus()
if state:
self.outlineexplorer_is_visible.emit()

def setup_buttons(self):
fromcursor_btn = create_toolbutton(self,
icon=ima.icon('fromcursor'),
"""Setup the buttons of the outline explorer widget toolbar."""
fromcursor_btn = create_toolbutton(
self, icon=ima.icon('fromcursor'),
tip=_('Go to cursor position'),
triggered=self.treewidget.go_to_cursor_position)
collapse_btn = create_toolbutton(self)
collapse_btn.setDefaultAction(self.treewidget.collapse_selection_action)
expand_btn = create_toolbutton(self)
expand_btn.setDefaultAction(self.treewidget.expand_selection_action)
restore_btn = create_toolbutton(self)
restore_btn.setDefaultAction(self.treewidget.restore_action)
return (fromcursor_btn, collapse_btn, expand_btn, restore_btn)


buttons = [fromcursor_btn]
for action in [self.treewidget.collapse_all_action,
self.treewidget.expand_all_action,
self.treewidget.restore_action,
self.treewidget.collapse_selection_action,
self.treewidget.expand_selection_action]:
buttons.append(create_toolbutton(self))
buttons[-1].setDefaultAction(action)
return buttons

def set_current_editor(self, editor, fname, update, clear):
if clear:
self.remove_editor(editor)
Expand Down

0 comments on commit d85dcbd

Please sign in to comment.