-
Notifications
You must be signed in to change notification settings - Fork 3
/
EmojiView.qml
51 lines (42 loc) · 1.1 KB
/
EmojiView.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright 2016 Cutehacks AS. All rights reserved.
// License can be found in the LICENSE file.
import QtQuick 2.0
import com.cutehacks.emooj 1.0
Rectangle {
property int cellWidth: 32
property int columnCount: 10
property int rowCount: 10
width: cellWidth * columnCount + grid.anchors.margins * 2
height: cellWidth * rowCount + grid.anchors.margins * 2
radius: 5
border.color: "black"
GridView {
id: grid
anchors.fill: parent
clip: true
cellWidth: 32
cellHeight: 32
anchors.margins: 10
model: EmojiDataModel {
id: emojiModel
}
delegate: Rectangle {
width: 32
height: 32
// Text {
// anchors.fill: parent
// text: unicode
// }
Image {
anchors.fill: parent
source: decoration
}
MouseArea {
anchors.fill: parent
onClicked: {
emojiModel.emitIMEvent(index);
}
}
}
}
}