aboutsummaryrefslogtreecommitdiff
path: root/src/aoevidencebutton.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/aoevidencebutton.cpp')
-rw-r--r--src/aoevidencebutton.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/aoevidencebutton.cpp b/src/aoevidencebutton.cpp
index 871b4775..61847f2d 100644
--- a/src/aoevidencebutton.cpp
+++ b/src/aoevidencebutton.cpp
@@ -2,28 +2,27 @@
#include "file_functions.h"
-AOEvidenceButton::AOEvidenceButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y) : QPushButton(p_parent)
+AOEvidenceButton::AOEvidenceButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, int p_w, int p_h) : QPushButton(p_parent)
{
ao_app = p_ao_app;
m_parent = p_parent;
- //HELLO AND WELCOME TO HARDCODE CENTRAL, MAY I TAKE YOUR FRESH ORDER OF PAIN AND SUFFERING
ui_selected = new AOImage(this, ao_app);
- ui_selected->resize(70, 70);
+ ui_selected->resize(p_w, p_h);
// ui_selected->move(p_x, p_y);
ui_selected->set_image("evidence_selected");
ui_selected->setAttribute(Qt::WA_TransparentForMouseEvents);
ui_selected->hide();
ui_selector = new AOImage(this, ao_app);
- ui_selector->resize(70, 70);
+ ui_selector->resize(p_w, p_h);
// ui_selector->move(p_x - 1, p_y - 1);
ui_selector->set_image("evidence_selector");
ui_selector->setAttribute(Qt::WA_TransparentForMouseEvents);
ui_selector->hide();
this->move(p_x, p_y);
- this->resize(70, 70);
+ this->resize(p_w, p_h);
// this->setAcceptDrops(true);
connect(this, SIGNAL(clicked()), this, SLOT(on_clicked()));
@@ -32,24 +31,24 @@ AOEvidenceButton::AOEvidenceButton(QWidget *p_parent, AOApplication *p_ao_app, i
void AOEvidenceButton::set_image(QString p_image)
{
QString image_path = ao_app->get_evidence_path(p_image);
- qDebug() << image_path << p_image;
if (file_exists(p_image))
{
this->setText("");
- this->setIcon(QIcon(p_image));
+ this->setStyleSheet("QPushButton { border-image: url(\"" + p_image + "\") 0 0 0 0 stretch stretch; }"
+ "QToolTip { color: #000000; background-color: #ffffff; border: 0px; }");
}
else if (file_exists(image_path))
{
this->setText("");
- this->setIcon(QIcon(image_path));
+ this->setStyleSheet("QPushButton { border-image: url(\"" + image_path + "\") 0 0 0 0 stretch stretch; }"
+ "QToolTip { color: #000000; background-color: #ffffff; border: 0px; }");
}
else
{
this->setText(p_image);
- this->setIcon(QIcon());
+ this->setStyleSheet("QPushButton { border-image: url(); }"
+ "QToolTip { background-image: url(); color: #000000; background-color: #ffffff; border: 0px; }");
}
- this->setIconSize(this->size());
- this->setStyleSheet("border:0px");
}
void AOEvidenceButton::set_theme_image(QString p_image)