diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | e2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch) | |
tree | 9047cf9e6b5c43878d5bf82660adae77ceee097a /noatun/modules/winskin/waWidget.cpp | |
download | tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'noatun/modules/winskin/waWidget.cpp')
-rw-r--r-- | noatun/modules/winskin/waWidget.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/noatun/modules/winskin/waWidget.cpp b/noatun/modules/winskin/waWidget.cpp new file mode 100644 index 00000000..ffe2d3b4 --- /dev/null +++ b/noatun/modules/winskin/waWidget.cpp @@ -0,0 +1,58 @@ +#include "waWidget.h" +#include "waSkinModel.h" +#include "noatun/stdaction.h" +#include "waSkin.h" + +WaWidget::WaWidget(int _mapping) : QWidget(WaSkin::instance()) { + mapping = _mapping; + setBackgroundMode(NoBackground); + connect (WaSkinModel::instance(), SIGNAL(skinChanged()), this, SLOT(skinChanged())); +} + +WaWidget::~WaWidget() { +} + +void WaWidget::paintPixmap(int pixmap_mapping) { + if (pixmap_mapping != -1) + WaSkinModel::instance()->bltTo(pixmap_mapping, this, 0, 0); + else + WaSkinModel::instance()->paintBackgroundTo(mapping, this, 0, 0); +} + +void WaWidget::paintPixmap(int pixmap_mapping, int x, int y) { + if (pixmap_mapping != -1) + WaSkinModel::instance()->bltTo(pixmap_mapping, this, x, y); + else + WaSkinModel::instance()->paintBackgroundTo(mapping, this, x, y); +} + +void WaWidget::paintPixmap(int pixmap_mapping, int argument) { + if (pixmap_mapping != -1) + WaSkinModel::instance()->bltTo(pixmap_mapping, this, 0, 0, argument); + else + WaSkinModel::instance()->paintBackgroundTo(mapping, this, 0, 0); + +} + +void WaWidget::paintPixmap(int pixmap_mapping, int argument, int x, int y) { + if (pixmap_mapping != -1) + WaSkinModel::instance()->bltTo(pixmap_mapping, this, x, y, argument); + else + WaSkinModel::instance()->paintBackgroundTo(mapping, this, x, y); +} + +QSize WaWidget::sizeHint() { + return WaSkinModel::instance()->getMapGeometry(mapping).size(); +} + +void WaWidget::mousePressEvent(QMouseEvent *e) { + if (e->button() == RightButton) + NoatunStdAction::ContextMenu::showContextMenu(); +} + +void WaWidget::skinChanged() { + setGeometry(WaSkinModel::instance()->getMapGeometry(mapping)); + update(); +} + +#include <waWidget.moc> |