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
+40
View File
@@ -0,0 +1,40 @@
#pragma once
#include "widgets/buttons/Button.hpp"
namespace chatterino {
/// @brief A button with a #dim() setting for controlling the opacity of its
/// content.
///
/// This button doesn't paint anything.
///
/// @sa #currentContentOpacity()
class DimButton : public Button
{
public:
enum class Dim : std::uint8_t {
/// Fully opaque (100% opcaity)
None,
/// Slightly transparent (70% opacity)
Some,
/// Almost transparent (15% opacity)
Lots,
};
DimButton(BaseWidget *parent = nullptr);
/// Returns the current dim level.
[[nodiscard]] Dim dim() const noexcept;
/// Setter for #dim()
void setDim(Dim value);
/// Returns the current opacity based on the current dim level.
[[nodiscard]] qreal currentContentOpacity() const noexcept;
private:
Dim dim_ = Dim::Some;
};
} // namespace chatterino