mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-02 03:16:58 +03:00
Finish status pills.
This commit is contained in:
parent
927217c7f0
commit
8a8c4193e6
10 changed files with 242 additions and 114 deletions
30
gui/widgets/IconLabel.cpp
Normal file
30
gui/widgets/IconLabel.cpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include "IconLabel.h"
|
||||
|
||||
#include <QStyle>
|
||||
#include <QStyleOption>
|
||||
#include <QLayout>
|
||||
#include <QPainter>
|
||||
#include <QRect>
|
||||
|
||||
IconLabel::IconLabel(QWidget *parent, QIcon icon, QSize size)
|
||||
: QWidget(parent), m_icon(icon), m_size(size)
|
||||
{
|
||||
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);
|
||||
m_icon.paint(&p, contentsRect());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue