Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85830003
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/contents/ui/StickerPicker.qml b/src/contents/ui/StickerPicker.qml
index 9be4798..fa22138 100644
--- a/src/contents/ui/StickerPicker.qml
+++ b/src/contents/ui/StickerPicker.qml
@@ -1,94 +1,92 @@
/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2020-2023 tusooa <tusooa@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import org.kde.kirigami 2.13 as Kirigami
import moe.kazv.mxc.kazv 0.0 as MK
import '.' as Kazv
ColumnLayout {
id: stickerPicker
property var stickerPackList
spacing: 0
signal sendMessageRequested(var eventJson)
ScrollView {
id: packListScrollView
Layout.fillWidth: true
Layout.minimumHeight: Kirigami.Units.gridUnit * 2
Layout.preferredHeight: packListView.height
ListView {
id: packListView
orientation: ListView.Horizontal
height: contentHeight
anchors.fill: parent
currentIndex: 0
model: stickerPackList
delegate: ToolButton {
objectName: `stickerPack${index}`
property var pack: stickerPackList.at(index)
icon.name: 'smiley'
text: l10n.get('sticker-picker-user-stickers')
checked: ListView.currentIndex === index
onClicked: ListView.currentIndex = index
}
}
}
property var currentPack: packListView.currentItem && packListView.currentItem.pack
property var stickerSize: Kirigami.Units.iconSizes.enormous
property var stickerMargin: Kirigami.Units.smallSpacing
GridView {
id: stickersGridView
Layout.fillWidth: true
Layout.minimumHeight: stickerPicker.stickerSize * 5
Layout.preferredHeight: stickersGridView.height
model: currentPack
cellWidth: stickerPicker.stickerSize + stickerPicker.stickerMargin
cellHeight: stickerPicker.stickerSize + stickerPicker.stickerMargin
- delegate: Item {
+ delegate: MouseArea {
objectName: `sticker${index}`
property var sticker: currentPack.at(index)
height: stickerPicker.stickerSize + stickerPicker.stickerMargin
width: stickerPicker.stickerSize + stickerPicker.stickerMargin
Kirigami.Icon {
anchors.centerIn: parent
height: stickerPicker.stickerSize
width: stickerPicker.stickerSize
source: matrixSdk.mxcUriToHttp(sticker.mxcUri)
}
Rectangle {
visible: hoverHandler.hovered
z: -1
anchors.fill: parent
color: Kirigami.Theme.activeBackgroundColor
}
HoverHandler {
id: hoverHandler
}
- TapHandler {
- onTapped: stickerPicker.sendMessageRequested(sticker.makeEventJson())
- }
+ onClicked: stickerPicker.sendMessageRequested(sticker.makeEventJson())
}
}
Component.onCompleted: {
console.log('stickerpicker finished', stickerPackList.count);
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Nov 1, 1:13 AM (18 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1802123
Default Alt Text
(2 KB)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline