aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/color.py3
-rw-r--r--src/components/image.py3
-rw-r--r--src/components/original.py2
-rw-r--r--src/components/spectrum.py3
-rw-r--r--src/components/text.py19
-rw-r--r--src/components/video.py3
-rw-r--r--src/components/waveform.py3
7 files changed, 28 insertions, 8 deletions
diff --git a/src/components/color.py b/src/components/color.py
index d6fffc6..703caca 100644
--- a/src/components/color.py
+++ b/src/components/color.py
@@ -60,6 +60,9 @@ class Component(Component):
}, colorWidgets={
'color1': self.page.pushButton_color1,
'color2': self.page.pushButton_color2,
+ }, relativeWidgets={
+ 'x': 'x',
+ 'y': 'y',
},
)
diff --git a/src/components/image.py b/src/components/image.py
index a96f127..2ffa5a1 100644
--- a/src/components/image.py
+++ b/src/components/image.py
@@ -28,6 +28,9 @@ class Component(Component):
'imagePath': 'image',
'xPosition': 'x',
'yPosition': 'y',
+ }, relativeWidgets={
+ 'xPosition': 'x',
+ 'yPosition': 'y',
},
)
diff --git a/src/components/original.py b/src/components/original.py
index 950ac7b..67e3239 100644
--- a/src/components/original.py
+++ b/src/components/original.py
@@ -40,6 +40,8 @@ class Component(Component):
'y': self.page.spinBox_y,
}, colorWidgets={
'visColor': self.page.pushButton_visColor,
+ }, relativeWidgets={
+ 'y': 'y',
})
def previewRender(self):
diff --git a/src/components/spectrum.py b/src/components/spectrum.py
index 8ab8404..2cc641d 100644
--- a/src/components/spectrum.py
+++ b/src/components/spectrum.py
@@ -49,6 +49,9 @@ class Component(Component):
'compress': self.page.checkBox_compress,
'mono': self.page.checkBox_mono,
'hue': self.page.spinBox_hue,
+ }, relativeWidgets={
+ 'x': 'x',
+ 'y': 'y',
}
)
for widget in self._trackedWidgets.values():
diff --git a/src/components/text.py b/src/components/text.py
index 1fe3467..0f87038 100644
--- a/src/components/text.py
+++ b/src/components/text.py
@@ -17,15 +17,12 @@ class Component(Component):
def widget(self, *args):
super().widget(*args)
- height = int(self.settings.value('outputHeight'))
- width = int(self.settings.value('outputWidth'))
+ # height = int(self.settings.value('outputHeight'))
+ # width = int(self.settings.value('outputWidth'))
self.textColor = (255, 255, 255)
self.title = 'Text'
self.alignment = 1
- self.fontSize = height / 13.5
- fm = QtGui.QFontMetrics(self.titleFont)
- self.xPosition = width / 2 - fm.width(self.title)/2
- self.yPosition = height / 2 * 1.036
+ self.fontSize = self.height / 13.5
self.page.comboBox_textAlign.addItem("Left")
self.page.comboBox_textAlign.addItem("Middle")
@@ -35,8 +32,11 @@ class Component(Component):
self.page.lineEdit_title.setText(self.title)
self.page.comboBox_textAlign.setCurrentIndex(int(self.alignment))
self.page.spinBox_fontSize.setValue(int(self.fontSize))
- self.page.spinBox_xTextAlign.setValue(int(self.xPosition))
- self.page.spinBox_yTextAlign.setValue(int(self.yPosition))
+
+ fm = QtGui.QFontMetrics(self.titleFont)
+ self.page.spinBox_xTextAlign.setValue(
+ self.width / 2 - fm.width(self.title)/2)
+ self.page.spinBox_yTextAlign.setValue(self.height / 2 * 1.036)
self.page.fontComboBox_titleFont.currentFontChanged.connect(
self.update
@@ -50,6 +50,9 @@ class Component(Component):
'yPosition': self.page.spinBox_yTextAlign,
}, colorWidgets={
'textColor': self.page.pushButton_textColor,
+ }, relativeWidgets={
+ 'xPosition': 'x',
+ 'yPosition': 'y',
})
def update(self):
diff --git a/src/components/video.py b/src/components/video.py
index 6cd16e5..3569d17 100644
--- a/src/components/video.py
+++ b/src/components/video.py
@@ -38,6 +38,9 @@ class Component(Component):
'loopVideo': 'loop',
'xPosition': 'x',
'yPosition': 'y',
+ }, relativeWidgets={
+ 'xPosition': 'x',
+ 'yPosition': 'y',
}
)
diff --git a/src/components/waveform.py b/src/components/waveform.py
index 9c3cf86..a25116b 100644
--- a/src/components/waveform.py
+++ b/src/components/waveform.py
@@ -41,6 +41,9 @@ class Component(Component):
'mono': self.page.checkBox_mono,
}, colorWidgets={
'color': self.page.pushButton_color,
+ }, relativeWidgets={
+ 'x': 'x',
+ 'y': 'y',
}
)