| 7 | #include <QtGui/QFont> |
| 8 | |
| 9 | class RectKey : public Key { |
| 10 | public: |
| 11 | RectKey(KeyConfig &config, |
| 12 | const QRect &textGeometry, const QRect &keyGeometry, const QSize &labelSize, |
| 13 | const QColor &keyColor, const QColor &textColor, |
| 14 | const QString &labelText, const QString &secondText, const QString &alphaText, |
| 15 | Qt::Alignment labelAlign = Qt::AlignCenter, |
| 16 | Qt::Alignment secondAlign = Qt::AlignVCenter | Qt::AlignLeft, |
| 17 | Qt::Alignment alphaAlign = Qt::AlignVCenter | Qt::AlignRight) |
| 18 | : RectKey{config.next(), textGeometry, keyGeometry, labelSize, |
| 19 | keyColor, textColor, config.secondColor, config.alphaColor, |
| 20 | labelText, secondText, alphaText, config.labelFont, config.secondFont, config.alphaFont, |
| 21 | labelAlign, secondAlign, alphaAlign} { } |
| 22 | RectKey(KeyCode keycode, |
| 23 | const QRect &textGeometry, const QRect &keyGeometry, const QSize &labelSize, |
| 24 | const QColor &keyColor, const QColor &textColor, const QColor &secondColor, const QColor &alphaColor, |
| 25 | const QString &labelText, const QString &secondText, const QString &alphaText, |
| 26 | const QFont &labelFont, const QFont &secondFont, const QFont &alphaFont, |
| 27 | Qt::Alignment labelAlign = Qt::AlignCenter, |
| 28 | Qt::Alignment secondAlign = Qt::AlignVCenter | Qt::AlignLeft, |
| 29 | Qt::Alignment alphaAlign = Qt::AlignVCenter | Qt::AlignRight) |
| 30 | : RectKey{keycode, textGeometry, keyGeometry, labelSize, 4, 4, 4, 4, |
| 31 | keyColor, textColor, secondColor, alphaColor, labelText, secondText, alphaText, |
| 32 | labelFont, secondFont, alphaFont, labelAlign, secondAlign, alphaAlign} { } |
| 33 | RectKey(KeyConfig &config, |
| 34 | const QRect &textGeometry, const QRect &keyGeometry, const QSize &labelSize, |
| 35 | int topLeft, int topRight, int bottomLeft, int bottomRight, |
| 36 | const QColor &keyColor, const QColor &textColor, |
| 37 | const QString &labelText, const QString &secondText, const QString &alphaText, |
| 38 | Qt::Alignment labelAlign = Qt::AlignCenter, |
| 39 | Qt::Alignment secondAlign = Qt::AlignVCenter | Qt::AlignLeft, |
| 40 | Qt::Alignment alphaAlign = Qt::AlignVCenter | Qt::AlignRight) |
| 41 | : RectKey{config.next(), textGeometry, keyGeometry, labelSize, |
| 42 | topLeft, topRight, bottomLeft, bottomRight, |
| 43 | keyColor, textColor, config.secondColor, config.alphaColor, |
| 44 | labelText, secondText, alphaText, config.labelFont, config.secondFont, config.alphaFont, |
| 45 | labelAlign, secondAlign, alphaAlign} { } |
| 46 | RectKey(KeyCode keycode, |
| 47 | const QRect &textGeometry, const QRect &keyGeometry, const QSize &labelSize, |
| 48 | int topLeft, int topRight, int bottomLeft, int bottomRight, |
| 49 | const QColor &keyColor, const QColor &textColor, const QColor &secondColor, const QColor &alphaColor, |
| 50 | const QString &labelText, const QString &secondText, const QString &alphaText, |
| 51 | const QFont &labelFont, const QFont &secondFont, const QFont &alphaFont, |
| 52 | Qt::Alignment labelAlign = Qt::AlignCenter, |
| 53 | Qt::Alignment secondAlign = Qt::AlignVCenter | Qt::AlignLeft, |
| 54 | Qt::Alignment alphaAlign = Qt::AlignVCenter | Qt::AlignRight); |
| 55 | |
| 56 | void paint(QPainter &painter) const override; |
| 57 | bool isUnder(const QPainterPath &area) const override; |
| 58 | |
| 59 | protected: |
| 60 | QColor mTextColor, mSecondColor, mAlphaColor; |
| 61 | Qt::Alignment mLabelAlign, mSecondAlign, mAlphaAlign; |
| 62 | QFont mLabelFont, mSecondFont, mAlphaFont; |
| 63 | const QString mSecondText, mAlphaText; |
| 64 | }; |
| 65 | |
| 66 | #endif |
nothing calls this directly
no outgoing calls
no test coverage detected