Added the volume slider, and made the Skin loader a bit more robust in the face

of garbage/moved/deleted skins.
This commit is contained in:
Chris Gilbert 2006-03-15 06:28:34 +01:00 committed by Tobias Rundstrom
parent d7eede1737
commit 73e283cc48
7 changed files with 685 additions and 273 deletions

66
VolumeSlider.h Normal file
View file

@ -0,0 +1,66 @@
#ifndef __VOLUMESLIDER_H__
#define __VOLUMESLIDER_H__
#include "PixWidget.h"
#include "Button.h"
class VolumeSlider;
class MainDisplay;
class VolButton : public PixWidget
{
Q_OBJECT
public:
VolButton (QWidget *, uint, uint);
~VolButton ();
void mouseMoveEvent (QMouseEvent *);
void mousePressEvent (QMouseEvent *);
void mouseReleaseEvent (QMouseEvent *);
public slots:
void setPixmaps (Skin *skin);
private:
void changePixmap (bool pressed);
void drawPixmaps();
VolumeSlider *m_volslider;
Skin *m_skin;
QPixmap m_volbtn;
uint m_normal;
uint m_pressed;
};
class VolumeSlider : public PixWidget
{
Q_OBJECT
public:
VolumeSlider (QWidget *parent);
~VolumeSlider ();
void mouseMoveEvent (QMouseEvent *);
void mousePressEvent (QMouseEvent *);
void mouseReleaseEvent (QMouseEvent *);
uint getVolume (void) { return m_volume_base100; };
void setVolume (uint volume_base100);
public slots:
void setPixmaps (Skin *skin);
private:
void drawPixmaps ();
void updatePos (QMouseEvent *event);
void changePixmap ();
QPixmap m_volslider;
VolButton *m_volbtn;
Skin *m_skin;
int m_volume;
int m_position;
uint m_volume_base100;
bool m_hasvolbtn;
};
#endif