mirror of
https://gitlab.com/eql/lqml.git
synced 2026-01-03 07:42:27 -08:00
42 lines
963 B
QML
42 lines
963 B
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Controls.Basic
|
|
|
|
ScrollView {
|
|
width: parent.width
|
|
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
|
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
|
|
|
property alias model: grid.model
|
|
|
|
GridView {
|
|
id: grid
|
|
anchors.fill: parent
|
|
cellWidth: emojis.itemSize
|
|
cellHeight: emojis.itemSize
|
|
leftMargin: 2
|
|
topMargin: 2
|
|
clip: true
|
|
highlightFollowsCurrentItem: false
|
|
focus: true
|
|
|
|
delegate: Text {
|
|
width: emojis.itemSize
|
|
height: emojis.itemSize
|
|
horizontalAlignment: Text.AlignHCenter
|
|
verticalAlignment: Text.AlignVCenter
|
|
font.pixelSize: emojis.itemSize - 4
|
|
text: modelData
|
|
}
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onClicked: (mouse) => {
|
|
Lisp.call("app:emoji-clicked",
|
|
grid.itemAtIndex(grid.indexAt(mouse.x, mouse.y + grid.contentY)).text)
|
|
}
|
|
}
|
|
}
|
|
}
|