Mainwindow plotWidget size fix

This commit is contained in:
Marcel Paffrath 2017-05-19 09:23:02 +02:00
parent 1143d97f36
commit cf971d6a87
2 changed files with 9 additions and 7 deletions

View File

@ -743,7 +743,7 @@ class MainWindow(QMainWindow):
for item in itemlist: for item in itemlist:
item.setEnabled(False) item.setEnabled(False)
model.appendRow(itemlist) model.appendRow(itemlist)
if not event.path == self.eventBox.itemText(id): if not event.path == self.eventBox.itemText(id).strip():
message = ('Path missmatch creating eventbox.\n' message = ('Path missmatch creating eventbox.\n'
'{} unequal {}.' '{} unequal {}.'
.format(event.path, self.eventBox.itemText(id))) .format(event.path, self.eventBox.itemText(id)))
@ -1039,17 +1039,19 @@ class MainWindow(QMainWindow):
wfst += self.get_data().getWFData().select(component=alter_comp) wfst += self.get_data().getWFData().select(component=alter_comp)
height_need = len(self.data.getWFData())*12 height_need = len(self.data.getWFData())*12
plotWidget = self.getPlotWidget() plotWidget = self.getPlotWidget()
if plotWidget.frameSize().height() < height_need: if self.tabs.widget(0).frameSize().height() < height_need:
plotWidget.setFixedHeight(height_need) plotWidget.setMinimumHeight(height_need)
else: else:
plotWidget.setFixedHeight(plotWidget.frameSize().height()) plotWidget.setMinimumHeight(0)
plotWidget.figure.tight_layout()
plotWidget.plotWFData(wfdata=wfst, title=title, mapping=False) plotWidget.plotWFData(wfdata=wfst, title=title, mapping=False)
plotDict = plotWidget.getPlotDict() plotDict = plotWidget.getPlotDict()
pos = plotDict.keys() pos = plotDict.keys()
labels = [plotDict[n][0] for n in pos] labels = [plotDict[n][0] for n in pos]
plotWidget.setYTickLabels(pos, labels) plotWidget.setYTickLabels(pos, labels)
try:
plotWidget.figure.tight_layout() plotWidget.figure.tight_layout()
except:
pass
def plotZ(self): def plotZ(self):
self.setComponent('Z') self.setComponent('Z')

View File

@ -1 +1 @@
f814-dirty 1143-dirty