aboutsummaryrefslogtreecommitdiff
path: root/aoimage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'aoimage.cpp')
-rw-r--r--aoimage.cpp27
1 files changed, 8 insertions, 19 deletions
diff --git a/aoimage.cpp b/aoimage.cpp
index 2139fcc..4710a1f 100644
--- a/aoimage.cpp
+++ b/aoimage.cpp
@@ -20,10 +20,16 @@ void AOImage::set_image(QString p_image)
QString theme_image_path = ao_app->get_theme_path() + p_image;
QString default_image_path = ao_app->get_default_theme_path() + p_image;
+ QString final_image_path;
+
if (file_exists(theme_image_path))
- this->setPixmap(theme_image_path);
+ final_image_path = theme_image_path;
else
- this->setPixmap(default_image_path);
+ final_image_path = default_image_path;
+
+ QPixmap f_pixmap(final_image_path);
+
+ this->setPixmap(f_pixmap.scaled(this->width(), this->height(), Qt::IgnoreAspectRatio));
}
void AOImage::set_image_from_path(QString p_path)
@@ -41,20 +47,3 @@ void AOImage::set_image_from_path(QString p_path)
this->setPixmap(f_pixmap.scaled(this->width(), this->height(), Qt::IgnoreAspectRatio));
}
-
-void AOImage::set_scaled_image(QString p_image)
-{
- QString theme_image_path = ao_app->get_theme_path() + p_image;
- QString default_image_path = ao_app->get_default_theme_path() + p_image;
-
- QString final_image_path;
-
- if (file_exists(theme_image_path))
- final_image_path = theme_image_path;
- else
- final_image_path = default_image_path;
-
- QPixmap f_pixmap(final_image_path);
-
- this->setPixmap(f_pixmap.scaled(this->width(), this->height(), Qt::IgnoreAspectRatio));
-}