aboutsummaryrefslogtreecommitdiff
path: root/application/widgets/IconLabel.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2021-07-25 19:11:59 +0200
committerPetr Mrázek <peterix@gmail.com>2021-07-25 19:50:44 +0200
commit20b9f2b42a3b58b6081af271774fbcc34025dccb (patch)
tree064fa59facb3357139b47bd4e60bfc8edb35ca11 /application/widgets/IconLabel.cpp
parentdd133680858351e3e07690e286882327a4f42ba5 (diff)
downloadPrismLauncher-20b9f2b42a3b58b6081af271774fbcc34025dccb.tar.gz
PrismLauncher-20b9f2b42a3b58b6081af271774fbcc34025dccb.tar.bz2
PrismLauncher-20b9f2b42a3b58b6081af271774fbcc34025dccb.zip
NOISSUE Flatten gui and logic libraries into MultiMC
Diffstat (limited to 'application/widgets/IconLabel.cpp')
-rw-r--r--application/widgets/IconLabel.cpp43
1 files changed, 0 insertions, 43 deletions
diff --git a/application/widgets/IconLabel.cpp b/application/widgets/IconLabel.cpp
deleted file mode 100644
index bf1c2358..00000000
--- a/application/widgets/IconLabel.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-#include "IconLabel.h"
-
-#include <QStyle>
-#include <QStyleOption>
-#include <QLayout>
-#include <QPainter>
-#include <QRect>
-
-IconLabel::IconLabel(QWidget *parent, QIcon icon, QSize size)
- : QWidget(parent), m_size(size), m_icon(icon)
-{
- setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
-}
-
-QSize IconLabel::sizeHint() const
-{
- return m_size;
-}
-
-void IconLabel::setIcon(QIcon icon)
-{
- m_icon = icon;
- update();
-}
-
-void IconLabel::paintEvent(QPaintEvent *)
-{
- QPainter p(this);
- QRect rect = contentsRect();
- int width = rect.width();
- int height = rect.height();
- if(width < height)
- {
- rect.setHeight(width);
- rect.translate(0, (height - width) / 2);
- }
- else if (width > height)
- {
- rect.setWidth(height);
- rect.translate((width - height) / 2, 0);
- }
- m_icon.paint(&p, rect);
-}