From 8409b71611d8c213fd7286359d4404f2a181e59b Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 17 Sep 2019 21:17:30 +0300 Subject: Tool tips! Tool tips for everyone! Change the way AOButton loads images into itself (stylesheet broke tooltips) --- src/aobutton.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/aobutton.cpp') diff --git a/src/aobutton.cpp b/src/aobutton.cpp index 1459729f..d80226f2 100644 --- a/src/aobutton.cpp +++ b/src/aobutton.cpp @@ -19,8 +19,20 @@ void AOButton::set_image(QString 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 + "\")"); + { + this->setIcon(QIcon(image_path)); + this->setIconSize(this->size()); + this->setStyleSheet("border:0px"); + this->setText(""); + } + else if (file_exists(default_image_path)) + { + this->setIcon(QIcon(default_image_path)); + this->setIconSize(this->size()); + this->setStyleSheet("border:0px"); + this->setText(""); + } else - this->setStyleSheet("border-image:url(\"" + default_image_path + "\")"); + return; } -- cgit