Skip to content

Commit d8c49b2

Browse files
Added the photo card to the gallery editor
1 parent 75e4e7a commit d8c49b2

2 files changed

Lines changed: 17 additions & 7 deletions

File tree

app/qml/components/MMPhotoCard.qml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ Item {
1818
property bool textVisible: true
1919

2020
readonly property int cornerRadius: __style.margin20
21-
readonly property int blurAmount: __style.margin30
21+
readonly property int blurAmount: 40
22+
23+
signal clicked( var path )
2224

2325
width: 300
2426
height: 300
@@ -42,6 +44,8 @@ Item {
4244
id: bngImage
4345
anchors.fill: parent
4446
fillMode: Image.PreserveAspectCrop
47+
autoTransform: true
48+
focus: true
4549
smooth: true
4650
visible: true
4751
}
@@ -103,5 +107,8 @@ Item {
103107
}
104108
}
105109

106-
// add mouse area to go to the nex
110+
MMSingleClickMouseArea {
111+
anchors.fill: parent
112+
onSingleClicked: root.clicked(root.imageSource)
113+
}
107114
}

app/qml/form/editors/MMFormGalleryEditor.qml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,23 @@ MMPrivateComponents.MMBaseInput {
4848
homePath: root._fieldActiveProject.homePath
4949
}
5050

51-
delegate: MMComponents.MMPhoto {
51+
delegate: MMComponents.MMPhotoCard{
5252
width: rowView.height
53+
height: rowView.height
5354

54-
fillMode: Image.PreserveAspectCrop
55-
56-
photoUrl: {
55+
imageSource: {
5756
let absolutePath = model.PhotoPath
5857

5958
if ( absolutePath !== '' && __inputUtils.fileExists( absolutePath ) ) {
60-
return "file://" + absolutePath
59+
return "file:///" + absolutePath
6160
}
6261
return ''
6362
}
6463

64+
textVisible: model.FeatureTitle ? true : false
65+
66+
text: model.FeatureTitle
67+
6568
onClicked: function( path ) {
6669
root.openLinkedFeature( model.FeaturePair )
6770
}

0 commit comments

Comments
 (0)