Chore: Proper Lambda Formatting (#2167)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Leon Richardt
2020-11-08 12:02:19 +01:00
committed by GitHub
parent fbd5df53d8
commit 0eed45ae67
71 changed files with 712 additions and 415 deletions
+25 -16
View File
@@ -83,15 +83,17 @@ BaseWindow::BaseWindow(FlagsEnum<Flags> _flags, QWidget *parent)
this->updateScale();
createWindowShortcut(this, "CTRL+0",
[] { getSettings()->uiScale.setValue(1); });
createWindowShortcut(this, "CTRL+0", [] {
getSettings()->uiScale.setValue(1);
});
this->resize(300, 150);
#ifdef USEWINSDK
this->useNextBounds_.setSingleShot(true);
QObject::connect(&this->useNextBounds_, &QTimer::timeout, this,
[this]() { this->currentBounds_ = this->nextBounds_; });
QObject::connect(&this->useNextBounds_, &QTimer::timeout, this, [this]() {
this->currentBounds_ = this->nextBounds_;
});
#endif
this->themeChangedEvent();
@@ -154,9 +156,10 @@ void BaseWindow::init()
// title
Label *title = new Label;
QObject::connect(
this, &QWidget::windowTitleChanged,
[title](const QString &text) { title->setText(text); });
QObject::connect(this, &QWidget::windowTitleChanged,
[title](const QString &text) {
title->setText(text);
});
QSizePolicy policy(QSizePolicy::Ignored,
QSizePolicy::Preferred);
@@ -187,7 +190,9 @@ void BaseWindow::init()
: Qt::WindowMaximized);
});
QObject::connect(_exitButton, &TitleBarButton::leftClicked,
this, [this] { this->close(); });
this, [this] {
this->close();
});
this->ui_.minButton = _minButton;
this->ui_.maxButton = _maxButton;
@@ -460,8 +465,9 @@ TitleBarButton *BaseWindow::addTitleBarButton(const TitleBarButtonStyle &style,
this->ui_.titlebarBox->insertWidget(1, button);
button->setButtonStyle(style);
QObject::connect(button, &TitleBarButton::leftClicked, this,
[onClicked] { onClicked(); });
QObject::connect(button, &TitleBarButton::leftClicked, this, [onClicked] {
onClicked();
});
return button;
}
@@ -474,8 +480,9 @@ EffectLabel *BaseWindow::addTitleBarLabel(std::function<void()> onClicked)
this->ui_.buttons.push_back(button);
this->ui_.titlebarBox->insertWidget(1, button);
QObject::connect(button, &EffectLabel::leftClicked, this,
[onClicked] { onClicked(); });
QObject::connect(button, &EffectLabel::leftClicked, this, [onClicked] {
onClicked();
});
return button;
}
@@ -550,8 +557,9 @@ void BaseWindow::resizeEvent(QResizeEvent *)
::SetWindowPos((HWND)this->winId(), nullptr, 0, 0,
rect.right - rect.left, rect.bottom - rect.top,
SWP_NOMOVE | SWP_NOZORDER);
QTimer::singleShot(10, this,
[this] { this->isResizeFixing_ = false; });
QTimer::singleShot(10, this, [this] {
this->isResizeFixing_ = false;
});
});
}
#endif
@@ -579,8 +587,9 @@ void BaseWindow::showEvent(QShowEvent *)
this->moveIntoDesktopRect(this, this->pos());
if (this->frameless_)
{
QTimer::singleShot(
30, this, [this] { this->moveIntoDesktopRect(this, this->pos()); });
QTimer::singleShot(30, this, [this] {
this->moveIntoDesktopRect(this, this->pos());
});
}
}