21
21
#include "AlphaNumKey.h"
23
22
#include "Helpers.h"
25
AlphaNumKey::AlphaNumKey(PlasmaboardWidget *parent, unsigned int keysym):
28
QObject::connect(this, SIGNAL( clicked() ), parent, SLOT( clear() ) );
29
QObject::connect(this, SIGNAL( keyPressed ( QString, QSizeF, QPointF ) ), parent, SLOT( setTooltip( QString, QSizeF, QPointF ) ) );
24
#include <plasma/theme.h>
26
AlphaNumKey::AlphaNumKey(QPoint relativePosition, QSize relativeSize, unsigned int keycode):
27
BoardKey(relativePosition, relativeSize, keycode){
34
32
AlphaNumKey::~AlphaNumKey() {
38
void AlphaNumKey::pressed(){
40
emit keyPressed(text(), size(), pos());
43
void AlphaNumKey::setKeycode(unsigned int keycodeP) {
48
void AlphaNumKey::setLabel(int level){
49
setText( Helpers::mapToUnicode(Helpers::keycodeToKeysym(getKeycode(),level)) );
52
void AlphaNumKey::switchKey(bool isLevel2, bool isAlternative, bool isLocked){
36
QString AlphaNumKey::label() const
41
void AlphaNumKey::paint(QPainter *painter)
43
BoardKey::paint(painter);
48
void AlphaNumKey::paintLabel(QPainter *painter)
51
int fontSize = qMin(size().width(), size().height()) / 2;
52
painter->setFont(QFont( Plasma::Theme::defaultTheme()->font(Plasma::Theme::DefaultFont).toString(), fontSize ));
53
painter->drawText(rect(), Qt::AlignCenter, m_label);
57
void AlphaNumKey::setLabel(int level)
59
//m_label = Helpers::mapToUnicode(Helpers::keycodeToKeysym(getKeycode(),level));
60
setLabel(Helpers::mapToUnicode(getKeysymbol(level)));
63
void AlphaNumKey::setLabel(const QString &label)
68
void AlphaNumKey::switchKey(bool isLevel2, bool isAlternative, bool isLocked)
54
71
isLevel2 = !isLevel2;