mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
c5e7a025e4
Added option to edit the selected dive. Now the user can click on 'Edit', and a nice box will appear stating that the dive is in edit mode, and the user can edit all of the 'Notes' tab fields, including the rating. When the edition is finished, the user needs to click on 'edit' again to mark as accepted, or in reset to reset the fields to it's original state Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
39 lines
774 B
C++
39 lines
774 B
C++
#ifndef STARWIDGET_H
|
|
#define STARWIDGET_H
|
|
|
|
#include <QWidget>
|
|
|
|
enum StarConfig {SPACING = 2, IMG_SIZE = 16, TOTALSTARS = 5};
|
|
|
|
class StarWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit StarWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
|
int currentStars() const;
|
|
|
|
/*reimp*/ QSize sizeHint() const;
|
|
|
|
static QPixmap starActive();
|
|
static QPixmap starInactive();
|
|
|
|
Q_SIGNALS:
|
|
void valueChanged(int stars);
|
|
|
|
public Q_SLOTS:
|
|
void setCurrentStars(int value);
|
|
void setReadOnly( bool readOnly);
|
|
|
|
protected:
|
|
/*reimp*/ void mouseReleaseEvent(QMouseEvent* );
|
|
/*reimp*/ void paintEvent(QPaintEvent* );
|
|
|
|
private:
|
|
int current;
|
|
static QPixmap* activeStar;
|
|
static QPixmap* inactiveStar;
|
|
QPixmap grayImage(QPixmap *coloredImg);
|
|
bool readOnly;
|
|
};
|
|
|
|
#endif // STARWIDGET_H
|