Merge pull request #53 from djfun/more-text-options
More text component options
This commit is contained in:
commit
8da72ab3cb
|
@ -198,7 +198,7 @@ class Component(QtCore.QObject, metaclass=ComponentMetaclass):
|
||||||
try:
|
try:
|
||||||
preset = self.savePreset()
|
preset = self.savePreset()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
preset = '%s occured while saving preset' % str(e)
|
preset = '%s occurred while saving preset' % str(e)
|
||||||
return '%s\n%s\n%s' % (
|
return '%s\n%s\n%s' % (
|
||||||
self.__class__.name, str(self.__class__.version), preset
|
self.__class__.name, str(self.__class__.version), preset
|
||||||
)
|
)
|
||||||
|
@ -275,7 +275,7 @@ class Component(QtCore.QObject, metaclass=ComponentMetaclass):
|
||||||
Call super().widget(*args) to create the component widget
|
Call super().widget(*args) to create the component widget
|
||||||
which also auto-connects any common widgets (e.g., checkBoxes)
|
which also auto-connects any common widgets (e.g., checkBoxes)
|
||||||
to self.update(). Then in a subclass connect special actions
|
to self.update(). Then in a subclass connect special actions
|
||||||
(e.g., pushButtons to select a file/colour) and initialize
|
(e.g., pushButtons to select a file) and initialize
|
||||||
'''
|
'''
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.settings = parent.settings
|
self.settings = parent.settings
|
||||||
|
|
|
@ -178,177 +178,177 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkBox_stretch">
|
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||||
<property name="text">
|
<item>
|
||||||
<string>Stretch</string>
|
<widget class="QCheckBox" name="checkBox_stretch">
|
||||||
</property>
|
<property name="text">
|
||||||
<property name="checked">
|
<string>Stretch</string>
|
||||||
<bool>false</bool>
|
</property>
|
||||||
</property>
|
<property name="checked">
|
||||||
</widget>
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_10">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>5</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBox_mirror">
|
||||||
|
<property name="text">
|
||||||
|
<string>Mirror</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Rotate</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="spinBox_rotate">
|
||||||
|
<property name="buttonSymbols">
|
||||||
|
<enum>QAbstractSpinBox::UpDownArrows</enum>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string notr="true">°</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>359</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>10</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Scale</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="spinBox_scale">
|
||||||
|
<property name="buttonSymbols">
|
||||||
|
<enum>QAbstractSpinBox::UpDownArrows</enum>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string>%</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>400</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>100</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_10">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<property name="orientation">
|
<item>
|
||||||
<enum>Qt::Horizontal</enum>
|
<spacer name="horizontalSpacer_2">
|
||||||
</property>
|
<property name="orientation">
|
||||||
<property name="sizeType">
|
<enum>Qt::Horizontal</enum>
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
</property>
|
||||||
</property>
|
<property name="sizeHint" stdset="0">
|
||||||
<property name="sizeHint" stdset="0">
|
<size>
|
||||||
<size>
|
<width>40</width>
|
||||||
<width>5</width>
|
<height>20</height>
|
||||||
<height>20</height>
|
</size>
|
||||||
</size>
|
</property>
|
||||||
</property>
|
</spacer>
|
||||||
</spacer>
|
</item>
|
||||||
</item>
|
<item>
|
||||||
<item>
|
<widget class="QLabel" name="label_3">
|
||||||
<widget class="QCheckBox" name="checkBox_mirror">
|
<property name="sizePolicy">
|
||||||
<property name="text">
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
<string>Mirror</string>
|
<horstretch>0</horstretch>
|
||||||
</property>
|
<verstretch>0</verstretch>
|
||||||
</widget>
|
</sizepolicy>
|
||||||
</item>
|
</property>
|
||||||
<item>
|
<property name="text">
|
||||||
<widget class="QLabel" name="label_2">
|
<string>Color</string>
|
||||||
<property name="text">
|
</property>
|
||||||
<string>Rotate</string>
|
<property name="alignment">
|
||||||
</property>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
<property name="alignment">
|
</property>
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
</widget>
|
||||||
</property>
|
</item>
|
||||||
</widget>
|
<item>
|
||||||
</item>
|
<widget class="QSpinBox" name="spinBox_color">
|
||||||
<item>
|
<property name="buttonSymbols">
|
||||||
<widget class="QSpinBox" name="spinBox_rotate">
|
<enum>QAbstractSpinBox::UpDownArrows</enum>
|
||||||
<property name="buttonSymbols">
|
</property>
|
||||||
<enum>QAbstractSpinBox::UpDownArrows</enum>
|
<property name="suffix">
|
||||||
</property>
|
<string>%</string>
|
||||||
<property name="suffix">
|
</property>
|
||||||
<string notr="true">°</string>
|
<property name="minimum">
|
||||||
</property>
|
<number>0</number>
|
||||||
<property name="minimum">
|
</property>
|
||||||
<number>0</number>
|
<property name="maximum">
|
||||||
</property>
|
<number>999</number>
|
||||||
<property name="maximum">
|
</property>
|
||||||
<number>359</number>
|
<property name="singleStep">
|
||||||
</property>
|
<number>1</number>
|
||||||
<property name="value">
|
</property>
|
||||||
<number>0</number>
|
<property name="value">
|
||||||
</property>
|
<number>100</number>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
</widget>
|
||||||
<item>
|
</item>
|
||||||
<spacer name="horizontalSpacer">
|
</layout>
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>10</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Scale</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QSpinBox" name="spinBox_scale">
|
|
||||||
<property name="buttonSymbols">
|
|
||||||
<enum>QAbstractSpinBox::UpDownArrows</enum>
|
|
||||||
</property>
|
|
||||||
<property name="suffix">
|
|
||||||
<string>%</string>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>400</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>100</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Color</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QSpinBox" name="spinBox_color">
|
|
||||||
<property name="buttonSymbols">
|
|
||||||
<enum>QAbstractSpinBox::UpDownArrows</enum>
|
|
||||||
</property>
|
|
||||||
<property name="suffix">
|
|
||||||
<string>%</string>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>999</number>
|
|
||||||
</property>
|
|
||||||
<property name="singleStep">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>100</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>633</width>
|
<width>586</width>
|
||||||
<height>178</height>
|
<height>178</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -1,25 +1,23 @@
|
||||||
from PIL import Image, ImageDraw
|
from PIL import ImageEnhance, ImageFilter, ImageChops
|
||||||
from PyQt5.QtGui import QColor, QFont
|
from PyQt5.QtGui import QColor, QFont
|
||||||
from PyQt5 import QtGui, QtCore, QtWidgets
|
from PyQt5 import QtGui, QtCore, QtWidgets
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from component import Component
|
from component import Component
|
||||||
from toolkit.frame import FramePainter
|
from toolkit.frame import FramePainter, PaintColor
|
||||||
|
|
||||||
|
|
||||||
class Component(Component):
|
class Component(Component):
|
||||||
name = 'Title Text'
|
name = 'Title Text'
|
||||||
version = '1.0.1'
|
version = '1.0.1'
|
||||||
|
|
||||||
def __init__(self, *args):
|
|
||||||
super().__init__(*args)
|
|
||||||
self.titleFont = QFont()
|
|
||||||
|
|
||||||
def widget(self, *args):
|
def widget(self, *args):
|
||||||
super().widget(*args)
|
super().widget(*args)
|
||||||
self.textColor = (255, 255, 255)
|
self.textColor = (255, 255, 255)
|
||||||
|
self.strokeColor = (0, 0, 0)
|
||||||
self.title = 'Text'
|
self.title = 'Text'
|
||||||
self.alignment = 1
|
self.alignment = 1
|
||||||
|
self.titleFont = QFont()
|
||||||
self.fontSize = self.height / 13.5
|
self.fontSize = self.height / 13.5
|
||||||
|
|
||||||
self.page.comboBox_textAlign.addItem("Left")
|
self.page.comboBox_textAlign.addItem("Left")
|
||||||
|
@ -28,6 +26,7 @@ class Component(Component):
|
||||||
self.page.comboBox_textAlign.setCurrentIndex(int(self.alignment))
|
self.page.comboBox_textAlign.setCurrentIndex(int(self.alignment))
|
||||||
|
|
||||||
self.page.lineEdit_textColor.setText('%s,%s,%s' % self.textColor)
|
self.page.lineEdit_textColor.setText('%s,%s,%s' % self.textColor)
|
||||||
|
self.page.lineEdit_strokeColor.setText('%s,%s,%s' % self.strokeColor)
|
||||||
self.page.spinBox_fontSize.setValue(int(self.fontSize))
|
self.page.spinBox_fontSize.setValue(int(self.fontSize))
|
||||||
self.page.lineEdit_title.setText(self.title)
|
self.page.lineEdit_title.setText(self.title)
|
||||||
|
|
||||||
|
@ -43,20 +42,41 @@ class Component(Component):
|
||||||
'fontSize': self.page.spinBox_fontSize,
|
'fontSize': self.page.spinBox_fontSize,
|
||||||
'xPosition': self.page.spinBox_xTextAlign,
|
'xPosition': self.page.spinBox_xTextAlign,
|
||||||
'yPosition': self.page.spinBox_yTextAlign,
|
'yPosition': self.page.spinBox_yTextAlign,
|
||||||
|
'fontStyle': self.page.comboBox_fontStyle,
|
||||||
|
'stroke': self.page.spinBox_stroke,
|
||||||
|
'strokeColor': self.page.lineEdit_strokeColor,
|
||||||
|
'shadow': self.page.checkBox_shadow,
|
||||||
|
'shadX': self.page.spinBox_shadX,
|
||||||
|
'shadY': self.page.spinBox_shadY,
|
||||||
|
'shadBlur': self.page.spinBox_shadBlur,
|
||||||
}, colorWidgets={
|
}, colorWidgets={
|
||||||
'textColor': self.page.pushButton_textColor,
|
'textColor': self.page.pushButton_textColor,
|
||||||
|
'strokeColor': self.page.pushButton_strokeColor,
|
||||||
}, relativeWidgets=[
|
}, relativeWidgets=[
|
||||||
'xPosition', 'yPosition', 'fontSize',
|
'xPosition', 'yPosition', 'fontSize',
|
||||||
|
'stroke', 'shadX', 'shadY', 'shadBlur'
|
||||||
])
|
])
|
||||||
self.centerXY()
|
self.centerXY()
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
self.titleFont = self.page.fontComboBox_titleFont.currentFont()
|
self.titleFont = self.page.fontComboBox_titleFont.currentFont()
|
||||||
|
if self.page.checkBox_shadow.isChecked():
|
||||||
|
self.page.label_shadX.setHidden(False)
|
||||||
|
self.page.spinBox_shadX.setHidden(False)
|
||||||
|
self.page.spinBox_shadY.setHidden(False)
|
||||||
|
self.page.label_shadBlur.setHidden(False)
|
||||||
|
self.page.spinBox_shadBlur.setHidden(False)
|
||||||
|
else:
|
||||||
|
self.page.label_shadX.setHidden(True)
|
||||||
|
self.page.spinBox_shadX.setHidden(True)
|
||||||
|
self.page.spinBox_shadY.setHidden(True)
|
||||||
|
self.page.label_shadBlur.setHidden(True)
|
||||||
|
self.page.spinBox_shadBlur.setHidden(True)
|
||||||
super().update()
|
super().update()
|
||||||
|
|
||||||
def centerXY(self):
|
def centerXY(self):
|
||||||
self.setRelativeWidget('xPosition', 0.5)
|
self.setRelativeWidget('xPosition', 0.5)
|
||||||
self.setRelativeWidget('yPosition', 0.5)
|
self.setRelativeWidget('yPosition', 0.521)
|
||||||
|
|
||||||
def getXY(self):
|
def getXY(self):
|
||||||
'''Returns true x, y after considering alignment settings'''
|
'''Returns true x, y after considering alignment settings'''
|
||||||
|
@ -101,14 +121,62 @@ class Component(Component):
|
||||||
return self.addText(self.width, self.height)
|
return self.addText(self.width, self.height)
|
||||||
|
|
||||||
def addText(self, width, height):
|
def addText(self, width, height):
|
||||||
|
font = self.titleFont
|
||||||
|
font.setPixelSize(self.fontSize)
|
||||||
|
font.setStyle(QFont.StyleNormal)
|
||||||
|
font.setWeight(QFont.Normal)
|
||||||
|
font.setCapitalization(QFont.MixedCase)
|
||||||
|
if self.fontStyle == 1:
|
||||||
|
font.setWeight(QFont.DemiBold)
|
||||||
|
if self.fontStyle == 2:
|
||||||
|
font.setWeight(QFont.Bold)
|
||||||
|
elif self.fontStyle == 3:
|
||||||
|
font.setStyle(QFont.StyleItalic)
|
||||||
|
elif self.fontStyle == 4:
|
||||||
|
font.setWeight(QFont.Bold)
|
||||||
|
font.setStyle(QFont.StyleItalic)
|
||||||
|
elif self.fontStyle == 5:
|
||||||
|
font.setStyle(QFont.StyleOblique)
|
||||||
|
elif self.fontStyle == 6:
|
||||||
|
font.setCapitalization(QFont.SmallCaps)
|
||||||
|
|
||||||
image = FramePainter(width, height)
|
image = FramePainter(width, height)
|
||||||
self.titleFont.setPixelSize(self.fontSize)
|
|
||||||
image.setFont(self.titleFont)
|
|
||||||
image.setPen(self.textColor)
|
|
||||||
x, y = self.getXY()
|
x, y = self.getXY()
|
||||||
|
if self.stroke > 0:
|
||||||
|
outliner = QtGui.QPainterPathStroker()
|
||||||
|
outliner.setWidth(self.stroke)
|
||||||
|
path = QtGui.QPainterPath()
|
||||||
|
if self.fontStyle == 6:
|
||||||
|
# PathStroker ignores smallcaps so we need this weird hack
|
||||||
|
path.addText(x, y, font, self.title[0])
|
||||||
|
fm = QtGui.QFontMetrics(font)
|
||||||
|
newX = x + fm.width(self.title[0])
|
||||||
|
strokeFont = self.page.fontComboBox_titleFont.currentFont()
|
||||||
|
strokeFont.setCapitalization(QFont.SmallCaps)
|
||||||
|
strokeFont.setPixelSize(int((self.fontSize / 7) * 5))
|
||||||
|
strokeFont.setLetterSpacing(QFont.PercentageSpacing, 139)
|
||||||
|
path.addText(newX, y, strokeFont, self.title[1:])
|
||||||
|
else:
|
||||||
|
path.addText(x, y, font, self.title)
|
||||||
|
path = outliner.createStroke(path)
|
||||||
|
image.setPen(QtCore.Qt.NoPen)
|
||||||
|
image.setBrush(PaintColor(*self.strokeColor))
|
||||||
|
image.drawPath(path)
|
||||||
|
|
||||||
|
image.setFont(font)
|
||||||
|
image.setPen(self.textColor)
|
||||||
image.drawText(x, y, self.title)
|
image.drawText(x, y, self.title)
|
||||||
|
|
||||||
return image.finalize()
|
# turn QImage into Pillow frame
|
||||||
|
frame = image.finalize()
|
||||||
|
if self.shadow:
|
||||||
|
shadImg = ImageEnhance.Contrast(frame).enhance(0.0)
|
||||||
|
shadImg = shadImg.filter(ImageFilter.GaussianBlur(self.shadBlur))
|
||||||
|
shadImg = ImageChops.offset(shadImg, self.shadX, self.shadY)
|
||||||
|
shadImg.paste(frame, box=(0, 0), mask=frame)
|
||||||
|
frame = shadImg
|
||||||
|
|
||||||
|
return frame
|
||||||
|
|
||||||
def commandHelp(self):
|
def commandHelp(self):
|
||||||
print('Enter a string to use as centred white text:')
|
print('Enter a string to use as centred white text:')
|
||||||
|
|
|
@ -16,6 +16,12 @@
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="sizeConstraint">
|
||||||
|
<enum>QLayout::SetDefaultConstraint</enum>
|
||||||
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
|
@ -31,7 +37,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="lineEdit_title">
|
<widget class="QLineEdit" name="lineEdit_title">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -47,14 +53,10 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -67,7 +69,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFontComboBox" name="fontComboBox_titleFont">
|
<widget class="QFontComboBox" name="fontComboBox_titleFont">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -80,91 +82,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_8">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>5</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_fontSize">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Font Size</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QSpinBox" name="spinBox_fontSize">
|
|
||||||
<property name="minimum">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>500</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_textColor">
|
|
||||||
<property name="text">
|
|
||||||
<string>Text Color</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="lineEdit_textColor"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButton_textColor">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>32</width>
|
|
||||||
<height>32</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="MaximumSize" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>32</width>
|
|
||||||
<height>32</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -186,7 +103,20 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="comboBox_textAlign"/>
|
<widget class="QComboBox" name="comboBox_textAlign">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>100</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_2">
|
<spacer name="horizontalSpacer_2">
|
||||||
|
@ -206,8 +136,14 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButton_center">
|
<widget class="QPushButton" name="pushButton_center">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Center</string>
|
<string>Center Text</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -243,14 +179,14 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSpinBox" name="spinBox_xTextAlign">
|
<widget class="QSpinBox" name="spinBox_xTextAlign">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>80</width>
|
<width>50</width>
|
||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
@ -271,6 +207,137 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_yTitleAlign">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Y</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="spinBox_yTextAlign">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>999999999</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_textColor">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Text Color</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton_textColor">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>32</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="MaximumSize" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>32</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_8">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>5</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_fontSize">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Font Size</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="spinBox_fontSize">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="prefix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>500</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_7">
|
<spacer name="horizontalSpacer_7">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -288,7 +355,7 @@
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_yTitleAlign">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -296,29 +363,284 @@
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Y</string>
|
<string>Font Style</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSpinBox" name="spinBox_yTextAlign">
|
<widget class="QComboBox" name="comboBox_fontStyle">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Normal</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Semi-Bold</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Bold</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Italic</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Bold Italic</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Faux Italic</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Small Caps</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lineEdit_textColor">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>80</width>
|
<width>0</width>
|
||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="focusPolicy">
|
||||||
<number>999999999</number>
|
<enum>Qt::NoFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Stroke</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="spinBox_stroke">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string>px</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Stroke Color</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lineEdit_strokeColor">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton_strokeColor">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>32</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="MaximumSize" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>32</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBox_shadow">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Shadow</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_shadX">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Shadow Offset</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="spinBox_shadX">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>-1000</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>1000</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>-4</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="spinBox_shadY">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>-1000</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>1000</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>8</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_shadBlur">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Shadow Blur</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="spinBox_shadBlur">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>99.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>5.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Minimum</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
@ -21,8 +21,11 @@ class FramePainter(QtGui.QPainter):
|
||||||
self.image = QtGui.QImage(ImageQt(image))
|
self.image = QtGui.QImage(ImageQt(image))
|
||||||
super().__init__(self.image)
|
super().__init__(self.image)
|
||||||
|
|
||||||
def setPen(self, RgbTuple):
|
def setPen(self, penStyle):
|
||||||
super().setPen(PaintColor(*RgbTuple))
|
if type(penStyle) is tuple:
|
||||||
|
super().setPen(PaintColor(*penStyle))
|
||||||
|
else:
|
||||||
|
super().setPen(penStyle)
|
||||||
|
|
||||||
def finalize(self):
|
def finalize(self):
|
||||||
self.end()
|
self.end()
|
||||||
|
|
Reference in New Issue