diff options
| author | Crystalwarrior <varsash@gmail.com> | 2019-09-20 15:54:45 +0300 |
|---|---|---|
| committer | Crystalwarrior <varsash@gmail.com> | 2019-09-20 15:54:45 +0300 |
| commit | d3f23708c43bc132c322b778b2aa8d31a68d1c0c (patch) | |
| tree | ecdc8ee551cb0614ad0285880eb7e14312df077a /src/aoemotebutton.cpp | |
| parent | 3899dbe0bd82875214ebd676130692120f89a412 (diff) | |
Revert buttons using setIcon and use a better stylesheet method instead
Fix evidence buttons and emote buttons being hardcoded size
Diffstat (limited to 'src/aoemotebutton.cpp')
| -rw-r--r-- | src/aoemotebutton.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/aoemotebutton.cpp b/src/aoemotebutton.cpp index 8d687126..e42bb73c 100644 --- a/src/aoemotebutton.cpp +++ b/src/aoemotebutton.cpp @@ -2,13 +2,13 @@ #include "file_functions.h" -AOEmoteButton::AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y) : QPushButton(p_parent) +AOEmoteButton::AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, int p_w, int p_h) : QPushButton(p_parent) { parent = p_parent; ao_app = p_ao_app; this->move(p_x, p_y); - this->resize(40, 40); + this->resize(p_w, p_h); connect(this, SIGNAL(clicked()), this, SLOT(on_clicked())); } @@ -17,15 +17,15 @@ void AOEmoteButton::set_image(QString p_image, QString p_emote_comment) { if (file_exists(p_image)) { - this->setIcon(QIcon(p_image)); - this->setIconSize(this->size()); - this->setStyleSheet("border:0px"); this->setText(""); + this->setStyleSheet("QPushButton { border-image: url(\"" + p_image + "\") 0 0 0 0 stretch stretch; }" + "QToolTip { color: #000000; background-color: #ffffff; border: 0px; }"); } else { this->setText(p_emote_comment); - this->setStyleSheet("border-image:url(\"\")"); + this->setStyleSheet("QPushButton { border-image: url(); }" + "QToolTip { background-image: url(); color: #000000; background-color: #ffffff; border: 0px; }"); } } |
