mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 07:29:33 -05:00
Cache sticker icons
This commit is contained in:
parent
e8bdce6e23
commit
15ac7eecc8
@ -45,6 +45,7 @@ static QVector<QString> grpOrdered;
|
|||||||
static QStringList filters;
|
static QStringList filters;
|
||||||
static QStringList stickerFolders;
|
static QStringList stickerFolders;
|
||||||
static QHash<QString, QString> tooltipcache;
|
static QHash<QString, QString> tooltipcache;
|
||||||
|
static QHash<QString, QPixmap> iconcache;
|
||||||
|
|
||||||
void Emoticons::load()
|
void Emoticons::load()
|
||||||
{
|
{
|
||||||
@ -398,7 +399,11 @@ void Emoticons::showStickerWidget(QWidget *parent, QWidget *button, const char *
|
|||||||
QPushButton *button = new QPushButton("", tabGrpWidget);
|
QPushButton *button = new QPushButton("", tabGrpWidget);
|
||||||
button->setIconSize(QSize(buttonWidth, buttonHeight));
|
button->setIconSize(QSize(buttonWidth, buttonHeight));
|
||||||
button->setFixedSize(QSize(buttonWidth, buttonHeight));
|
button->setFixedSize(QSize(buttonWidth, buttonHeight));
|
||||||
button->setIcon(QPixmap(fi.absoluteFilePath()));
|
if(!iconcache.contains(fi.absoluteFilePath()))
|
||||||
|
{
|
||||||
|
iconcache.insert(fi.absoluteFilePath(), QPixmap(fi.absoluteFilePath()).scaled(buttonWidth, buttonHeight, Qt::KeepAspectRatio));
|
||||||
|
}
|
||||||
|
button->setIcon(iconcache[fi.absoluteFilePath()]);
|
||||||
button->setToolTip(fi.fileName());
|
button->setToolTip(fi.fileName());
|
||||||
button->setStatusTip(fi.absoluteFilePath());
|
button->setStatusTip(fi.absoluteFilePath());
|
||||||
button->setStyleSheet("QPushButton:hover {border: 3px solid #0099cc; border-radius: 3px;}");
|
button->setStyleSheet("QPushButton:hover {border: 3px solid #0099cc; border-radius: 3px;}");
|
||||||
|
Loading…
Reference in New Issue
Block a user