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