<commit_before>import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Window 2.2
import QtQuick.Controls 2.1
import QtQuick.Controls.Material 2.1

import "../fam"

Component {
    id: movieResponseDelegateId
    Item {
        id: movieResponseItemId

        property int gridColumnCount: isPortraitMode ? 2 : 4
        property int flickableItemWidth: isPortraitMode ? windowWidth * .65 : windowWidth * .75
        property int plotItemHeight: isPortraitMode ? windowHeight * .35 : windowHeight * .2
        property int actorsItemHeight: isPortraitMode ? plotItemHeight * .3 : plotItemHeight * .5
        property int firstColumnWidth: isPortraitMode ? windowWidth
                                                        / (gridColumnCount + 2) : windowWidth
                                                        / (gridColumnCount + 2)
        property int imageDimension: firstColumnWidth - spacingIndent
        property int imageExpandedDimension: isPortraitMode ? windowWidth - spacingIndent : windowHeight - (4 * spacingIndent)
        readonly property int imageTransitionInteralMS: 500
        readonly property string expandPosterImage: "expandPosterImage"
        property string expandPosterImageState: ""

        Grid {
            id: gridTopId
            anchors.top: movieResponseItemId.top
            anchors.topMargin: textMargin
            anchors.left: movieResponseItemId.left
            anchors.leftMargin: textMargin
            columns: gridColumnCount
            rowSpacing: textMargin
            columnSpacing: textMargin
            verticalItemAlignment: Grid.AlignBottom
            visible: model.runtime !== ""
            opacity: 1

            GridTitleLabel {
                text: qsTr("Title")
            }
            GridItemLabel {
                text: model.title
                font.bold: true
            }
            GridTitleLabel {
                text: qsTr("Website")
            }
            Text {
                text: model.website
                font.pointSize: fontSizeMedium
                onLinkActivated: Qt.openUrlExternally(model.websiteUrl)
                color: Material.primary
            }
            GridTitleLabel {
                text: qsTr("Year")
            }
            GridItemLabel {
                text: model.year
            }
            GridTitleLabel {
                text: qsTr("Released")
            }
            GridItemLabel {
                text: model.released
            }
            GridTitleLabel {
                text: qsTr("Popularity")
            }
            GridItemLabel {
                text: model.popularity
            }
            GridTitleLabel {
                text: qsTr("Rated")
            }
            GridItemLabel {
                text: model.rating
            }
            GridTitleLabel {
                text: qsTr("Languages")
            }
            GridItemLabel {
                text: model.languages
            }
            GridTitleLabel {
                text: qsTr("Runtime")
            }
            Text {
                id: runtimeId
                rightPadding: columnItemIndent
                text: model.runtime
                color: Material.primary
                font.pointSize: fontSizeMedium
            }
        }
        Grid {
            id: gridBottomId
            anchors.top: gridTopId.bottom
            anchors.topMargin: textMargin
            anchors.left: movieResponseItemId.left
            anchors.leftMargin: textMargin
            columns: 2
            columnSpacing: textMargin
            rowSpacing: gridTopId.rowSpacing
            visible: gridTopId.visible

            GridTitleLabel {
                text: qsTr("Genre")
            }
            GridItemLabel {
                text: model.genre
            }
            GridTitleLabel {
                text: qsTr("Actors")
            }
            Flickable {
                contentHeight: actorsId.height
                width: actorsId.width
                height: actorsItemHeight
                clip: true
                GridItemLabel {
                    id: actorsId
                    text: model.actors
                    width: flickableItemWidth
                    wrapMode: Label.Wrap
                }
            }

            GridTitleLabel {
                text: qsTr("Plot")
            }
            Flickable {
                contentHeight: plotId.height
                width: plotId.width
                height: plotItemHeight
                clip: true
                GridItemLabel {
                    id: plotId
                    text: model.plot
                    width: flickableItemWidth
                    wrapMode: Label.Wrap
                }
            }
        }
        Row {
            anchors.top: gridBottomId.top
            Label {
                width: windowWidth
                horizontalAlignment: "AlignHCenter"
                wrapMode: Label.Wrap
                color: Material.primary
                font.pointSize: fontSizeMedium
                text: model.status
            }
        }
        Image {
            id: posterImageId
            state: expandPosterImageState
            width: imageDimension
            height: imageDimension
            fillMode: Image.PreserveAspectCrop
            source: model.poster
            anchors.bottom: parent.bottom
            anchors.bottomMargin: textMargin
            anchors.left: parent.left
            anchors.leftMargin: textMargin
            MouseArea {
                anchors.fill: parent
                onClicked: {
                    if (model.poster !== "") {
                        expandPosterImageState = (expandPosterImageState
                                                  === expandPosterImage) ? "" : expandPosterImage
                    }
                }
            }
            states: [
                State {
                    name: expandPosterImage
                    PropertyChanges {
                        target: posterImageId
                        width: imageExpandedDimension
                    }
                    PropertyChanges {
                        target: posterImageId
                        height: imageExpandedDimension
                    }
                    PropertyChanges {
                        target: gridTopId
                        opacity: 0.25
                    }
                    PropertyChanges {
                        target: gridBottomId
                        opacity: 0.25
                    }
                },

                State {
                    name: ""
                    PropertyChanges {
                        target: posterImageId
                        width: imageDimension
                    }
                    PropertyChanges {
                        target: posterImageId
                        height: imageDimension
                    }
                    PropertyChanges {
                        target: gridTopId
                        opacity: 1
                    }
                    PropertyChanges {
                        target: gridBottomId
                        opacity: 1
                    }
                }
            ]
            transitions: [
                Transition {
                    NumberAnimation {
                        target: posterImageId
                        properties: "width, height"
                        duration: imageTransitionInteralMS
                    }
                    NumberAnimation {
                        target: gridTopId
                        properties: "opacity"
                        duration: imageTransitionInteralMS
                    }
                    NumberAnimation {
                        target: gridBottomId
                        properties: "opacity"
                        duration: imageTransitionInteralMS
                    }
                }
            ]
        }
    }
}<commit_msg>added poster  image frame<commit_after>import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Window 2.2
import QtQuick.Controls 2.1
import QtQuick.Controls.Material 2.1

import "../fam"

Component {
    id: movieResponseDelegateId
    Item {
        id: movieResponseItemId

        property int gridColumnCount: isPortraitMode ? 2 : 4
        property int flickableItemWidth: isPortraitMode ? windowWidth * .65 : windowWidth * .75
        property int plotItemHeight: isPortraitMode ? windowHeight * .35 : windowHeight * .2
        property int actorsItemHeight: isPortraitMode ? plotItemHeight * .3 : plotItemHeight * .5
        property int firstColumnWidth: isPortraitMode ? windowWidth
                                                        / (gridColumnCount + 2) : windowWidth
                                                        / (gridColumnCount + 2)
        property int imageDimension: firstColumnWidth - spacingIndent
        property int imageExpandedDimension: isPortraitMode ? windowWidth - spacingIndent : windowHeight - (4 * spacingIndent)
        readonly property int imageTransitionInteralMS: 500
        readonly property string expandPosterImage: "expandPosterImage"
        property string expandPosterImageState: ""

        Grid {
            id: gridTopId
            anchors.top: movieResponseItemId.top
            anchors.topMargin: textMargin
            anchors.left: movieResponseItemId.left
            anchors.leftMargin: textMargin
            columns: gridColumnCount
            rowSpacing: textMargin
            columnSpacing: textMargin
            verticalItemAlignment: Grid.AlignBottom
            visible: model.runtime !== ""
            opacity: 1

            GridTitleLabel {
                text: qsTr("Title")
            }
            GridItemLabel {
                text: model.title
                font.bold: true
            }
            GridTitleLabel {
                text: qsTr("Website")
            }
            Text {
                text: model.website
                font.pointSize: fontSizeMedium
                onLinkActivated: Qt.openUrlExternally(model.websiteUrl)
                color: Material.primary
            }
            GridTitleLabel {
                text: qsTr("Year")
            }
            GridItemLabel {
                text: model.year
            }
            GridTitleLabel {
                text: qsTr("Released")
            }
            GridItemLabel {
                text: model.released
            }
            GridTitleLabel {
                text: qsTr("Popularity")
            }
            GridItemLabel {
                text: model.popularity
            }
            GridTitleLabel {
                text: qsTr("Rated")
            }
            GridItemLabel {
                text: model.rating
            }
            GridTitleLabel {
                text: qsTr("Languages")
            }
            GridItemLabel {
                text: model.languages
            }
            GridTitleLabel {
                text: qsTr("Runtime")
            }
            Text {
                id: runtimeId
                rightPadding: columnItemIndent
                text: model.runtime
                color: Material.primary
                font.pointSize: fontSizeMedium
            }
        }
        Grid {
            id: gridBottomId
            anchors.top: gridTopId.bottom
            anchors.topMargin: textMargin
            anchors.left: movieResponseItemId.left
            anchors.leftMargin: textMargin
            columns: 2
            columnSpacing: textMargin
            rowSpacing: gridTopId.rowSpacing
            visible: gridTopId.visible

            GridTitleLabel {
                text: qsTr("Genre")
            }
            GridItemLabel {
                text: model.genre
            }
            GridTitleLabel {
                text: qsTr("Actors")
            }
            Flickable {
                contentHeight: actorsId.height
                width: actorsId.width
                height: actorsItemHeight
                clip: true
                GridItemLabel {
                    id: actorsId
                    text: model.actors
                    width: flickableItemWidth
                    wrapMode: Label.Wrap
                }
            }

            GridTitleLabel {
                text: qsTr("Plot")
            }
            Flickable {
                contentHeight: plotId.height
                width: plotId.width
                height: plotItemHeight
                clip: true
                GridItemLabel {
                    id: plotId
                    text: model.plot
                    width: flickableItemWidth
                    wrapMode: Label.Wrap
                }
            }
        }
        Row {
            anchors.top: gridBottomId.top
            Label {
                width: windowWidth
                horizontalAlignment: "AlignHCenter"
                wrapMode: Label.Wrap
                color: Material.primary
                font.pointSize: fontSizeMedium
                text: model.status
            }
        }
        Rectangle {
            id: posterImageId
            width: imageDimension
            height: imageDimension
            color: "indigo"
            anchors.bottom: parent.bottom
            anchors.bottomMargin: textMargin
            anchors.left: parent.left
            anchors.leftMargin: textMargin
            visible: model.poster !== ""
            MouseArea {
                anchors.fill: parent
                onClicked: {
                    expandPosterImageState = (expandPosterImageState
                                              === expandPosterImage) ? "" : expandPosterImage
                }
            }
            Image {
                state: expandPosterImageState
                width: imageDimension
                height: imageDimension
                fillMode: Image.PreserveAspectCrop
                source: model.poster
                anchors.fill: parent
                anchors.margins: 4
                states: [
                    State {
                        name: expandPosterImage
                        PropertyChanges {
                            target: posterImageId
                            width: imageExpandedDimension
                        }
                        PropertyChanges {
                            target: posterImageId
                            height: imageExpandedDimension
                        }
                        PropertyChanges {
                            target: gridTopId
                            opacity: 0.25
                        }
                        PropertyChanges {
                            target: gridBottomId
                            opacity: 0.25
                        }
                    },

                    State {
                        name: ""
                        PropertyChanges {
                            target: posterImageId
                            width: imageDimension
                        }
                        PropertyChanges {
                            target: posterImageId
                            height: imageDimension
                        }
                        PropertyChanges {
                            target: gridTopId
                            opacity: 1
                        }
                        PropertyChanges {
                            target: gridBottomId
                            opacity: 1
                        }
                    }
                ]
                transitions: [
                    Transition {
                        NumberAnimation {
                            target: posterImageId
                            properties: "width, height"
                            duration: imageTransitionInteralMS
                        }
                        NumberAnimation {
                            target: gridTopId
                            properties: "opacity"
                            duration: imageTransitionInteralMS
                        }
                        NumberAnimation {
                            target: gridBottomId
                            properties: "opacity"
                            duration: imageTransitionInteralMS
                        }
                    }
                ]
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.051652015762352226, 'fraction_numerical': 0.004546832373446499, 'mean_word_length': 0.937059652418976, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3211217', 'n_tokens_mistral': 3657, 'n_tokens_neox': 3406, 'n_words': 736}