refactor: buttons and friends (#6102)

This commit is contained in:
nerix
2025-05-25 11:17:06 +02:00
committed by GitHub
parent deed1061b5
commit 84c0b39fde
49 changed files with 1083 additions and 691 deletions
+36
View File
@@ -0,0 +1,36 @@
#include "widgets/buttons/DimButton.hpp"
namespace chatterino {
DimButton::DimButton(BaseWidget *parent)
: Button(parent)
{
}
DimButton::Dim DimButton::dim() const noexcept
{
return this->dim_;
}
void DimButton::setDim(Dim value)
{
this->dim_ = value;
this->invalidateContent();
}
qreal DimButton::currentContentOpacity() const noexcept
{
if (this->dim_ == Dim::None || this->mouseOver())
{
return 1;
}
if (this->dim_ == Dim::Some)
{
return 0.7;
}
return 0.15;
}
} // namespace chatterino