Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85712981
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
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 fa22138..f026017 100644
--- a/src/contents/ui/StickerPicker.qml
+++ b/src/contents/ui/StickerPicker.qml
@@ -1,92 +1,93 @@
/*
* 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: MouseArea {
objectName: `sticker${index}`
property var sticker: currentPack.at(index)
height: stickerPicker.stickerSize + stickerPicker.stickerMargin
width: stickerPicker.stickerSize + stickerPicker.stickerMargin
- Kirigami.Icon {
+ Image {
anchors.centerIn: parent
+ fillMode: Image.PreserveAspectFit
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
}
onClicked: stickerPicker.sendMessageRequested(sticker.makeEventJson())
}
}
Component.onCompleted: {
console.log('stickerpicker finished', stickerPackList.count);
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Sep 19, 2:25 PM (18 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1769555
Default Alt Text
(2 KB)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline
Log In to Comment