mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
added a border to selected/mouseHover elements in the grid view
This commit is contained in:
50
custom_widgets/yacreader_busy_widget.h
Normal file
50
custom_widgets/yacreader_busy_widget.h
Normal file
@ -0,0 +1,50 @@
|
||||
#ifndef YACREADER_BUSYINDICATOR_H
|
||||
#define YACREADER_BUSYINDICATOR_H
|
||||
|
||||
#include <QTimer>
|
||||
#include <QWidget>
|
||||
|
||||
class YACReaderBusyWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit YACReaderBusyWidget(QWidget *parent = 0);
|
||||
void paintEvent(QPaintEvent *);
|
||||
};
|
||||
|
||||
class BusyIndicator : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum IndicatorStyle{StyleRect, StyleEllipse, StyleArc};
|
||||
|
||||
explicit BusyIndicator(QWidget *parent = 0);
|
||||
|
||||
void paintEvent(QPaintEvent *);
|
||||
QSize minimumSizeHint() const;
|
||||
QSize sizeHint() const;
|
||||
|
||||
void setIndicatorStyle(IndicatorStyle);
|
||||
void setColor(QColor color);
|
||||
const IndicatorStyle indicatorStyle() const;
|
||||
|
||||
signals:
|
||||
|
||||
private slots:
|
||||
void rotate();
|
||||
|
||||
private:
|
||||
QPixmap generatePixmap(int sideLength);
|
||||
void drawRectStyle(QPainter *painter);
|
||||
void drawEllipseStyle(QPainter *painter);
|
||||
void drawArcStyle(QPainter *painter);
|
||||
|
||||
QTimer timer;
|
||||
int startAngle;
|
||||
|
||||
IndicatorStyle m_style;
|
||||
|
||||
QColor fillColor;
|
||||
};
|
||||
|
||||
#endif // BUSYINDICATOR_H
|
Reference in New Issue
Block a user