summaryrefslogtreecommitdiffstats
path: root/noatun/modules/winskin/waJumpSlider.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commite2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch)
tree9047cf9e6b5c43878d5bf82660adae77ceee097a /noatun/modules/winskin/waJumpSlider.cpp
downloadtdemultimedia-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/waJumpSlider.cpp')
-rw-r--r--noatun/modules/winskin/waJumpSlider.cpp78
1 files changed, 78 insertions, 0 deletions
diff --git a/noatun/modules/winskin/waJumpSlider.cpp b/noatun/modules/winskin/waJumpSlider.cpp
new file mode 100644
index 00000000..51633300
--- /dev/null
+++ b/noatun/modules/winskin/waJumpSlider.cpp
@@ -0,0 +1,78 @@
+/*
+ jumpslider for winamp skins
+ Copyright (C) 1998 Martin Vogt
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation.
+
+ For more information look at the file COPYRIGHT in this package
+
+ */
+
+
+#include "waJumpSlider.h"
+
+WaJumpSlider::WaJumpSlider() : WaWidget(_WA_MAPPING_POS_BAR)
+{
+}
+
+WaJumpSlider::~WaJumpSlider()
+{
+}
+
+void WaJumpSlider::buildGui()
+{
+ ws = new WaSlider(_WA_MAPPING_POS_BAR, _WA_MAPPING_POS_BAR_SLIDER);
+ ws->setPixmapSliderButtonUp(_WA_SKIN_POS_BAR_SLIDER_NORM);
+ ws->setPixmapSliderButtonDown(_WA_SKIN_POS_BAR_SLIDER_PRES);
+ ws->setPixmapSliderBar(_WA_SKIN_POS_BAR);
+ ws->setRange(0, 100);
+ ws->setValue(0);
+
+ connect(ws, SIGNAL(sliderPressed()), this, SIGNAL(sliderPressed()));
+ connect(ws, SIGNAL(sliderReleased()), this, SLOT(releasedSlider()));
+ connect(ws, SIGNAL(valueChanged(int)), this, SIGNAL(valueChanged(int)));
+}
+
+void WaJumpSlider::setJumpRange(int val)
+{
+ if (val == -1)
+ ws->hideButton();
+ else {
+ ws->showButton();
+ ws->setRange(0, val);
+ }
+}
+
+int WaJumpSlider::jumpValue() {
+ return ws->value();
+}
+
+void WaJumpSlider::setJumpValue(int val)
+{
+ int currVal = ws->value();
+
+ if (currVal != val) {
+ ws->setValue(val);
+ }
+}
+
+void WaJumpSlider::releasedSlider() {
+ emit(jump(ws->value()));
+ emit(sliderReleased());
+}
+
+void WaJumpSlider::showEvent (QShowEvent *) {
+ ws->show();
+}
+
+void WaJumpSlider::hideEvent (QHideEvent *) {
+ ws->hide();
+}
+
+void WaJumpSlider::cancelDrag() {
+ ws->cancelDrag();
+}
+
+#include "waJumpSlider.moc"