diff --git a/src/qml/Config.qml b/src/qml/Config.qml --- a/src/qml/Config.qml +++ b/src/qml/Config.qml @@ -7,10 +7,10 @@ GridView { id: view - readonly property real delegateWidth: Kirigami.Units.gridUnit*4 - readonly property int columnCount: Math.floor(width/delegateWidth) - cellWidth: width/columnCount - cellHeight: cellWidth + readonly property int columnCount: 3 + cellWidth: Math.floor(width / columnCount) + cellHeight: cellWidth * 3/4 + model: ListModel { ListElement { filters: "identity" } @@ -50,30 +50,41 @@ ListElement { filters: "coloreffects preset=xray" } } - delegate: MouseArea { + delegate: Rectangle { + readonly property int borderWidth: 2 id: delegateItem - width: GridView.view.cellHeight - height: GridView.view.cellWidth - VideoItem { - anchors.fill: parent + width: Math.floor(view.width / columnCount) - Kirigami.Units.smallSpacing + height: width * 3/4 - PipelineItem { - id: pipe + color: Kirigami.Theme.textColor - playing: false - onFailed: { - delegateItem.visible = false - view.model.remove(index) - } + MouseArea { + anchors.centerIn: parent + + width: delegateItem.width - (borderWidth * 2) + height: delegateItem.height - (borderWidth * 2) + + VideoItem { + anchors.fill: parent + + PipelineItem { + id: pipe - description: "filesrc location=\"" + webcam.sampleImage + "\" ! decodebin ! imagefreeze ! videoconvert ! " + model.filters + " name=last" + playing: false + onFailed: { + delegateItem.visible = false + view.model.remove(index) + } + + description: "filesrc location=\"" + webcam.sampleImage + "\" ! decodebin ! imagefreeze ! videoconvert ! " + model.filters + " name=last" + } + surface: pipe.surface } - surface: pipe.surface - } - onClicked: { - devicesModel.playingDevice.filters = model.filters + onClicked: { + devicesModel.playingDevice.filters = model.filters + } } } } diff --git a/src/qml/Main.qml b/src/qml/Main.qml --- a/src/qml/Main.qml +++ b/src/qml/Main.qml @@ -149,21 +149,25 @@ modal: true width: Kirigami.Units.gridUnit * 20 - leftPadding: 0 - topPadding: 0 - rightPadding: 0 - bottomPadding: 0 + leftPadding: Kirigami.Units.smallSpacing + topPadding: Kirigami.Units.smallSpacing + rightPadding: Kirigami.Units.smallSpacing + bottomPadding: Kirigami.Units.smallSpacing contentItem: Config { id: configView QQC2.ScrollBar.vertical: QQC2.ScrollBar {} - header: Kirigami.Heading { - level: 1 - color: Kirigami.Theme.textColor - elide: Text.ElideRight - text: i18n("Effects Gallery") + header: QQC2.Control { + height: effectsGalleryHeading.height + Kirigami.Units.largeSpacing + Kirigami.Heading { + id: effectsGalleryHeading + level: 1 + color: Kirigami.Theme.textColor + elide: Text.ElideRight + text: i18n("Effects Gallery") + } } } }