mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
Make automatic updates cancelable by the user
This commit is contained in:
@ -63,6 +63,12 @@ BusyIndicator::IndicatorStyle BusyIndicator::indicatorStyle() const
|
||||
return m_style;
|
||||
}
|
||||
|
||||
void BusyIndicator::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
emit clicked();
|
||||
}
|
||||
|
||||
QPixmap BusyIndicator::generatePixmap(int side)
|
||||
{
|
||||
QPixmap pixmap(QSize(side, side));
|
||||
|
@ -22,15 +22,17 @@ public:
|
||||
|
||||
explicit BusyIndicator(QWidget *parent = 0, int size = 30);
|
||||
|
||||
void paintEvent(QPaintEvent *);
|
||||
QSize minimumSizeHint() const;
|
||||
QSize sizeHint() const;
|
||||
void paintEvent(QPaintEvent *) override;
|
||||
QSize minimumSizeHint() const override;
|
||||
QSize sizeHint() const override;
|
||||
|
||||
void setIndicatorStyle(IndicatorStyle);
|
||||
void setColor(QColor color);
|
||||
IndicatorStyle indicatorStyle() const;
|
||||
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
|
||||
signals:
|
||||
void clicked();
|
||||
|
||||
private slots:
|
||||
void rotate();
|
||||
|
@ -71,6 +71,7 @@ YACReaderTitledToolBar::YACReaderTitledToolBar(const QString &title, QWidget *pa
|
||||
|
||||
nameLabel = new DropShadowLabel(this);
|
||||
busyIndicator = new BusyIndicator(this, 12);
|
||||
connect(busyIndicator, &BusyIndicator::clicked, this, &YACReaderTitledToolBar::cancelOperationRequested);
|
||||
busyIndicator->setIndicatorStyle(BusyIndicator::StyleArc);
|
||||
#ifdef Y_MAC_UI
|
||||
busyIndicator->setColor(QColor("#808080"));
|
||||
|
@ -34,6 +34,7 @@ public:
|
||||
explicit YACReaderTitledToolBar(const QString &title, QWidget *parent = 0);
|
||||
|
||||
signals:
|
||||
void cancelOperationRequested();
|
||||
|
||||
public slots:
|
||||
void addAction(QAction *action);
|
||||
|
Reference in New Issue
Block a user