aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCrystalwarrior <Varsash@Gmail.com>2022-03-25 18:18:42 +0300
committerGitHub <noreply@github.com>2022-03-25 18:18:42 +0300
commit69f49f7fee33a8b24de8c38eb594e1116cdf356f (patch)
treef822311c5181712d02fdf31aec19c27189ff41c0 /src
parent7bb7889923089127953dd335490d4684d281ef3d (diff)
Fix emote icon scaling being nearest neighbor due to qt stylesheet dumbness (#699)
Diffstat (limited to 'src')
-rw-r--r--src/aoemotebutton.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/aoemotebutton.cpp b/src/aoemotebutton.cpp
index 82149aff..b8e1489e 100644
--- a/src/aoemotebutton.cpp
+++ b/src/aoemotebutton.cpp
@@ -21,15 +21,18 @@ void AOEmoteButton::set_image(QString p_image, QString p_emote_comment)
if (file_exists(p_image)) {
this->setText("");
this->setStyleSheet(
- "QPushButton { border-image: url(\"" + p_image +
- "\") 0 0 0 0 stretch stretch; }"
+ "QPushButton { border: none; }"
"QToolTip { color: #000000; background-color: #ffffff; border: 0px; }");
+ this->setIcon(QPixmap(p_image).scaled(this->size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
+ this->setIconSize(this->size());
}
else {
this->setText(p_emote_comment);
this->setStyleSheet("QPushButton { border-image: url(); }"
"QToolTip { background-image: url(); color: #000000; "
"background-color: #ffffff; border: 0px; }");
+ this->setIcon(QIcon());
+ this->setIconSize(this->size());
}
}