~baltix/gcompris-qt/0.97.1

« back to all changes in this revision

Viewing changes to src/activities/guesscount/DropTile.qml

  • Committer: Mantas Kriaučiūnas
  • Date: 2020-07-06 18:07:11 UTC
  • Revision ID: baltix@gmail.com-20200706180711-g254osu02cn8bc8p
GCompris-QT 0.97.1 with Lithuanian translation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GCompris - DropTile.qml
 
2
 *
 
3
 * Copyright (C) 2016 RAHUL YADAV <rahulyadav170923@gmail.com>
 
4
 *
 
5
 * Authors:
 
6
 *   Pascal Georges <pascal.georges1@free.fr> (GTK+ version)
 
7
 *   RAHUL YADAV <rahulyadav170923@gmail.com> (Qt Quick port)
 
8
 *
 
9
 *   This program is free software; you can redistribute it and/or modify
 
10
 *   it under the terms of the GNU General Public License as published by
 
11
 *   the Free Software Foundation; either version 3 of the License, or
 
12
 *   (at your option) any later version.
 
13
 *
 
14
 *   This program is distributed in the hope that it will be useful,
 
15
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 *   GNU General Public License for more details.
 
18
 *
 
19
 *   You should have received a copy of the GNU General Public License
 
20
 *   along with this program; if not, see <https://www.gnu.org/licenses/>.
 
21
 */
 
22
import QtQuick 2.6
 
23
 
 
24
import "../../core"
 
25
import "guesscount.js" as Activity
 
26
 
 
27
DropArea {
 
28
    id: dragTarget
 
29
    property string type
 
30
    property var droppedItem
 
31
    keys: [ type ]
 
32
    Rectangle {
 
33
        id: dropRectangle
 
34
        width: parent.width
 
35
        height: parent.height
 
36
        anchors.fill: parent
 
37
        color: type == "operators" ? "#80F16F6F" : "#8075D21B" // red or green
 
38
        border.width: 5
 
39
        border.color: type == "operators" ? "#FFF16F6F" : "#FF75D21B" // red or green
 
40
        radius: 10
 
41
        states: [
 
42
            State {
 
43
                when: dragTarget.containsDrag
 
44
                PropertyChanges {
 
45
                    target: dropRectangle
 
46
                    color: "transparent"
 
47
                    border.color: "#80FFFFFF"
 
48
                }
 
49
            }
 
50
        ]
 
51
    }
 
52
}