forked from IPKM/nmreval
hacky solution to have correct tuda colors in agr file; closes #63
This commit is contained in:
@ -55,9 +55,9 @@ class GraceExporter:
|
||||
break
|
||||
|
||||
if c_num == -1:
|
||||
c_num = max(colors.keys())
|
||||
colors[c_num + 1] = (f'color{c_num + 1}', sc)
|
||||
new_colors.append((c_num + 1, f'color{c_num + 1}', sc))
|
||||
c_num = max(colors.keys())+1
|
||||
colors[c_num] = (f'color{c_num}', sc)
|
||||
new_colors.append((c_num, f'color{c_num}', sc))
|
||||
|
||||
new_s.set_symbol(**{'symbol': item['symbol'].value, 'size': item['symbolsize'] / 10., 'color': c_num,
|
||||
'fill color': c_num, 'fill pattern': 1})
|
||||
|
@ -30,7 +30,7 @@ class PropertyDelegate(QtWidgets.QStyledItemDelegate):
|
||||
|
||||
rect = options.rect
|
||||
rect.adjust(5, 0, -5, 0)
|
||||
mid = (rect.bottom()+rect.top()) / 2
|
||||
mid = int((rect.bottom()+rect.top()) / 2)
|
||||
painter.drawLine(rect.left(), mid, rect.right(), mid)
|
||||
painter.restore()
|
||||
|
||||
@ -42,7 +42,7 @@ class PropertyDelegate(QtWidgets.QStyledItemDelegate):
|
||||
painter.setPen(pen)
|
||||
|
||||
pm = make_symbol_pixmap(r)
|
||||
painter.drawPixmap(options.rect.topLeft()+QtCore.QPoint(3, (options.rect.height()-pm.height())/2), pm)
|
||||
painter.drawPixmap(options.rect.topLeft()+QtCore.QPoint(3, int((options.rect.height()-pm.height())/2)), pm)
|
||||
|
||||
style = QtWidgets.QApplication.style()
|
||||
text_rect = style.subElementRect(QtWidgets.QStyle.SE_ItemViewItemText, options, None)
|
||||
@ -171,7 +171,7 @@ class LineStyleEditor(QtWidgets.QComboBox):
|
||||
rect = painter.style().subControlRect(QtWidgets.QStyle.CC_ComboBox,
|
||||
opt, QtWidgets.QStyle.SC_ComboBoxEditField, None)
|
||||
rect.adjust(+10, 0, -10, 0)
|
||||
mid = (rect.bottom() + rect.top()) / 2
|
||||
mid = int((rect.bottom() + rect.top()) / 2)
|
||||
painter.drawLine(rect.left(), mid, rect.right(), mid)
|
||||
painter.end()
|
||||
else:
|
||||
@ -193,7 +193,7 @@ class LineStyleDelegate(QtWidgets.QStyledItemDelegate):
|
||||
|
||||
rect = option.rect
|
||||
rect.adjust(+10, 0, -10, 0)
|
||||
mid = (rect.bottom()+rect.top()) / 2
|
||||
mid = int((rect.bottom()+rect.top()) / 2)
|
||||
painter.drawLine(rect.left(), mid, rect.right(), mid)
|
||||
else:
|
||||
QtWidgets.QStyledItemDelegate.paint(self, painter, option, index)
|
||||
|
Reference in New Issue
Block a user