aboutsummaryrefslogtreecommitdiff
path: root/aobutton.cpp
blob: 9f6ba232fafe4e5c02aa7e76f438e59863eb125f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "aobutton.h"

#include "debug_functions.h"
#include "path_functions.h"
#include "file_functions.h"

#include <QDebug>

AOButton::AOButton(QWidget *parent) : QPushButton(parent)
{

}

AOButton::~AOButton()
{

}

void AOButton::set_image(QString p_image)
{
  QString image_path = get_theme_path() + p_image;
  QString default_image_path = 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 + "\")");
}