|
|
|
@ -34,6 +34,14 @@ def get_system_rgb(obj, pallete_type):
|
|
|
|
|
color = obj.palette().color(pallete_type).getRgb()
|
|
|
|
|
return "rgb%s"%str(color[0:3])
|
|
|
|
|
|
|
|
|
|
def dpivalue(size):
|
|
|
|
|
try:
|
|
|
|
|
return size * qt.QApplication.screen()[0].logicalDotsPerInch() / 96.0;
|
|
|
|
|
except BaseExeception as e:
|
|
|
|
|
if isinstance(e, KeyboardInterrupt):
|
|
|
|
|
raise
|
|
|
|
|
return size
|
|
|
|
|
|
|
|
|
|
def alphed(rgbstr, value):
|
|
|
|
|
return rgbstr.replace(")", ",%d)"%value)
|
|
|
|
|
|
|
|
|
@ -227,7 +235,7 @@ class ButtonMenu(qt.QPushButton):
|
|
|
|
|
if not label:
|
|
|
|
|
label = name
|
|
|
|
|
self.lbl = LabelWordWrap(label, self)
|
|
|
|
|
self.lbl.setFixedHeight(30)
|
|
|
|
|
self.lbl.setFixedHeight(dpivalue(52) - 22)
|
|
|
|
|
self.lbl.setAlignment(qt.Qt.AlignHCenter | qt.Qt.AlignTop)
|
|
|
|
|
self.lbl.resize(self.lbl.sizeHint())
|
|
|
|
|
self.lbl.setStyleSheet("QLabel {border: None;}")
|
|
|
|
@ -238,7 +246,7 @@ class ButtonMenu(qt.QPushButton):
|
|
|
|
|
self.layout.setContentsMargins(0,8,0,0)
|
|
|
|
|
# self.layout.setSpacing(28)
|
|
|
|
|
|
|
|
|
|
self.setFixedSize(110,84)
|
|
|
|
|
self.setFixedSize(20 + dpivalue(90),54 + dpivalue(30))
|
|
|
|
|
self.setObjectName(name)
|
|
|
|
|
|
|
|
|
|
# rgb(218,218,218)
|
|
|
|
|