aboutsummaryrefslogtreecommitdiff
path: root/src/aoevidencebutton.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/aoevidencebutton.cpp')
-rw-r--r--src/aoevidencebutton.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/aoevidencebutton.cpp b/src/aoevidencebutton.cpp
index 616f636..871b477 100644
--- a/src/aoevidencebutton.cpp
+++ b/src/aoevidencebutton.cpp
@@ -7,48 +7,49 @@ AOEvidenceButton::AOEvidenceButton(QWidget *p_parent, AOApplication *p_ao_app, i
ao_app = p_ao_app;
m_parent = p_parent;
- ui_selected = new AOImage(p_parent, ao_app);
+ //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->move(p_x, p_y);
+// 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(p_parent, ao_app);
- ui_selector->resize(71, 71);
- ui_selector->move(p_x - 1, p_y - 1);
+ ui_selector = new AOImage(this, ao_app);
+ ui_selector->resize(70, 70);
+// 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->setAcceptDrops(true);
+// this->setAcceptDrops(true);
connect(this, SIGNAL(clicked()), this, SLOT(on_clicked()));
}
-void AOEvidenceButton::reset()
-{
- this->hide();
- ui_selected->hide();
- ui_selector->hide();
-}
-
void AOEvidenceButton::set_image(QString p_image)
{
QString image_path = ao_app->get_evidence_path(p_image);
-
- if (file_exists(image_path))
+ qDebug() << image_path << p_image;
+ if (file_exists(p_image))
+ {
+ this->setText("");
+ this->setIcon(QIcon(p_image));
+ }
+ else if (file_exists(image_path))
{
this->setText("");
- this->setStyleSheet("border-image:url(\"" + image_path + "\")");
+ this->setIcon(QIcon(image_path));
}
else
{
this->setText(p_image);
- this->setStyleSheet("");
+ this->setIcon(QIcon());
}
+ this->setIconSize(this->size());
+ this->setStyleSheet("border:0px");
}
void AOEvidenceButton::set_theme_image(QString p_image)
@@ -63,8 +64,7 @@ void AOEvidenceButton::set_theme_image(QString p_image)
else
final_image_path = default_image_path;
- this->setText("");
- this->setStyleSheet("border-image:url(\"" + final_image_path + "\")");
+ this->set_image(final_image_path);
}
void AOEvidenceButton::set_selected(bool p_selected)