@@ -39,13 +39,11 @@ Item {
39
39
// Ment to be use with the save callback - stores image source
40
40
property string sourceToDelete
41
41
42
- Component .onCompleted : {
43
- callbackOnSave = function () {
44
- externalResourceHandler .onFormSave (fieldItem)
45
- }
46
- callbackOnCancel = function () {
47
- externalResourceHandler .onFormCanceled (fieldItem)
48
- }
42
+ function callbackOnSave () {
43
+ externalResourceHandler .onFormSave (fieldItem)
44
+ }
45
+ function callbackOnCancel () {
46
+ externalResourceHandler .onFormCanceled (fieldItem)
49
47
}
50
48
51
49
id: fieldItem
@@ -129,13 +127,14 @@ Item {
129
127
130
128
Button {
131
129
id: deleteButton
132
- visible: ! readOnly && fieldItem .state === " valid "
133
- width: fieldItem . iconSize
130
+ visible: ! readOnly && fieldItem .state !== " notSet "
131
+ width: buttonsContainer . itemHeight
134
132
height: width
135
133
padding: 0
136
134
137
135
anchors .right : imageContainer .right
138
136
anchors .bottom : imageContainer .bottom
137
+ anchors .margins : buttonsContainer .itemHeight / 4
139
138
140
139
onClicked: externalResourceHandler .removeImage (fieldItem, homePath + " /" + image .currentValue )
141
140
@@ -163,7 +162,7 @@ Item {
163
162
anchors .centerIn : imageContainer
164
163
anchors .fill : imageContainer
165
164
anchors .margins : fieldItem .textMargin
166
- visible: fieldItem .state !== " valid "
165
+ visible: fieldItem .state === " notSet "
167
166
168
167
anchors .horizontalCenter : parent .horizontalCenter
169
168
anchors .verticalCenter : parent .verticalCenter
@@ -216,18 +215,20 @@ Item {
216
215
}
217
216
}
218
217
219
- QgsQuick .IconTextItem {
220
- id: infoItem
221
- iconSize: fieldItem .iconSize / 2
222
- fontColor: customStyle .fields .fontColor
223
- iconSource: fieldItem .brokenImageIcon
224
- labelText: qsTr (" Image is not available: " ) + image .currentValue
225
-
218
+ Text {
219
+ id: text
220
+ height: parent .height
221
+ width: imageContainer .width - 2 * fieldItem .textMargin
222
+ wrapMode: Text .WordWrap
223
+ minimumPixelSize: 50 * QgsQuick .Utils .dp
224
+ text: qsTr (" Image is not available: " ) + image .currentValue
225
+ font .pixelSize : buttonsContainer .itemHeight * 0.75
226
+ color: customStyle .fields .fontColor
227
+ anchors .leftMargin : buttonsContainer .itemHeight + fieldItem .textMargin
228
+ horizontalAlignment: Text .AlignHCenter
229
+ verticalAlignment: Text .AlignVCenter
230
+ elide: Text .ElideRight
226
231
visible: fieldItem .state === " notAvailable"
227
- height: fieldItem .iconSize / 2
228
- anchors .bottom : parent .bottom
229
- anchors .bottomMargin : fieldItem .textMargin
230
- anchors .horizontalCenter : parent .horizontalCenter
231
232
}
232
233
233
234
}
0 commit comments