diff options
Diffstat (limited to 'src/statusbarmessagelabel.cpp')
-rw-r--r-- | src/statusbarmessagelabel.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/statusbarmessagelabel.cpp b/src/statusbarmessagelabel.cpp index 8998f98..5026795 100644 --- a/src/statusbarmessagelabel.cpp +++ b/src/statusbarmessagelabel.cpp @@ -19,14 +19,14 @@ ***************************************************************************/ #include "statusbarmessagelabel.h" -#include <qpainter.h> -#include <qtimer.h> -#include <qfontmetrics.h> +#include <tqpainter.h> +#include <tqtimer.h> +#include <tqfontmetrics.h> #include <kiconloader.h> #include <kglobalsettings.h> -StatusBarMessageLabel::StatusBarMessageLabel(QWidget* parent) : - QWidget(parent), +StatusBarMessageLabel::StatusBarMessageLabel(TQWidget* tqparent) : + TQWidget(tqparent), m_type(DolphinStatusBar::Default), m_state(Default), m_illumination(0), @@ -35,9 +35,9 @@ StatusBarMessageLabel::StatusBarMessageLabel(QWidget* parent) : { setMinimumHeight(KIcon::SizeSmall); - m_timer = new QTimer(this); - connect(m_timer, SIGNAL(timeout()), - this, SLOT(timerDone())); + m_timer = new TQTimer(this); + connect(m_timer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(timerDone())); } StatusBarMessageLabel::~StatusBarMessageLabel() @@ -54,7 +54,7 @@ void StatusBarMessageLabel::setType(DolphinStatusBar::Type type) m_state = Default; const char* iconName = 0; - QPixmap pixmap; + TQPixmap pixmap; switch (type) { case DolphinStatusBar::OperationCompleted: iconName = "ok"; @@ -74,13 +74,13 @@ void StatusBarMessageLabel::setType(DolphinStatusBar::Type type) default: break; } - m_pixmap = (iconName == 0) ? QPixmap() : SmallIcon(iconName); + m_pixmap = (iconName == 0) ? TQPixmap() : SmallIcon(iconName); assureVisibleText(); update(); } } -void StatusBarMessageLabel::setText(const QString& text) +void StatusBarMessageLabel::setText(const TQString& text) { if (text != m_text) { if (m_type == DolphinStatusBar::Error) { @@ -102,21 +102,21 @@ void StatusBarMessageLabel::setMinimumTextHeight(int min) } } -void StatusBarMessageLabel::paintEvent(QPaintEvent* /* event */) +void StatusBarMessageLabel::paintEvent(TQPaintEvent* /* event */) { - QPixmap buffer(size()); - QPainter painter(&buffer); + TQPixmap buffer(size()); + TQPainter painter(&buffer); // draw background - QColor backgroundColor(colorGroup().background()); - QColor foregroundColor(KGlobalSettings::textColor()); + TQColor backgroundColor(tqcolorGroup().background()); + TQColor foregroundColor(KGlobalSettings::textColor()); if (m_illumination > 0) { - backgroundColor = mixColors(backgroundColor, QColor(255, 255, 64), m_illumination); - foregroundColor = mixColors(foregroundColor, QColor(0, 0, 0), m_illumination); + backgroundColor = mixColors(backgroundColor, TQColor(255, 255, 64), m_illumination); + foregroundColor = mixColors(foregroundColor, TQColor(0, 0, 0), m_illumination); } painter.setBrush(backgroundColor); painter.setPen(backgroundColor); - painter.drawRect(QRect(0, 0, width(), height())); + painter.drawRect(TQRect(0, 0, width(), height())); // draw pixmap int x = pixmapGap(); @@ -129,16 +129,16 @@ void StatusBarMessageLabel::paintEvent(QPaintEvent* /* event */) // draw text painter.setPen(foregroundColor); - painter.drawText(QRect(x, 0, width() - x, height()), Qt::AlignVCenter | Qt::WordBreak, m_text); + painter.drawText(TQRect(x, 0, width() - x, height()), TQt::AlignVCenter | TQt::WordBreak, m_text); painter.end(); bitBlt(this, 0, 0, &buffer); } -void StatusBarMessageLabel::resizeEvent(QResizeEvent* event) +void StatusBarMessageLabel::resizeEvent(TQResizeEvent* event) { - QWidget::resizeEvent(event); - QTimer::singleShot(0, this, SLOT(assureVisibleText())); + TQWidget::resizeEvent(event); + TQTimer::singleShot(0, this, TQT_SLOT(assureVisibleText())); } void StatusBarMessageLabel::timerDone() @@ -191,9 +191,9 @@ void StatusBarMessageLabel::assureVisibleText() int availableWidth = width() - m_pixmap.width() - pixmapGap() * 2; - QFontMetrics fontMetrics(font()); - QRect bounds(fontMetrics.boundingRect(0, 0, availableWidth, height(), - Qt::AlignVCenter | Qt::WordBreak, + TQFontMetrics fontMetrics(font()); + TQRect bounds(fontMetrics.boundingRect(0, 0, availableWidth, height(), + TQt::AlignVCenter | TQt::WordBreak, m_text)); int requiredHeight = bounds.height(); if (requiredHeight < m_minTextHeight) { @@ -203,15 +203,15 @@ void StatusBarMessageLabel::assureVisibleText() updateGeometry(); } -QColor StatusBarMessageLabel::mixColors(const QColor& c1, - const QColor& c2, +TQColor StatusBarMessageLabel::mixColors(const TQColor& c1, + const TQColor& c2, int percent) const { const int recip = 100 - percent; const int red = (c1.red() * recip + c2.red() * percent) / 100; const int green = (c1.green() * recip + c2.green() * percent) / 100; const int blue = (c1.blue() * recip + c2.blue() * percent) / 100; - return QColor(red, green, blue); + return TQColor(red, green, blue); } #include "statusbarmessagelabel.moc" |