def getColormapDialog(self): """Returns a shared color dialog. :rtype: ColorDialog """ if self.__defaultColormapDialog is None: parent = self.__parent() if parent is None: return None dialog = ColormapDialog(parent=parent) dialog.setModal(False) def dialogShown(): dialog = self.__defaultColormapDialog self.restoreWindowLocationSettings("colormap-dialog", dialog) # Sync with the raw image data = self.getCalibrationModel().experimentSettingsModel().image().value() dialog.setData(data) def dialogHidden(): dialog = self.__defaultColormapDialog self.saveWindowLocationSettings("colormap-dialog", dialog) eventutils.createShowSignal(dialog) eventutils.createHideSignal(dialog) dialog.sigShown.connect(dialogShown) dialog.sigHidden.connect(dialogHidden) self.__defaultColormapDialog = dialog return self.__defaultColormapDialog
def _createDialog(parent): """Create the dialog if not already existing :parent QWidget parent: Parent of the new colormap :rtype: ColormapDialog """ from silx.gui.dialog.ColormapDialog import ColormapDialog dialog = ColormapDialog(parent=parent) dialog.setModal(False) return dialog
def defaultColorDialog(self): """Returns a default color dialog. :rtype: ColormapDialog """ dialog = None if self.__hooks is not None: dialog = self.__hooks.getColormapDialog(self) if dialog is None: dialog = ColormapDialog() dialog.setModal(False) return dialog
def getColormapDialog(self, view): """Returns a shared color dialog as default for all the views. Override from DataViewHooks :rtype: ColorDialog """ if self.__defaultColormapDialog is None: parent = self.__parent() if parent is None: return None dialog = ColormapDialog(parent=parent) dialog.setModal(False) self.__defaultColormapDialog = dialog return self.__defaultColormapDialog
def createColorDialog(self): newDialog = ColormapDialog(self) newDialog.finished.connect( functools.partial(self.removeColorDialog, newDialog)) self.colorDialogs.append(newDialog) self.mainWidget.layout().addWidget(newDialog)