aboutsummaryrefslogtreecommitdiff
path: root/aobutton.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'aobutton.cpp')
-rw-r--r--aobutton.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/aobutton.cpp b/aobutton.cpp
index f2d7012..b96af67 100644
--- a/aobutton.cpp
+++ b/aobutton.cpp
@@ -1,6 +1,26 @@
+#include "path_functions.h"
+#include "file_functions.h"
+
#include "aobutton.h"
-AOButton::AOButton()
+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_base_path() + "themes/default/";
+
+ if (file_exists(image_path))
+ this->setStyleSheet("border-image:url(\"" + image_path + "\")");
+ else
+ this->setStyleSheet("border-image:url(\"" + default_image_path + "\")");
+}
+