atrooney-online-2/aobutton.cpp
Cerapter d314b8dd07 Moved includes out of the CPP files into the header files.
Reimplementation of `30a87d23c9c63bed072b3460e7482075dc530b2c` from the
old origin.
2018-08-19 09:37:34 +02:00

27 lines
584 B
C++

#include "aobutton.h"
#include "debug_functions.h"
#include "file_functions.h"
AOButton::AOButton(QWidget *parent, AOApplication *p_ao_app) : QPushButton(parent)
{
ao_app = p_ao_app;
}
AOButton::~AOButton()
{
}
void AOButton::set_image(QString p_image)
{
QString image_path = ao_app->get_theme_path() + p_image;
QString default_image_path = ao_app->get_default_theme_path() + p_image;
if (file_exists(image_path))
this->setStyleSheet("border-image:url(\"" + image_path + "\")");
else
this->setStyleSheet("border-image:url(\"" + default_image_path + "\")");
}