31 lines
730 B
C++
31 lines
730 B
C++
|
|
#include "APP/APP_GlassCard.h"
|
||
|
|
|
||
|
|
#include <QtGui/QPainter>
|
||
|
|
|
||
|
|
namespace APP {
|
||
|
|
|
||
|
|
APP_GlassCard::APP_GlassCard(QWidget* parent)
|
||
|
|
: QFrame(parent)
|
||
|
|
{
|
||
|
|
setFrameShape(QFrame::NoFrame);
|
||
|
|
setAttribute(Qt::WA_StyledBackground, false);
|
||
|
|
}
|
||
|
|
|
||
|
|
void APP_GlassCard::paintEvent(QPaintEvent* event)
|
||
|
|
{
|
||
|
|
Q_UNUSED(event);
|
||
|
|
|
||
|
|
const QRectF BodyRect = rect().adjusted(1.0, 1.0, -1.0, -1.0);
|
||
|
|
const qreal Radius = 22.0;
|
||
|
|
const QColor FillColor(30, 35, 43);
|
||
|
|
const QColor BorderColor(82, 92, 104);
|
||
|
|
|
||
|
|
QPainter Painter(this);
|
||
|
|
Painter.setRenderHint(QPainter::Antialiasing, true);
|
||
|
|
Painter.setPen(QPen(BorderColor, 1.0));
|
||
|
|
Painter.setBrush(FillColor);
|
||
|
|
Painter.drawRoundedRect(BodyRect, Radius, Radius);
|
||
|
|
}
|
||
|
|
|
||
|
|
} // namespace APP
|