refactor: fix clang-tidy auto*, const&, and curly braces (#5083)

This commit is contained in:
pajlada
2024-01-14 17:54:52 +01:00
committed by GitHub
parent 292f9b9734
commit 5b6675abb4
78 changed files with 647 additions and 228 deletions
+14
View File
@@ -16,10 +16,14 @@ namespace {
const QSize &size) -> QPixmap
{
if (resized.size() == size)
{
return resized;
}
else
{
return current.scaled(size, Qt::IgnoreAspectRatio,
Qt::SmoothTransformation);
}
}
} // namespace
@@ -92,11 +96,17 @@ bool Button::getEnableMargin() const
qreal Button::getCurrentDimAmount() const
{
if (this->dimPixmap_ == Dim::None || this->mouseOver_)
{
return 1;
}
else if (this->dimPixmap_ == Dim::Some)
{
return 0.7;
}
else
{
return 0.15;
}
}
void Button::setBorderColor(const QColor &color)
@@ -114,7 +124,9 @@ const QColor &Button::getBorderColor() const
void Button::setMenu(std::unique_ptr<QMenu> menu)
{
if (this->menu_)
{
this->menu_.release()->deleteLater();
}
this->menu_ = std::move(menu);
@@ -362,7 +374,9 @@ void Button::onMouseEffectTimeout()
void Button::showMenu()
{
if (!this->menu_)
{
return;
}
auto menuSizeHint = this->menu_->sizeHint();
auto point = this->mapToGlobal(