forked from IPKM/nmreval
removed symbols from shift/scale, combobox in fitparameter respects sizehint
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
from . import HAS_IMPORTLIB_RESOURCE
|
||||
from ..Qt import QtGui, QtWidgets
|
||||
from ..Qt import QtGui, QtWidgets, QtCore
|
||||
|
||||
|
||||
class DarkPalette(QtGui.QPalette):
|
||||
@ -97,6 +97,14 @@ class MyProxyStyle(QtWidgets.QProxyStyle):
|
||||
from pkg_resources import resource_filename
|
||||
with open(resource_filename('resources.icons', 'style.qss'), 'r') as f:
|
||||
obj.setStyleSheet(f.read())
|
||||
|
||||
else:
|
||||
return super().polish(obj)
|
||||
|
||||
def drawComplexControl(self, control: QtWidgets.QStyle.ComplexControl,
|
||||
opts: QtWidgets.QStyleOptionComplex, painter: QtGui.QPainter, widget=None):
|
||||
if control == QtWidgets.QStyle.CC_ComboBox:
|
||||
textrect = self.baseStyle().subControlRect(QtWidgets.QStyle.CC_ComboBox, opts, QtWidgets.QStyle.SC_ComboBoxEditField, widget)
|
||||
opts.currentText = painter.fontMetrics().elidedText(opts.currentText, QtCore.Qt.ElideRight, textrect.width())
|
||||
super().drawComplexControl(control, opts, painter, widget=widget)
|
||||
else:
|
||||
super().drawComplexControl(control, opts, painter, widget=widget)
|
||||
|
Reference in New Issue
Block a user