mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Fix only first 7 stickers showing up
This commit is contained in:
parent
56b44a85b5
commit
9f416f1fc9
3 changed files with 8 additions and 6 deletions
|
@ -26,6 +26,12 @@ ImagePackModel::ImagePackModel(const std::string &roomId, bool stickers, QObject
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ImagePackModel::rowCount(const QModelIndex &) const
|
||||||
|
{
|
||||||
|
return (int)images.size();
|
||||||
|
}
|
||||||
|
|
||||||
QHash<int, QByteArray>
|
QHash<int, QByteArray>
|
||||||
ImagePackModel::roleNames() const
|
ImagePackModel::roleNames() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,11 +23,7 @@ public:
|
||||||
|
|
||||||
ImagePackModel(const std::string &roomId, bool stickers, QObject *parent = nullptr);
|
ImagePackModel(const std::string &roomId, bool stickers, QObject *parent = nullptr);
|
||||||
QHash<int, QByteArray> roleNames() const override;
|
QHash<int, QByteArray> roleNames() const override;
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
{
|
|
||||||
(void)parent;
|
|
||||||
return (int)images.size();
|
|
||||||
}
|
|
||||||
QVariant data(const QModelIndex &index, int role) const override;
|
QVariant data(const QModelIndex &index, int role) const override;
|
||||||
|
|
||||||
mtx::events::msc2545::PackImage imageAt(int row)
|
mtx::events::msc2545::PackImage imageAt(int row)
|
||||||
|
|
|
@ -597,7 +597,7 @@ TimelineViewManager::completerFor(QString completerName, QString roomId)
|
||||||
return proxy;
|
return proxy;
|
||||||
} else if (completerName == "stickers") {
|
} else if (completerName == "stickers") {
|
||||||
auto stickerModel = new ImagePackModel(roomId.toStdString(), true);
|
auto stickerModel = new ImagePackModel(roomId.toStdString(), true);
|
||||||
auto proxy = new CompletionProxyModel(stickerModel);
|
auto proxy = new CompletionProxyModel(stickerModel, 1, static_cast<size_t>(-1) / 4);
|
||||||
stickerModel->setParent(proxy);
|
stickerModel->setParent(proxy);
|
||||||
return proxy;
|
return proxy;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue