Enable qmlvideofx window to be resized, when large screen layout used
Change-Id: I3010b9fd5f68e922ff94edd4d08d8114c689c037 Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
c1ec175b24
commit
5c0629b571
@@ -129,6 +129,11 @@ int main(int argc, char *argv[])
|
|||||||
videoPath = moviesLocation.first();
|
videoPath = moviesLocation.first();
|
||||||
viewer.rootContext()->setContextProperty("videoPath", videoPath);
|
viewer.rootContext()->setContextProperty("videoPath", videoPath);
|
||||||
|
|
||||||
|
viewer.setWindowTitle("qmlvideofx");
|
||||||
|
viewer.setWindowFlags(Qt::Window | Qt::WindowSystemMenuHint | Qt::WindowTitleHint |
|
||||||
|
Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
|
||||||
|
viewer.setMinimumSize(QSize(600, 400));
|
||||||
|
|
||||||
#ifdef SMALL_SCREEN_PHYSICAL
|
#ifdef SMALL_SCREEN_PHYSICAL
|
||||||
viewer.showFullScreen();
|
viewer.showFullScreen();
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -82,6 +82,16 @@ Rectangle {
|
|||||||
ignoreUnknownSignals: true
|
ignoreUnknownSignals: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onWidthChanged: {
|
||||||
|
if (effectLoader.item)
|
||||||
|
effectLoader.item.targetWidth = root.width
|
||||||
|
}
|
||||||
|
|
||||||
|
onHeightChanged: {
|
||||||
|
if (effectLoader.item)
|
||||||
|
effectLoader.item.targetHeight = root.height
|
||||||
|
}
|
||||||
|
|
||||||
onEffectSourceChanged: {
|
onEffectSourceChanged: {
|
||||||
console.log("[qmlvideofx] Content.onEffectSourceChanged " + effectSource)
|
console.log("[qmlvideofx] Content.onEffectSourceChanged " + effectSource)
|
||||||
effectLoader.source = effectSource
|
effectLoader.source = effectSource
|
||||||
|
|||||||
@@ -42,5 +42,6 @@
|
|||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
smooth: true
|
smooth: true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,12 +58,31 @@ Effect {
|
|||||||
property real posX: -1
|
property real posX: -1
|
||||||
property real posY: -1
|
property real posY: -1
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
property real oldTargetWidth: root.targetWidth
|
||||||
|
property real oldTargetHeight: root.targetHeight
|
||||||
|
}
|
||||||
|
|
||||||
// Transform slider values, and bind result to shader uniforms
|
// Transform slider values, and bind result to shader uniforms
|
||||||
property real radius: parameters.get(0).value * 100
|
property real radius: parameters.get(0).value * 100
|
||||||
property real diffractionIndex: parameters.get(1).value
|
property real diffractionIndex: parameters.get(1).value
|
||||||
|
|
||||||
onTargetWidthChanged: if (posX == -1) posX = targetWidth / 2
|
onTargetWidthChanged: {
|
||||||
onTargetHeightChanged: if (posY == -1) posY = targetHeight / 2
|
if (posX == -1)
|
||||||
|
posX = targetWidth / 2
|
||||||
|
else if (d.oldTargetWidth != 0)
|
||||||
|
posX *= (targetWidth / d.oldTargetWidth)
|
||||||
|
d.oldTargetWidth = targetWidth
|
||||||
|
}
|
||||||
|
|
||||||
|
onTargetHeightChanged: {
|
||||||
|
if (posY == -1)
|
||||||
|
posY = targetHeight / 2
|
||||||
|
else if (d.oldTargetHeight != 0)
|
||||||
|
posY *= (targetHeight / d.oldTargetHeight)
|
||||||
|
d.oldTargetHeight = targetHeight
|
||||||
|
}
|
||||||
|
|
||||||
fragmentShaderFilename: "shaders/magnify.fsh"
|
fragmentShaderFilename: "shaders/magnify.fsh"
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,9 @@ Rectangle {
|
|||||||
id: content
|
id: content
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
|
bottom: parent.bottom
|
||||||
left: parent.left
|
left: parent.left
|
||||||
|
right: effectSelectionPanel.left
|
||||||
margins: 5
|
margins: 5
|
||||||
}
|
}
|
||||||
width: 600
|
width: 600
|
||||||
@@ -99,11 +101,11 @@ Rectangle {
|
|||||||
id: effectSelectionPanel
|
id: effectSelectionPanel
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
left: content.right
|
bottom: fileOpen.top
|
||||||
right: parent.right
|
right: parent.right
|
||||||
margins: 5
|
margins: 5
|
||||||
}
|
}
|
||||||
height: 420
|
width: 300
|
||||||
itemHeight: 40
|
itemHeight: 40
|
||||||
onEffectSourceChanged: {
|
onEffectSourceChanged: {
|
||||||
content.effectSource = effectSource
|
content.effectSource = effectSource
|
||||||
@@ -114,12 +116,12 @@ Rectangle {
|
|||||||
FileOpen {
|
FileOpen {
|
||||||
id: fileOpen
|
id: fileOpen
|
||||||
anchors {
|
anchors {
|
||||||
top: effectSelectionPanel.bottom
|
|
||||||
left: content.right
|
|
||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
margins: 5
|
margins: 5
|
||||||
}
|
}
|
||||||
|
width: effectSelectionPanel.width
|
||||||
|
height: 165
|
||||||
buttonHeight: 32
|
buttonHeight: 32
|
||||||
topMargin: 10
|
topMargin: 10
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user