chore: reformat

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu
2023-08-02 18:35:35 +02:00
parent ce2ca13815
commit 1d468ac35a
594 changed files with 16040 additions and 16536 deletions

View File

@ -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);
}