atrooney-online-2/src/aobutton.cpp
oldmud0 13942345c6 Run clang-format on entire project
Indentation fixed to 2 spaces per tab. Braces set to Stroustrup style.
Lines reflow at 80 characters. One-line method bodies are on the same
line as the signature. Space always after `//`. No indentation
on preprocessor macros. Includes are sorted lexicographically.

If you don't want to see this commit on blames, use the hidden
whitespace option on GitHub, or use `-w` in git-blame.
2020-04-17 21:57:16 -05:00

24 lines
579 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 + "\")");
}