Code refactoring - change code style to the new clang-format rules

This commit is contained in:
Yuriy Puchkov
2020-09-23 15:24:16 +03:00
parent 5a62cd3b13
commit b88a5fbce8
175 changed files with 6200 additions and 5356 deletions

View File

@@ -16,15 +16,16 @@
// along with Flameshot. If not, see <http://www.gnu.org/licenses/>.
#include "notificationwidget.h"
#include <QLabel>
#include <QTimer>
#include <QLabel>
#include <QPropertyAnimation>
#include <QVBoxLayout>
#include <QFrame>
#include <QIcon>
#include <QLabel>
#include <QPropertyAnimation>
#include <QTimer>
#include <QVBoxLayout>
NotificationWidget::NotificationWidget(QWidget *parent) : QWidget(parent) {
NotificationWidget::NotificationWidget(QWidget* parent)
: QWidget(parent)
{
m_timer = new QTimer(this);
m_timer->setSingleShot(true);
m_timer->setInterval(7000);
@@ -40,7 +41,8 @@ NotificationWidget::NotificationWidget(QWidget *parent) : QWidget(parent) {
m_hideAnimation = new QPropertyAnimation(m_content, "geometry", this);
m_hideAnimation->setDuration(300);
connect(m_hideAnimation, &QPropertyAnimation::finished, m_label, &QLabel::hide);
connect(
m_hideAnimation, &QPropertyAnimation::finished, m_label, &QLabel::hide);
auto mainLayout = new QVBoxLayout();
setLayout(mainLayout);
@@ -52,20 +54,23 @@ NotificationWidget::NotificationWidget(QWidget *parent) : QWidget(parent) {
setFixedHeight(40);
}
void NotificationWidget::showMessage(const QString &msg) {
void NotificationWidget::showMessage(const QString& msg)
{
m_label->setText(msg);
m_label->show();
animatedShow();
}
void NotificationWidget::animatedShow() {
void NotificationWidget::animatedShow()
{
m_showAnimation->setStartValue(QRect(0, 0, width(), 0));
m_showAnimation->setEndValue(QRect(0, 0, width(), height()));
m_showAnimation->start();
m_timer->start();
}
void NotificationWidget::animatedHide() {
void NotificationWidget::animatedHide()
{
m_hideAnimation->setStartValue(QRect(0, 0, width(), height()));
m_hideAnimation->setEndValue(QRect(0, 0, width(), 0));
m_hideAnimation->start();