<commit_before>/**
 * Copyright (c) 2015 <NAME>
 *
 * This file is subject to the terms and conditions defined in
 * file 'LICENSE', which is part of this source code package.
 **/

import QtQuick 2.0
import Sailfish.Silica 1.0

BackgroundItem {
    width: gridView.cellWidth
    height: gridView.cellHeight

    Image {
        anchors.fill: parent
        source: Qt.resolvedUrl("../../images/comics/"+id+".jpg")
    }

    Rectangle {
        property bool active: favorite

        anchors.fill: parent
        color: Theme.highlightBackgroundColor
        opacity: active ? 0.7 : 0.0

        Behavior on opacity {
            FadeAnimation {
                duration: 100
            }
        }
    }

    onClicked: comicsModel.setFavorite(index, !favorite)
}<commit_msg>reinforce distinction of favorites selected with icon<commit_after>/**
 * Copyright (c) 2015 <NAME>
 *
 * This file is subject to the terms and conditions defined in
 * file 'LICENSE', which is part of this source code package.
 **/

import QtQuick 2.0
import Sailfish.Silica 1.0

BackgroundItem {
    width: gridView.cellWidth
    height: gridView.cellHeight

    Image {
        anchors.fill: parent
        source: Qt.resolvedUrl("../../images/comics/"+id+".jpg")
    }

    Rectangle {
        property bool active: favorite

        anchors.fill: parent
        color: Theme.highlightBackgroundColor
        opacity: active ? 0.7 : 0.0

        Image {
            source: "image://theme/icon-l-favorite"
            height: Theme.iconSizeSmall
            width: Theme.iconSizeSmall
            anchors {
                left: parent.left
                top: parent.top
                leftMargin: Theme.paddingSmall
                topMargin: Theme.paddingSmall
            }
            fillMode: Image.PreserveAspectFit
        }

        Behavior on opacity {
            FadeAnimation {
                duration: 100
            }
        }
    }

    onClicked: comicsModel.setFavorite(index, !favorite)
}
{'fraction_non_alphanumeric': 0.08963445167751627, 'fraction_numerical': 0.015022533800701052, 'mean_word_length': 1.8956521739130434, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1877527', 'n_tokens_mistral': 584, 'n_tokens_neox': 539, 'n_words': 152}