|
|
|
@ -28,6 +28,8 @@
|
|
|
|
|
#include "NotifyWidget.h"
|
|
|
|
|
#include "NotificationsService.h"
|
|
|
|
|
|
|
|
|
|
#define FADE_SPEED 5
|
|
|
|
|
|
|
|
|
|
NotifyWidget::NotifyWidget(TQWidget *parent, const char *name, NotificationsService *ns, TQ_INT32 id )
|
|
|
|
|
: TQLabel( parent, name, WStyle_Customize | TQt::WStyle_StaysOnTop | TQt::WStyle_NoBorder),
|
|
|
|
|
mName(TQString(name)), notificationService(ns), mId(id)
|
|
|
|
@ -35,6 +37,7 @@ NotifyWidget::NotifyWidget(TQWidget *parent, const char *name, NotificationsServ
|
|
|
|
|
// TODO Auto-generated constructor stub
|
|
|
|
|
TQDesktopWidget *d = TQApplication::desktop();
|
|
|
|
|
mPosition=TQPoint(d->width()-50, d->height()-20);
|
|
|
|
|
move(mPosition);
|
|
|
|
|
TQTimer::singleShot(100, this, TQT_SLOT(fadeAway()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -59,9 +62,9 @@ void NotifyWidget::timeout()
|
|
|
|
|
|
|
|
|
|
void NotifyWidget::fadeAway()
|
|
|
|
|
{
|
|
|
|
|
mPosition.setY(mPosition.y()-10);
|
|
|
|
|
mPosition.setY(mPosition.y()-1);
|
|
|
|
|
move(mPosition);
|
|
|
|
|
TQTimer::singleShot(10, this, TQT_SLOT(fadeAway()));
|
|
|
|
|
TQTimer::singleShot(FADE_SPEED, this, TQT_SLOT(fadeAway()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NotifyWidget::setAutoMask(bool b)
|
|
|
|
@ -97,13 +100,6 @@ void NotifyWidget::setHints(const TQMap< TQString, TQT_DBusVariant >& hints) {
|
|
|
|
|
|
|
|
|
|
void NotifyWidget::setTimeout(TQ_INT32 t) {
|
|
|
|
|
TDEApplication::kApplication()->setTopWidget(this);
|
|
|
|
|
// update(0,0,width(),height());
|
|
|
|
|
//
|
|
|
|
|
// int extraWidth = width() - minimumWidth();
|
|
|
|
|
// int extraHeight = height() - minimumHeight();
|
|
|
|
|
// setGeometry(70, 10, 50 + extraWidth, 20 + extraHeight);
|
|
|
|
|
// adjustSize();
|
|
|
|
|
|
|
|
|
|
TQTimer::singleShot(t, this, TQT_SLOT(timeout()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|