From d3f23708c43bc132c322b778b2aa8d31a68d1c0c Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 20 Sep 2019 15:54:45 +0300 Subject: Revert buttons using setIcon and use a better stylesheet method instead Fix evidence buttons and emote buttons being hardcoded size --- src/aobutton.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/aobutton.cpp') diff --git a/src/aobutton.cpp b/src/aobutton.cpp index d80226f2..9efe13d0 100644 --- a/src/aobutton.cpp +++ b/src/aobutton.cpp @@ -20,17 +20,15 @@ void AOButton::set_image(QString p_image) if (file_exists(image_path)) { - this->setIcon(QIcon(image_path)); - this->setIconSize(this->size()); - this->setStyleSheet("border:0px"); this->setText(""); + this->setStyleSheet("QPushButton { border-image: url(\"" + image_path + "\") 0 0 0 0 stretch stretch; }" + "QToolTip { background-image: url(); color: #000000; background-color: #ffffff; border: 0px; }"); } else if (file_exists(default_image_path)) { - this->setIcon(QIcon(default_image_path)); - this->setIconSize(this->size()); - this->setStyleSheet("border:0px"); this->setText(""); + this->setStyleSheet("QPushButton { border-image: url(\"" + default_image_path + "\"); }" + "QToolTip { background-image: url(); color: #000000; background-color: #ffffff; border: 0px; }"); } else return; -- cgit