2010-12-27 17:34:00 +01:00
|
|
|
#ifndef TRACKSLIDERPOPUP_H
|
|
|
|
#define TRACKSLIDERPOPUP_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
class TrackSliderPopup : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
TrackSliderPopup(QWidget* parent);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void SetText(const QString& text);
|
2011-02-21 21:59:30 +01:00
|
|
|
void SetSmallText(const QString& small_text);
|
2010-12-27 17:34:00 +01:00
|
|
|
void SetPopupPosition(const QPoint& pos);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent*);
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const int kTextMargin;
|
|
|
|
static const int kPointLength;
|
|
|
|
static const int kPointWidth;
|
|
|
|
static const int kBorderRadius;
|
|
|
|
static const qreal kBlurRadius;
|
|
|
|
|
|
|
|
void UpdatePixmap();
|
|
|
|
void UpdatePosition();
|
|
|
|
void SendMouseEventToParent(QMouseEvent* e);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString text_;
|
2011-02-21 21:59:30 +01:00
|
|
|
QString small_text_;
|
2010-12-27 17:34:00 +01:00
|
|
|
QPoint pos_;
|
|
|
|
|
|
|
|
QFont font_;
|
2011-02-21 21:59:30 +01:00
|
|
|
QFont small_font_;
|
2010-12-27 17:34:00 +01:00
|
|
|
QFontMetrics font_metrics_;
|
2011-02-21 21:59:30 +01:00
|
|
|
QFontMetrics small_font_metrics_;
|
2010-12-27 17:34:00 +01:00
|
|
|
QPixmap pixmap_;
|
2010-12-27 20:37:36 +01:00
|
|
|
QPixmap background_cache_;
|
2010-12-27 17:34:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TRACKSLIDERPOPUP_H
|