Loading analysis/analysisview.py +2 −4 Original line number Original line Diff line number Diff line Loading @@ -822,15 +822,13 @@ class ParticleAnalysis(QtWidgets.QMainWindow): self.parent.contouritem.colorList = colorList self.parent.contouritem.colorList = colorList self.parent.contouritem.update() self.parent.contouritem.update() self.parent.imparent.legend.items = legendItems self.parent.imparent.legend.setTextColorItems(legendItems) self.parent.imparent.legend.update() self.parent.imparent.legend.show() self.parent.imparent.legend.show() else: else: self.parent.contouritem.colorList = [] self.parent.contouritem.colorList = [] self.parent.contouritem.update() self.parent.contouritem.update() self.parent.imparent.legend.items = [] self.parent.imparent.legend.setTextColorItems([]) self.parent.imparent.legend.update() self.parent.imparent.legend.hide() self.parent.imparent.legend.hide() def show_hide_labels(self): def show_hide_labels(self): Loading analysis/analysisWidgets.py→colorlegend.py +9 −1 Original line number Original line Diff line number Diff line Loading @@ -24,7 +24,7 @@ import numpy as np WX, WY = 1024, 200 WX, WY = 1024, 200 class Legend(QtWidgets.QMdiSubWindow): class ColorLegend(QtWidgets.QMdiSubWindow): def __init__(self, parent=None): def __init__(self, parent=None): super().__init__(parent) super().__init__(parent) Loading @@ -38,6 +38,14 @@ class Legend(QtWidgets.QMdiSubWindow): self.fontSize = 15 self.fontSize = 15 self.spacer = 10 self.spacer = 10 def setTextColorItems(self, items): for text, color in items: print(text, color) assert type(text)==str or type(text)==np.str_, "items must be tuples of text and QColor" assert type(color)==QtGui.QColor or type(color)==QtCore.Qt.GlobalColor, "items must be tuples of text and QColor" self.items = items self.update() def mousePressEvent(self, event): def mousePressEvent(self, event): if event.button()==QtCore.Qt.LeftButton: if event.button()==QtCore.Qt.LeftButton: self.drag = event.pos() self.drag = event.pos() Loading gepard.py +2 −2 Original line number Original line Diff line number Diff line Loading @@ -23,7 +23,7 @@ from sampleview import SampleView from scalebar import ScaleBar from scalebar import ScaleBar from ramancom.ramancontrol import defaultPath from ramancom.ramancontrol import defaultPath from ramancom.ramanSwitch import RamanSwitch from ramancom.ramanSwitch import RamanSwitch from analysis.analysisWidgets import Legend from colorlegend import ColorLegend import os import os from pathlib import Path from pathlib import Path Loading @@ -39,7 +39,7 @@ class MeasureParticleWindow(QtWidgets.QMainWindow): self.view.imparent = self self.view.imparent = self self.view.ScalingChanged.connect(self.scalingChanged) self.view.ScalingChanged.connect(self.scalingChanged) self.scalebar = ScaleBar(self) self.scalebar = ScaleBar(self) self.legend = Legend(self) self.legend = ColorLegend(self) self.ramanSwitch = RamanSwitch(self) self.ramanSwitch = RamanSwitch(self) self.view.ScalingChanged.connect(self.scalebar.updateScale) self.view.ScalingChanged.connect(self.scalebar.updateScale) Loading Loading
analysis/analysisview.py +2 −4 Original line number Original line Diff line number Diff line Loading @@ -822,15 +822,13 @@ class ParticleAnalysis(QtWidgets.QMainWindow): self.parent.contouritem.colorList = colorList self.parent.contouritem.colorList = colorList self.parent.contouritem.update() self.parent.contouritem.update() self.parent.imparent.legend.items = legendItems self.parent.imparent.legend.setTextColorItems(legendItems) self.parent.imparent.legend.update() self.parent.imparent.legend.show() self.parent.imparent.legend.show() else: else: self.parent.contouritem.colorList = [] self.parent.contouritem.colorList = [] self.parent.contouritem.update() self.parent.contouritem.update() self.parent.imparent.legend.items = [] self.parent.imparent.legend.setTextColorItems([]) self.parent.imparent.legend.update() self.parent.imparent.legend.hide() self.parent.imparent.legend.hide() def show_hide_labels(self): def show_hide_labels(self): Loading
analysis/analysisWidgets.py→colorlegend.py +9 −1 Original line number Original line Diff line number Diff line Loading @@ -24,7 +24,7 @@ import numpy as np WX, WY = 1024, 200 WX, WY = 1024, 200 class Legend(QtWidgets.QMdiSubWindow): class ColorLegend(QtWidgets.QMdiSubWindow): def __init__(self, parent=None): def __init__(self, parent=None): super().__init__(parent) super().__init__(parent) Loading @@ -38,6 +38,14 @@ class Legend(QtWidgets.QMdiSubWindow): self.fontSize = 15 self.fontSize = 15 self.spacer = 10 self.spacer = 10 def setTextColorItems(self, items): for text, color in items: print(text, color) assert type(text)==str or type(text)==np.str_, "items must be tuples of text and QColor" assert type(color)==QtGui.QColor or type(color)==QtCore.Qt.GlobalColor, "items must be tuples of text and QColor" self.items = items self.update() def mousePressEvent(self, event): def mousePressEvent(self, event): if event.button()==QtCore.Qt.LeftButton: if event.button()==QtCore.Qt.LeftButton: self.drag = event.pos() self.drag = event.pos() Loading
gepard.py +2 −2 Original line number Original line Diff line number Diff line Loading @@ -23,7 +23,7 @@ from sampleview import SampleView from scalebar import ScaleBar from scalebar import ScaleBar from ramancom.ramancontrol import defaultPath from ramancom.ramancontrol import defaultPath from ramancom.ramanSwitch import RamanSwitch from ramancom.ramanSwitch import RamanSwitch from analysis.analysisWidgets import Legend from colorlegend import ColorLegend import os import os from pathlib import Path from pathlib import Path Loading @@ -39,7 +39,7 @@ class MeasureParticleWindow(QtWidgets.QMainWindow): self.view.imparent = self self.view.imparent = self self.view.ScalingChanged.connect(self.scalingChanged) self.view.ScalingChanged.connect(self.scalingChanged) self.scalebar = ScaleBar(self) self.scalebar = ScaleBar(self) self.legend = Legend(self) self.legend = ColorLegend(self) self.ramanSwitch = RamanSwitch(self) self.ramanSwitch = RamanSwitch(self) self.view.ScalingChanged.connect(self.scalebar.updateScale) self.view.ScalingChanged.connect(self.scalebar.updateScale) Loading