Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3e42261

Browse files
committed
set settings window to non modal
1 parent 88f23d3 commit 3e42261

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

lib/matplotlib/backends/backend_qt5.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ def configure_subplots(self):
778778
image = str(cbook._get_data_path('images/matplotlib.png'))
779779
dia = SubplotToolQt(self.canvas.figure, self.canvas.parent())
780780
dia.setWindowIcon(QtGui.QIcon(image))
781-
dia.exec_()
781+
dia.show()
782782

783783
def save_figure(self, *args):
784784
filetypes = self.canvas.get_supported_filetypes_grouped()
@@ -867,7 +867,7 @@ def _export_values(self):
867867
QtGui.QFontMetrics(text.document().defaultFont())
868868
.size(0, text.toPlainText()).height() + 20)
869869
text.setMaximumSize(size)
870-
dialog.exec_()
870+
dialog.show()
871871

872872
def _on_value_changed(self):
873873
self._figure.subplots_adjust(**{attr: self._widgets[attr].value()

lib/matplotlib/backends/qt_editor/_formlayout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ def update_buttons(self):
470470

471471
def accept(self):
472472
self.data = self.formwidget.get()
473+
self.apply_callback(self.data)
473474
super().accept()
474475

475476
def reject(self):
@@ -518,8 +519,7 @@ def fedit(data, title="", comment="", icon=None, parent=None, apply=None):
518519
if QtWidgets.QApplication.startingUp():
519520
_app = QtWidgets.QApplication([])
520521
dialog = FormDialog(data, title, comment, icon, parent, apply)
521-
if dialog.exec_():
522-
return dialog.get()
522+
dialog.show()
523523

524524

525525
if __name__ == "__main__":

lib/matplotlib/backends/qt_editor/figureoptions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,8 @@ def apply_callback(data):
251251
if not (axes.get_xlim() == orig_xlim and axes.get_ylim() == orig_ylim):
252252
figure.canvas.toolbar.push_current()
253253

254-
data = _formlayout.fedit(
254+
_formlayout.fedit(
255255
datalist, title="Figure options", parent=parent,
256256
icon=QtGui.QIcon(
257257
str(cbook._get_data_path('images', 'qt4_editor_options.svg'))),
258258
apply=apply_callback)
259-
if data is not None:
260-
apply_callback(data)

0 commit comments

Comments
 (0)