// Dummy comment to consume the first argument and suppress warnings %1

Section {
    anchors.left: parent.left
    anchors.right: parent.right
    caption: qsTr("Image")
    expanded: false
    level: 2

    SectionLayout {
        Label {
            text: qsTr("Source")
        }

        SecondColumnLayout {
            UrlChooser {
                Layout.fillWidth: true
                backendValue: backendValues.%2_source
            }

            ExpandingSpacer {
            }
        }

        Label {
            text: qsTr("Fill mode")
        }

        SecondColumnLayout {
            ComboBox {
                scope: "Image"
                model: ["Stretch", "PreserveAspectFit", "PreserveAspectCrop", "Tile", "TileVertically", "TileHorizontally", "Pad"]
                backendValue: backendValues.%2_fillMode
                implicitWidth: 180
                Layout.fillWidth: true
            }

            ExpandingSpacer {
            }
        }

        Label {
            text: qsTr("Source size")
            disabledState: !backendValues.%2_sourceSize.isAvailable
        }

        SecondColumnLayout {
            Label {
                text: "W"
                width: 12
                disabledStateSoft: !backendValues.%2_sourceSize_width.isAvailable
            }

            SpinBox {
                backendValue: backendValues.%2_sourceSize_width
                minimumValue: 0
                maximumValue: 8192
                decimals: 0
                enabled: backendValue.isAvailable
            }

            Item {
                width: 4
                height: 4
            }

            Label {
                text: "H"
                width: 12
                disabledStateSoft: !backendValues.%2_sourceSize_height.isAvailable
            }

            SpinBox {
                backendValue: backendValues.%2_sourceSize_height
                minimumValue: 0
                maximumValue: 8192
                decimals: 0
                enabled: backendValue.isAvailable
            }

            ExpandingSpacer {
            }
        }

        Label {
            text: qsTr("Horizontal alignment")
        }

        SecondColumnLayout {
            ComboBox {
                scope: "Image"
                model: ["AlignLeft", "AlignRight", "AlignHCenter"]
                backendValue: backendValues.%2_horizontalAlignment
                implicitWidth: 180
                Layout.fillWidth: true
            }

            ExpandingSpacer {
            }
        }

        Label {
            text: qsTr("Vertical alignment")
        }

        SecondColumnLayout {
            ComboBox {
                scope: "Image"
                model: ["AlignTop", "AlignBottom", "AlignVCenter"]
                backendValue: backendValues.%2_verticalAlignment
                implicitWidth: 180
                Layout.fillWidth: true
            }

            ExpandingSpacer {
            }
        }

        Label {
            text: qsTr("Asynchronous")
            tooltip: qsTr("Loads images on the local filesystem asynchronously in a separate thread.")
            disabledState: !backendValues.%2_asynchronous.isAvailable
        }

        SecondColumnLayout {
            CheckBox {
                enabled: backendValues.%2_asynchronous.isAvailable
                text: backendValues.%2_asynchronous.valueToString
                backendValue: backendValues.%2_asynchronous
                implicitWidth: 180
            }
            ExpandingSpacer {}
        }

        Label {
            text: qsTr("Auto transform")
            tooltip: qsTr("Automatically applies image transformation metadata such as EXIF orientation.")
            disabledState: !backendValues.%2_autoTransform.isAvailable
        }

        SecondColumnLayout {
            CheckBox {
                enabled: backendValues.%2_autoTransform.isAvailable
                text: backendValues.%2_autoTransform.valueToString
                backendValue: backendValues.%2_autoTransform
                implicitWidth: 180
            }
            ExpandingSpacer {}
        }

        Label {
            text: qsTr("Cache")
            tooltip: qsTr("Caches the image.")
            disabledState: !backendValues.%2_cache.isAvailable
        }

        SecondColumnLayout {
            CheckBox {
                enabled: backendValues.%2_cache.isAvailable
                text: backendValues.%2_cache.valueToString
                backendValue: backendValues.%2_cache
                implicitWidth: 180
            }
            ExpandingSpacer {}
        }

        Label {
            text: qsTr("Mipmap")
            tooltip: qsTr("Uses mipmap filtering when the image is scaled or transformed.")
            disabledState: !backendValues.%2_mipmap.isAvailable
        }

        SecondColumnLayout {
            CheckBox {
                enabled: backendValues.%2_mipmap.isAvailable
                text: backendValues.%2_mipmap.valueToString
                backendValue: backendValues.%2_mipmap
                implicitWidth: 180
            }
            ExpandingSpacer {}
        }

        Label {
            text: qsTr("Mirror")
            tooltip: qsTr("Inverts the image horizontally.")
            disabledState: !backendValues.%2_mirror.isAvailable
        }

        SecondColumnLayout {
            CheckBox {
                enabled: backendValues.%2_mirror.isAvailable
                text: backendValues.%2_mirror.valueToString
                backendValue: backendValues.%2_mirror
                implicitWidth: 180
            }
            ExpandingSpacer {}
        }

        Label {
            text: qsTr("Smooth")
            tooltip: qsTr("Smoothly filters the image when it is scaled or transformed.")
            disabledState: !backendValues.%2_smooth.isAvailable
        }

        SecondColumnLayout {
            CheckBox {
                enabled: backendValues.%2_smooth.isAvailable
                text: backendValues.%2_smooth.valueToString
                backendValue: backendValues.%2_smooth
                implicitWidth: 180
            }
            ExpandingSpacer {}
        }
    }
}
