|
|
|
@ -19,6 +19,7 @@ from PySide import QtGui, QtCore
|
|
|
|
|
import os, time, urllib2
|
|
|
|
|
from calculate.api.client.function import create_obj
|
|
|
|
|
from calculate.lib.utils.files import readLinesFile
|
|
|
|
|
import Image
|
|
|
|
|
|
|
|
|
|
class TopMenu(QtGui.QPushButton):
|
|
|
|
|
def __init__(self, label, images, parent = None):
|
|
|
|
@ -1200,7 +1201,7 @@ class SelectList(QtGui.QGroupBox):
|
|
|
|
|
self.grid = QtGui.QGridLayout(self)
|
|
|
|
|
self.grid.setContentsMargins(0, 0, 0, 0)
|
|
|
|
|
self.grid.setSpacing(4)
|
|
|
|
|
self.grid.setAlignment(QtCore.Qt.AlignTop)
|
|
|
|
|
self.grid.setAlignment(QtCore.Qt.AlignTop | QtCore.Qt.AlignLeft)
|
|
|
|
|
|
|
|
|
|
if add_ability:
|
|
|
|
|
plus_but = QtGui.QPushButton(self)
|
|
|
|
@ -1271,7 +1272,7 @@ class SelectList(QtGui.QGroupBox):
|
|
|
|
|
self.CheckBoxList.append(item)
|
|
|
|
|
self.resize(self.sizeHint())
|
|
|
|
|
self.setStyleSheet("QGroupBox {"
|
|
|
|
|
'padding-top: 24px; padding-bottom: 0px;'
|
|
|
|
|
'padding-top: 8px; padding-bottom: 0px;'
|
|
|
|
|
'padding-left: 5px; padding-right: 5px;'
|
|
|
|
|
'border: 1px solid transparent;'
|
|
|
|
|
'border-top-color: gray;'
|
|
|
|
@ -2336,17 +2337,27 @@ class ImageLabel(QtGui.QLabel):
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
style = ''
|
|
|
|
|
if repeat.lower() == 'no':
|
|
|
|
|
if len(list_data) == 3:
|
|
|
|
|
# top_image = os.path.join(image_path, list_data[2])
|
|
|
|
|
# if os.path.isfile(os.path.join(image_path, list_data[2]))
|
|
|
|
|
color1 = list_data[1]
|
|
|
|
|
color2 = color1
|
|
|
|
|
elif len(list_data) > 3:
|
|
|
|
|
color1, color2 = list_data[-2:]
|
|
|
|
|
if len(list_data) > 1:
|
|
|
|
|
style = "background-color: qlineargradient(x1: 0, y1: 0, " + \
|
|
|
|
|
"x2: 0, y2: 1, stop: 0 %s, stop: 1 %s);" %(color1, color2)
|
|
|
|
|
# if repeat.lower() == 'no':
|
|
|
|
|
|
|
|
|
|
if len(list_data) == 3:
|
|
|
|
|
print list_data[2]
|
|
|
|
|
fix_image_path = os.path.join(image_path, list_data[2])
|
|
|
|
|
if os.path.isfile(fix_image_path):
|
|
|
|
|
layout = QtGui.QHBoxLayout(self)
|
|
|
|
|
fix_image = QtGui.QLabel(self)
|
|
|
|
|
fix_image.setStyleSheet("background-image: url(%s); " \
|
|
|
|
|
%fix_image_path)
|
|
|
|
|
img = Image.open(fix_image_path)
|
|
|
|
|
fix_image.setFixedWidth(img.size[0])
|
|
|
|
|
layout.addWidget(fix_image)
|
|
|
|
|
layout.setContentsMargins(0,0,0,0)
|
|
|
|
|
layout.setAlignment(QtCore.Qt.AlignLeft)
|
|
|
|
|
|
|
|
|
|
elif len(list_data) > 3:
|
|
|
|
|
color1, color2 = list_data[-2:]
|
|
|
|
|
style = "background-color: qlineargradient(x1: 0, y1: 0, " + \
|
|
|
|
|
"x2: 0, y2: 1, stop: 0 %s, stop: 1 %s);" %(color1, color2)
|
|
|
|
|
|
|
|
|
|
style += "background-image: url(%s); " %image
|
|
|
|
|
style += "background-attachment: fixed; "
|
|
|
|
|
style += "background-repeat: %s; " %repeat_dict[repeat.lower()]
|
|
|
|
|