Cache sticker picker
This commit is contained in:
parent
3b56ff2d85
commit
11c9666408
@ -331,7 +331,7 @@ Rectangle {
|
|||||||
image: ":/icons/icons/ui/sticky-note-solid.svg"
|
image: ":/icons/icons/ui/sticky-note-solid.svg"
|
||||||
ToolTip.visible: hovered
|
ToolTip.visible: hovered
|
||||||
ToolTip.text: qsTr("Stickers")
|
ToolTip.text: qsTr("Stickers")
|
||||||
onClicked: stickerPopup.visible ? stickerPopup.close() : stickerPopup.show(stickerButton, TimelineManager.completerFor("stickers", room.roomId()), function(row) {
|
onClicked: stickerPopup.visible ? stickerPopup.close() : stickerPopup.show(stickerButton, room.roomId(), function(row) {
|
||||||
room.input.sticker(stickerPopup.model.sourceModel, row);
|
room.input.sticker(stickerPopup.model.sourceModel, row);
|
||||||
TimelineManager.focusMessageInput();
|
TimelineManager.focusMessageInput();
|
||||||
})
|
})
|
||||||
|
@ -15,7 +15,7 @@ Menu {
|
|||||||
|
|
||||||
property var callback
|
property var callback
|
||||||
property var colors
|
property var colors
|
||||||
property alias model: gridView.model
|
property string roomid
|
||||||
property var textArea
|
property var textArea
|
||||||
property real highlightHue: Nheko.colors.highlight.hslHue
|
property real highlightHue: Nheko.colors.highlight.hslHue
|
||||||
property real highlightSat: Nheko.colors.highlight.hslSaturation
|
property real highlightSat: Nheko.colors.highlight.hslSaturation
|
||||||
@ -24,9 +24,9 @@ Menu {
|
|||||||
readonly property int stickerDimPad: 128 + Nheko.paddingSmall
|
readonly property int stickerDimPad: 128 + Nheko.paddingSmall
|
||||||
readonly property int stickersPerRow: 3
|
readonly property int stickersPerRow: 3
|
||||||
|
|
||||||
function show(showAt, model_, callback) {
|
function show(showAt, roomid_, callback) {
|
||||||
console.debug("Showing sticker picker");
|
console.debug("Showing sticker picker");
|
||||||
model = model_;
|
roomid = roomid_;
|
||||||
stickerPopup.callback = callback;
|
stickerPopup.callback = callback;
|
||||||
popup(showAt ? showAt : null);
|
popup(showAt ? showAt : null);
|
||||||
}
|
}
|
||||||
@ -120,6 +120,8 @@ Menu {
|
|||||||
GridView {
|
GridView {
|
||||||
id: gridView
|
id: gridView
|
||||||
|
|
||||||
|
model: roomid ? TimelineManager.completerFor("stickers", roomid) : null
|
||||||
|
|
||||||
Layout.preferredHeight: cellHeight * 3.5
|
Layout.preferredHeight: cellHeight * 3.5
|
||||||
Layout.preferredWidth: stickersPerRow * stickerDimPad + 20
|
Layout.preferredWidth: stickersPerRow * stickerDimPad + 20
|
||||||
Layout.leftMargin: 4
|
Layout.leftMargin: 4
|
||||||
|
Loading…
Reference in New Issue
Block a user