attempt to fix emoticons sizes on high DPI screens

This commit is contained in:
csoler 2016-11-26 11:22:35 +01:00
parent 3386238f35
commit 4ef1b08ee8

View File

@ -164,8 +164,8 @@ void Emoticons::showSmileyWidget(QWidget *parent, QWidget *button, const char *s
smGLayout->addWidget(smTab);
}
const int buttonWidth = QFontMetricsF(smWidget->font()).height()*2;
const int buttonHeight = QFontMetricsF(smWidget->font()).height()*2;
const int buttonWidth = QFontMetricsF(smWidget->font()).height()*1.2;
const int buttonHeight = QFontMetricsF(smWidget->font()).height()*1.2;
int maxRowCount = 0;
int maxCountPerLine = 0;
@ -179,7 +179,12 @@ void Emoticons::showSmileyWidget(QWidget *parent, QWidget *button, const char *s
if (! bOnlyOneGroup)
{
tabGrpWidget = new QWidget(smTab);
smTab->setIconSize(QSize(24,24));
// (Cyril) Never use an absolute size. It needs to be scaled to the actual font size on the screen.
//
QFontMetricsF fm(parent->font()) ;
smTab->setIconSize(QSize(32*fm.height()/14.0,32*fm.height()/14.0));
if (groupName.right(4).toLower() == ".png")
smTab->addTab( tabGrpWidget, QIcon(groupName), "");
else