Commit 10657710 authored by Nate Graham's avatar Nate Graham 🔩

Overhaul left drawer's UI

Summary:
This drawer needed less work than the right drawer but could still use some
improvements, which include:
- Improve the spacing of the effects grid items
- Increase each item's size so you can actually see what it does
- Add a border around each effect for aesthetics
- Improve header margins

Test Plan:
Before: {F6540141}

After: {F6540144}

Reviewers: apol, #vdg

Reviewed By: apol

Differential Revision: https://phabricator.kde.org/D18190
parent 6704bdd9
......@@ -7,10 +7,10 @@ import org.kde.kirigami 2.0 as Kirigami
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 @@ GridView {
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
}
}
}
}
......@@ -149,21 +149,25 @@ Kirigami.ApplicationWindow
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")
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment