mirror of
https://github.com/fergalmoran/flameshot.git
synced 2025-12-22 09:51:06 +00:00
Changed clang format to new agreement
This commit is contained in:
committed by
borgmanJeremy
parent
2cbccc3d0a
commit
0d5386edd4
@@ -26,52 +26,48 @@
|
||||
NotifierBox::NotifierBox(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
m_timer = new QTimer(this);
|
||||
m_timer->setSingleShot(true);
|
||||
m_timer->setInterval(1200);
|
||||
connect(m_timer, &QTimer::timeout, this, &NotifierBox::hide);
|
||||
m_bgColor = ConfigHandler().uiMainColorValue();
|
||||
m_foregroundColor =
|
||||
(ColorUtils::colorIsDark(m_bgColor) ? Qt::white : Qt::black);
|
||||
m_bgColor.setAlpha(180);
|
||||
const int size =
|
||||
(GlobalValues::buttonBaseSize() + GlobalValues::buttonBaseSize() / 2) *
|
||||
qApp->devicePixelRatio();
|
||||
setFixedSize(QSize(size, size));
|
||||
m_timer = new QTimer(this);
|
||||
m_timer->setSingleShot(true);
|
||||
m_timer->setInterval(1200);
|
||||
connect(m_timer, &QTimer::timeout, this, &NotifierBox::hide);
|
||||
m_bgColor = ConfigHandler().uiMainColorValue();
|
||||
m_foregroundColor =
|
||||
(ColorUtils::colorIsDark(m_bgColor) ? Qt::white : Qt::black);
|
||||
m_bgColor.setAlpha(180);
|
||||
const int size =
|
||||
(GlobalValues::buttonBaseSize() + GlobalValues::buttonBaseSize() / 2) *
|
||||
qApp->devicePixelRatio();
|
||||
setFixedSize(QSize(size, size));
|
||||
}
|
||||
|
||||
void
|
||||
NotifierBox::enterEvent(QEvent*)
|
||||
void NotifierBox::enterEvent(QEvent*)
|
||||
{
|
||||
hide();
|
||||
hide();
|
||||
}
|
||||
|
||||
void
|
||||
NotifierBox::paintEvent(QPaintEvent*)
|
||||
void NotifierBox::paintEvent(QPaintEvent*)
|
||||
{
|
||||
QPainter painter(this);
|
||||
// draw Elipse
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
painter.setBrush(QBrush(m_bgColor, Qt::SolidPattern));
|
||||
painter.setPen(QPen(Qt::transparent));
|
||||
painter.drawEllipse(rect());
|
||||
// Draw the text:
|
||||
painter.setPen(QPen(m_foregroundColor));
|
||||
painter.drawText(rect(), Qt::AlignCenter, m_message);
|
||||
QPainter painter(this);
|
||||
// draw Elipse
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
painter.setBrush(QBrush(m_bgColor, Qt::SolidPattern));
|
||||
painter.setPen(QPen(Qt::transparent));
|
||||
painter.drawEllipse(rect());
|
||||
// Draw the text:
|
||||
painter.setPen(QPen(m_foregroundColor));
|
||||
painter.drawText(rect(), Qt::AlignCenter, m_message);
|
||||
}
|
||||
|
||||
void
|
||||
NotifierBox::showMessage(const QString& msg)
|
||||
void NotifierBox::showMessage(const QString& msg)
|
||||
{
|
||||
m_message = msg;
|
||||
update();
|
||||
show();
|
||||
m_timer->start();
|
||||
m_message = msg;
|
||||
update();
|
||||
show();
|
||||
m_timer->start();
|
||||
}
|
||||
|
||||
void
|
||||
NotifierBox::showColor(const QColor& color)
|
||||
void NotifierBox::showColor(const QColor& color)
|
||||
{
|
||||
Q_UNUSED(color);
|
||||
m_message = QLatin1String("");
|
||||
Q_UNUSED(color);
|
||||
m_message = QLatin1String("");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user