Optimized the emoticon selector box size based on how many emoticons are loaded (by anmo), update emotes.acs

This commit is contained in:
defnax 2015-12-22 19:57:26 +01:00
parent 334b414335
commit 95d8647a7e
3 changed files with 8 additions and 7 deletions

View file

@ -29,7 +29,7 @@
#include <QPushButton>
#include <iostream>
#include <math.h>
#include "Emoticons.h"
#include "util/HandleRichText.h"
@ -128,9 +128,9 @@ void Emoticons::showSmileyWidget(QWidget *parent, QWidget *button, const char *s
const int buttonWidth = 26;
const int buttonHeight = 26;
const int countPerLine = 14;
int rowCount = (Smileys.size()/countPerLine) + ((Smileys.size() % countPerLine) ? 1 : 0);
int rowCount = (int)sqrt((double)Smileys.size());
int countPerLine = (Smileys.size()/rowCount) + ((Smileys.size() % rowCount) ? 1 : 0);
smWidget->setAttribute( Qt::WA_DeleteOnClose);
smWidget->setWindowTitle("Emoticons");