aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/widgets/IconLabel.cpp
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-08-05 18:21:09 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-08-05 18:21:09 +0300
commit939a2d67ed75be714e9f3b1b918250d006b3860a (patch)
treec5700ba93652e26fc1f86235b1a278d90fd0ce91 /launcher/ui/widgets/IconLabel.cpp
parent6f7d901a1f5c02e0629e4bae9172c04bb81ce0d9 (diff)
parentae793f6cf11658c9abc5111e82d5ba7b3e6af127 (diff)
downloadPrismLauncher-939a2d67ed75be714e9f3b1b918250d006b3860a.tar.gz
PrismLauncher-939a2d67ed75be714e9f3b1b918250d006b3860a.tar.bz2
PrismLauncher-939a2d67ed75be714e9f3b1b918250d006b3860a.zip
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into develop12
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/ui/widgets/IconLabel.cpp')
-rw-r--r--launcher/ui/widgets/IconLabel.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/launcher/ui/widgets/IconLabel.cpp b/launcher/ui/widgets/IconLabel.cpp
index bf1c2358..28776686 100644
--- a/launcher/ui/widgets/IconLabel.cpp
+++ b/launcher/ui/widgets/IconLabel.cpp
@@ -1,13 +1,12 @@
#include "IconLabel.h"
-#include <QStyle>
-#include <QStyleOption>
#include <QLayout>
#include <QPainter>
#include <QRect>
+#include <QStyle>
+#include <QStyleOption>
-IconLabel::IconLabel(QWidget *parent, QIcon icon, QSize size)
- : QWidget(parent), m_size(size), m_icon(icon)
+IconLabel::IconLabel(QWidget* parent, QIcon icon, QSize size) : QWidget(parent), m_size(size), m_icon(icon)
{
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
}
@@ -23,19 +22,16 @@ void IconLabel::setIcon(QIcon icon)
update();
}
-void IconLabel::paintEvent(QPaintEvent *)
+void IconLabel::paintEvent(QPaintEvent*)
{
QPainter p(this);
QRect rect = contentsRect();
int width = rect.width();
int height = rect.height();
- if(width < height)
- {
+ if (width < height) {
rect.setHeight(width);
rect.translate(0, (height - width) / 2);
- }
- else if (width > height)
- {
+ } else if (width > height) {
rect.setWidth(height);
rect.translate((width - height) / 2, 0);
}