From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- noatun/modules/winskin/waJumpSlider.cpp | 78 +++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 noatun/modules/winskin/waJumpSlider.cpp (limited to 'noatun/modules/winskin/waJumpSlider.cpp') 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" -- cgit v1.2.1