aboutsummaryrefslogtreecommitdiff
path: root/src/aobutton.cpp
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2020-05-22 19:17:55 -0500
committeroldmud0 <oldmud0@users.noreply.github.com>2020-05-22 19:17:55 -0500
commitfd1855b8d0ecaa56ae3165ad5d8f3bd65ff77a64 (patch)
tree9c27d658dd8f19e649e1742b0fd39104a50a3ca6 /src/aobutton.cpp
parent8928aa2718378bc42d20d5bbe6c17be68d65d6f3 (diff)
parent4617e3135ed14a28c4129154486022947fda9d82 (diff)
Merge KFO source unconditionally into AO2
Diffstat (limited to 'src/aobutton.cpp')
-rw-r--r--src/aobutton.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/aobutton.cpp b/src/aobutton.cpp
index fee946a4..dc2d8817 100644
--- a/src/aobutton.cpp
+++ b/src/aobutton.cpp
@@ -13,11 +13,26 @@ 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);
+ QString image_path =
+ ao_app->get_static_image_suffix(ao_app->get_theme_path(p_image));
+ QString default_image_path =
+ ao_app->get_static_image_suffix(ao_app->get_default_theme_path(p_image));
- if (file_exists(image_path))
- this->setStyleSheet("border-image:url(\"" + image_path + "\")");
+ if (file_exists(image_path)) {
+ this->setText("");
+ this->setStyleSheet("QPushButton { border-image: url(\"" + image_path +
+ "\") 0 0 0 0 stretch stretch; }"
+ "QToolTip { background-image: url(); color: #000000; "
+ "background-color: #ffffff; border: 0px; }");
+ }
+ else if (file_exists(default_image_path)) {
+ this->setText("");
+ this->setStyleSheet("QPushButton { border-image: url(\"" +
+ default_image_path +
+ "\"); }"
+ "QToolTip { background-image: url(); color: #000000; "
+ "background-color: #ffffff; border: 0px; }");
+ }
else
- this->setStyleSheet("border-image:url(\"" + default_image_path + "\")");
+ return;
}