rewrote Button and ToggleButton to use the new PixmapButton as baseclass.
This commit is contained in:
parent
e2fdb4e009
commit
efa16e9236
15 changed files with 115 additions and 146 deletions
34
src/Button.h
34
src/Button.h
|
@ -16,9 +16,11 @@
|
|||
#ifndef __BUTTON_H__
|
||||
#define __BUTTON_H__
|
||||
|
||||
#include "PixWidget.h"
|
||||
#include "pixmapbutton.h"
|
||||
|
||||
class Button : public PixWidget
|
||||
class Skin;
|
||||
|
||||
class Button : public PixmapButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
@ -29,54 +31,28 @@ class Button : public PixWidget
|
|||
public slots:
|
||||
void setPixmaps (Skin *skin);
|
||||
|
||||
signals:
|
||||
void clicked (void);
|
||||
|
||||
protected:
|
||||
void mousePressEvent (QMouseEvent *event);
|
||||
void mouseReleaseEvent (QMouseEvent *event);
|
||||
void mouseMoveEvent (QMouseEvent *event) {}
|
||||
|
||||
uint m_name_normal;
|
||||
uint m_name_pressed;
|
||||
|
||||
uint m_diffx;
|
||||
uint m_diffy;
|
||||
|
||||
QPixmap m_pixmap_normal;
|
||||
QPixmap m_pixmap_pressed;
|
||||
|
||||
bool m_nodrag;
|
||||
bool m_pls;
|
||||
};
|
||||
|
||||
class ToggleButton : public Button
|
||||
class ToggleButton : public PixmapButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ToggleButton (QWidget *parent, uint, uint, uint, uint);
|
||||
~ToggleButton ();
|
||||
|
||||
bool getOn () const { return m_toggled_on; }
|
||||
|
||||
public slots:
|
||||
void setPixmaps(Skin *skin);
|
||||
void toggleOn ();
|
||||
|
||||
private:
|
||||
uint m_name_on_normal;
|
||||
uint m_name_on_pressed;
|
||||
uint m_name_off_normal;
|
||||
uint m_name_off_pressed;
|
||||
|
||||
QPixmap m_pixmap_on_normal;
|
||||
QPixmap m_pixmap_on_pressed;
|
||||
QPixmap m_pixmap_off_normal;
|
||||
QPixmap m_pixmap_off_pressed;
|
||||
|
||||
bool m_toggled_on;
|
||||
|
||||
void setCurrentPix ();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue