diff options
| author | Crystalwarrior <varsash@gmail.com> | 2019-09-17 21:17:30 +0300 |
|---|---|---|
| committer | Crystalwarrior <varsash@gmail.com> | 2019-09-17 21:17:30 +0300 |
| commit | 8409b71611d8c213fd7286359d4404f2a181e59b (patch) | |
| tree | 2724c62e3daef5db3260fcba9bb4b7ce85398e07 /src/aobutton.cpp | |
| parent | 9d20cf03222add2ef04d4d2cc305458bdf00fcad (diff) | |
Tool tips! Tool tips for everyone!
Change the way AOButton loads images into itself (stylesheet broke tooltips)
Diffstat (limited to 'src/aobutton.cpp')
| -rw-r--r-- | src/aobutton.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
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; } |
