File: kvlcslider.cpp

package info (click to toggle)
vlc 0.2.92-8
  • links: PTS
  • area: main
  • in suites: woody
  • size: 7,076 kB
  • ctags: 7,147
  • sloc: ansic: 62,829; cpp: 5,824; sh: 2,469; xml: 2,351; makefile: 1,291; python: 503; perl: 19
file content (52 lines) | stat: -rw-r--r-- 1,459 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/***************************************************************************
                          kinterfacemain.cpp  -  description
                             -------------------
    begin                : Sun Mar 25 2001
    copyright            : (C) 2001 by andres
    email                : dae@chez.com
 ***************************************************************************/
/***************************************************************************
	shamelessly copied from noatun's excellent interface
****************************************************************************/

#include "kvlcslider.h"

KVLCSlider::KVLCSlider(QWidget * parent, const char * name) :
	QSlider(parent,name), pressed(false)
{
}

KVLCSlider::KVLCSlider(Orientation o, QWidget * parent, const char * name) :
	QSlider(o,parent,name), pressed(false)
{
}

KVLCSlider::KVLCSlider(int minValue, int maxValue, int pageStep, int value,
	                   Orientation o, QWidget * parent, const char * name) :
	QSlider(minValue, maxValue, pageStep, value, o, parent,name), pressed(false)
{
}

void KVLCSlider::setValue(int i)
{
	if ( !pressed )
	{
		QSlider::setValue( i );
	}
}

void KVLCSlider::mousePressEvent( QMouseEvent *e )
{
	if ( e->button() != RightButton )
	{
		pressed=true;
		QSlider::mousePressEvent( e );
	}
}

void KVLCSlider::mouseReleaseEvent( QMouseEvent *e )
{
	pressed=false;
	QSlider::mouseReleaseEvent( e );
	emit userChanged( value() );
}