aboutsummaryrefslogtreecommitdiff
path: root/src/aobutton.cpp
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2020-07-31 16:17:05 -0500
committerGitHub <noreply@github.com>2020-07-31 16:17:05 -0500
commitec1c95bdb33dd063880c4cb6c3c9c3cf5d0ed454 (patch)
tree19e9217126837cac1ae3ab025b050bb3cfbda64b /src/aobutton.cpp
parent8ea01d4c3139e27e84091c0b24266d9fb50ddf38 (diff)
parent36b5af3cb9ce8e5530c5bd9353a4e2f10da506b6 (diff)
Merge pull request #217 from AttorneyOnline/kfo-ao2
Final mega-merge with the Killing Fever Online client, along with other associated bugfixes and feature additions. This commit is release-ready.
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;
}