~ubuntu-branches/ubuntu/oneiric/kdeplasma-addons/oneiric

« back to all changes in this revision

Viewing changes to applets/plasmaboard/FuncKey.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-11-26 13:35:18 UTC
  • mfrom: (1.1.37 upstream)
  • Revision ID: james.westby@ubuntu.com-20101126133518-oxz33xjsoi02ty9f
Tags: 4:4.5.80-0ubuntu1
* New upstream beta release
* Disable kubuntu_02_microblog_default_configuration.diff does not apply
* New package plasma-containments-addons

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <plasma/theme.h>
26
26
 
27
27
FuncKey::FuncKey(QPoint relativePosition, QSize relativeSize, unsigned int keycode, QString label):
28
 
        AlphaNumKey(relativePosition, relativeSize, keycode) {
 
28
        AlphaNumKey(relativePosition, relativeSize, keycode)
 
29
{
29
30
    setLabel(label);
30
31
}
31
32
 
32
 
void FuncKey::paint(QPainter *painter){
 
33
void FuncKey::paint(QPainter *painter)
 
34
{
33
35
    AlphaNumKey::paint(painter);
34
36
}
35
37
 
36
 
void FuncKey::paintArrow(QPainter *painter){
 
38
void FuncKey::paintArrow(QPainter *painter)
 
39
{
37
40
 
38
41
    int unit = qMin(size().width(), size().height()) / 8;
39
42
    painter->drawLine(-1*unit, 0 , 3*unit, 0);
52
55
    painter->save();
53
56
    int fontSize = qMin(size().width(), size().height()) / 5 - (label().size()/6 + 1);
54
57
    painter->setFont(QFont( Plasma::Theme::defaultTheme()->font(Plasma::Theme::DefaultFont).toString(), fontSize ));
 
58
    painter->setPen(Plasma::Theme::defaultTheme()->color(Plasma::Theme::ButtonTextColor));
55
59
    painter->drawText(rect(), Qt::AlignCenter, label());
56
60
    
57
61
    painter->restore();