@@ -652,6 +652,13 @@ def set_window_title(self, title):
652
652
class NavigationToolbar2QT (NavigationToolbar2 , QtWidgets .QToolBar ):
653
653
message = QtCore .Signal (str )
654
654
655
+ toolitems = [* NavigationToolbar2 .toolitems ]
656
+ toolitems .insert (
657
+ # Add 'customize' action after 'subplots'
658
+ [name for name , * _ in toolitems ].index ("Subplots" ) + 1 ,
659
+ ("Customize" , "Edit axis, curve and image parameters" ,
660
+ "qt4_editor_options" , "edit_parameters" ))
661
+
655
662
def __init__ (self , canvas , parent , coordinates = True ):
656
663
"""coordinates: should we show the coordinates on the right?"""
657
664
self .canvas = canvas
@@ -695,11 +702,6 @@ def _init_toolbar(self):
695
702
a .setCheckable (True )
696
703
if tooltip_text is not None :
697
704
a .setToolTip (tooltip_text )
698
- if text == 'Subplots' :
699
- a = self .addAction (self ._icon ("qt4_editor_options.png" ,
700
- icon_color ),
701
- 'Customize' , self .edit_parameters )
702
- a .setToolTip ('Edit axis, curve and image parameters' )
703
705
704
706
# Add the (x, y) location widget at the right side of the toolbar
705
707
# The stretch factor is 1 which means any resizing of the toolbar
0 commit comments