mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Imroved Emoji Tabs for a fixed size and display tabs at bottom.
Imroved Emoji Tabs for a fixed size and display tabs at bottom. Enabled to attach *.webp and *.gif pictures.
This commit is contained in:
parent
f63ae7efbb
commit
3f59cfc7ea
@ -1582,7 +1582,7 @@ void ChatWidget::addExtraPicture()
|
||||
{
|
||||
// select a picture file
|
||||
QString file;
|
||||
if (misc::getOpenFileName(window(), RshareSettings::LASTDIR_IMAGES, tr("Load Picture File"), "Pictures (*.png *.xpm *.jpg *.jpeg)", file)) {
|
||||
if (misc::getOpenFileName(window(), RshareSettings::LASTDIR_IMAGES, tr("Load Picture File"), "Pictures (*.png *.xpm *.jpg *.jpeg *.gif *.webp )", file)) {
|
||||
QString encodedImage;
|
||||
uint32_t maxMessageSize = this->maxMessageSize();
|
||||
if (RsHtml::makeEmbeddedImage(file, encodedImage, 640*480, maxMessageSize - 200)) { //-200 for the html stuff
|
||||
|
@ -163,8 +163,8 @@ void Emoticons::showSmileyWidget(QWidget *parent, QWidget *button, const char *s
|
||||
smGLayout->addWidget(smTab);
|
||||
}
|
||||
|
||||
const int buttonWidth = QFontMetricsF(smWidget->font()).height()*2.4;
|
||||
const int buttonHeight = QFontMetricsF(smWidget->font()).height()*2.4;
|
||||
const int buttonWidth = QFontMetricsF(smWidget->font()).height()*2.6;
|
||||
const int buttonHeight = QFontMetricsF(smWidget->font()).height()*2.6;
|
||||
int maxRowCount = 0;
|
||||
int maxCountPerLine = 0;
|
||||
|
||||
@ -182,8 +182,10 @@ void Emoticons::showSmileyWidget(QWidget *parent, QWidget *button, const char *s
|
||||
// (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));
|
||||
smTab->setIconSize(QSize(28*fm.height()/14.0,28*fm.height()/14.0));
|
||||
smTab->setMinimumWidth(400);
|
||||
smTab->setTabPosition(QTabWidget::South);
|
||||
smTab->setStyleSheet("QTabBar::tab { height: 44px; width: 44px; }");
|
||||
|
||||
if (groupName.right(4).toLower() == ".png")
|
||||
smTab->addTab( tabGrpWidget, QIcon(groupName), "");
|
||||
@ -215,7 +217,7 @@ void Emoticons::showSmileyWidget(QWidget *parent, QWidget *button, const char *s
|
||||
button->setFixedSize(QSize(buttonWidth, buttonHeight));
|
||||
button->setIcon(QPixmap(group.value(key)));
|
||||
button->setToolTip(key);
|
||||
button->setStyleSheet("QPushButton:hover {border: 3px solid white; border-radius: 2px;}");
|
||||
button->setStyleSheet("QPushButton:hover {border: 3px solid #0099cc; border-radius: 3px;}");
|
||||
button->setFlat(true);
|
||||
tabGLayout->addWidget(button,col,lin);
|
||||
++lin;
|
||||
|
Loading…
Reference in New Issue
Block a user