mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-13 08:29:32 -05:00
Merge pull request #555 from hunbernd/fix/random-emoji-order
Fixed emoticon order
This commit is contained in:
commit
f934e88fdf
@ -34,6 +34,7 @@
|
||||
#include "util/HandleRichText.h"
|
||||
|
||||
static QHash<QString, QString> Smileys;
|
||||
static QVector<QString> order;
|
||||
|
||||
void Emoticons::load()
|
||||
{
|
||||
@ -115,6 +116,7 @@ void Emoticons::load()
|
||||
} else {
|
||||
Smileys.insert(smcode, smfile);
|
||||
}
|
||||
order.append(smcode);
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,15 +176,15 @@ void Emoticons::showSmileyWidget(QWidget *parent, QWidget *button, const char *s
|
||||
x = 0;
|
||||
y = 0;
|
||||
|
||||
QHashIterator<QString, QString> i(Smileys);
|
||||
QVectorIterator<QString> i(order);
|
||||
while(i.hasNext())
|
||||
{
|
||||
i.next();
|
||||
QString key = i.next();
|
||||
QPushButton *smButton = new QPushButton("", smWidget);
|
||||
smButton->setGeometry(x*buttonWidth, y*buttonHeight, buttonWidth, buttonHeight);
|
||||
smButton->setIconSize(QSize(buttonWidth, buttonHeight));
|
||||
smButton->setIcon(QPixmap(i.value()));
|
||||
smButton->setToolTip(i.key());
|
||||
smButton->setIcon(QPixmap(Smileys.value(key)));
|
||||
smButton->setToolTip(key);
|
||||
smButton->setStyleSheet("QPushButton:hover {border: 3px solid white; border-radius: 2px;}");
|
||||
smButton->setFlat(true);
|
||||
++x;
|
||||
|
Loading…
Reference in New Issue
Block a user