8000 Properly enable forward/backward buttons on Qt5 · matplotlib/matplotlib@a915458 · GitHub
[go: up one dir, main page]

Skip to content

Commit a915458

Browse files
committed
Properly enable forward/backward buttons on Qt5
1 parent 2698288 commit a915458

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/matplotlib/backends/backend_qt5.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,12 @@ def save_figure(self, *args):
856856
self, "Error saving file", str(e),
857857
QtWidgets.QMessageBox.Ok, QtWidgets.QMessageBox.NoButton)
858858

859+
def set_history_buttons(self):
860+
can_backward = self._nav_stack._pos > 0
861+
can_forward = self._nav_stack._pos < len(self._nav_stack._elements) - 1
862+
self._actions['back'].setEnabled(can_backward)
863+
self._actions['forward'].setEnabled(can_forward)
864+
859865

860866
class SubplotToolQt(UiSubplotTool):
861867
def __init__(self, targetfig, parent):

0 commit comments

Comments
 (0)
0