Skip to content

Commit

Permalink
[ci-skip]
Browse files Browse the repository at this point in the history
Update widget icon.

Icon and tooltip are changed to reflect current state.
  • Loading branch information
mrclary committed May 16, 2024
1 parent f66d995 commit e7e480a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions spyder/plugins/pythonpath/widgets/pathmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,9 @@ def _setup_right_toolbar(self):
tip=_("Export to PYTHONPATH environment variable"))
self.prioritize_button = self.create_toolbutton(
PathManagerToolbuttons.Prioritize,
icon=self.create_icon('first_page'),
option='prioritize',
triggered=self.refresh,
tip=_("Place PYTHONPATH at the front of sys.path"))
)
self.prioritize_button.setCheckable(True)

self.selection_widgets = [self.movetop_button, self.moveup_button,
Expand Down Expand Up @@ -472,6 +471,13 @@ def refresh(self):
and (self.editable_top_row <= row <= self.editable_bottom_row)
)

if self.prioritize_button.isChecked():
self.prioritize_button.setIcon(self.create_icon('prepend'))
self.prioritize_button.setToolTip(_("Paths are prpended to sys.path"))
else:
self.prioritize_button.setIcon(self.create_icon('append'))
self.prioritize_button.setToolTip(_("Paths are appended to sys.path"))

self.export_button.setEnabled(self.listwidget.count() > 0)

# Ok button only enabled if actual changes occur
Expand Down
2 changes: 2 additions & 0 deletions spyder/utils/icon_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ def __init__(self):
'1uparrow': [('mdi.arrow-up',), {'color': self.MAIN_FG_COLOR}],
'2downarrow': [('mdi.arrow-collapse-down',), {'color': self.MAIN_FG_COLOR}],
'1downarrow': [('mdi.arrow-down',), {'color': self.MAIN_FG_COLOR}],
'prepend': [('mdi.arrow-collapse-left',), {'color': self.MAIN_FG_COLOR}],
'append': [('mdi.arrow-collapse-right',), {'color': self.MAIN_FG_COLOR}],
'undock': [('mdi.open-in-new',), {'color': self.MAIN_FG_COLOR}],
'close_pane': [('mdi.window-close',), {'color': self.MAIN_FG_COLOR}],
'toolbar_ext_button': [('mdi.dots-horizontal',), {'color': self.MAIN_FG_COLOR}],
Expand Down

0 comments on commit e7e480a

Please sign in to comment.