Files
Qt_keyboard/APP/APP_KeyButton.h

34 lines
794 B
C
Raw Normal View History

2026-04-03 09:26:10 +08:00
#pragma once
#include "APP/APP_KeypadModel.h"
#include <QtGui/QColor>
#include <QtWidgets/QPushButton>
namespace APP {
class APP_KeyButton : public QPushButton
{
public:
explicit APP_KeyButton(const APP_KeyInfo& KeyInfo, QWidget* parent = nullptr);
void App_Func_SetLatched(bool IsLatched);
void App_Func_SetPressed(bool IsPressed);
void App_Func_SetHintText(const QString& HintText);
protected:
void paintEvent(QPaintEvent* event) override;
private:
QColor App_Func_GetAccentColor() const;
QColor App_Func_GetBackgroundColor() const;
QColor App_Func_GetBorderColor() const;
QColor App_Func_GetTextColor() const;
APP_KeyInfo appKeyInfo;
QString appHintText;
bool appIsLatched = false;
bool appIsPressed = false;
};
} // namespace APP