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

« back to all changes in this revision

Viewing changes to applets/plasmaboard/tooltip.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-11-26 13:35:18 UTC
  • mto: (0.4.3 experimental)
  • mto: This revision was merged to the branch mainline in revision 84.
  • Revision ID: james.westby@ubuntu.com-20101126133518-remqkgqjafk2a4jc
Tags: upstream-4.5.80
ImportĀ upstreamĀ versionĀ 4.5.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
 
55
55
}
56
56
 
57
 
void Tooltip::setColors(){
 
57
void Tooltip::setColors()
 
58
{
58
59
    QPalette pal = palette();
59
60
    pal.setColor(backgroundRole(), Qt::transparent);
60
61
    pal.setColor(QPalette::WindowText, Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor));
61
62
    setPalette(pal);
62
63
}
63
64
 
64
 
void Tooltip::setText(QString text) {
 
65
void Tooltip::setText(QString text)
 
66
{
65
67
    label->setText(text);
66
68
}
67
69
 
68
 
void Tooltip::resizeEvent(QResizeEvent *event) {
 
70
void Tooltip::resizeEvent(QResizeEvent *event) 
 
71
{
69
72
    QSize size = event->size();
70
73
    QWidget::resize(size);
71
74
    setFont(QFont ( "Helvetica", qMin(size.height(),size.width()) / 3) );
72
75
    frame->resizeFrame(size);
73
76
    updateMask();
74
 
    /*
75
 
    QImage img( size, QImage::Format_Mono);
76
 
    img.fill(0);
77
 
    setMask(QBitmap::fromImage(img, Qt::MonoOnly));*/
78
77
}
79
78
 
80
79
void Tooltip::showEvent(QShowEvent * event)
95
94
    }
96
95
}
97
96
 
98
 
void Tooltip::paintEvent ( QPaintEvent * event ){
 
97
void Tooltip::paintEvent ( QPaintEvent * event )
 
98
{
99
99
    QPainter painter(this);
100
100
    painter.setRenderHint(QPainter::SmoothPixmapTransform);
101
101
    painter.setRenderHint(QPainter::Antialiasing);
103
103
    painter.fillRect(rect(), Qt::transparent);
104
104
    frame->paintFrame(&painter, event->rect());
105
105
}
106
 
 
107
 
/*bool Tooltip::paintEvent(QPaintEvent *event)
108
 
{
109
 
    if (event->type() == QEvent::Paint) {
110
 
        QPainter painter(this);
111
 
 
112
 
    }
113
 
 
114
 
    return QWidget::event(event);
115
 
}*/