mirror of
				https://github.com/YACReader/yacreader
				synced 2025-11-03 16:54:39 -05:00 
			
		
		
		
	Make BusyIndicator size configurable
This commit is contained in:
		@ -23,10 +23,11 @@ void YACReaderBusyWidget::paintEvent(QPaintEvent *event)
 | 
			
		||||
    painter.drawPixmap(0, 0, width(), height(), QPixmap(":/images/busy_background.png"));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
BusyIndicator::BusyIndicator(QWidget *parent)
 | 
			
		||||
BusyIndicator::BusyIndicator(QWidget *parent, int size)
 | 
			
		||||
    : QWidget(parent),
 | 
			
		||||
      startAngle(0),
 | 
			
		||||
      m_style(StyleArc)
 | 
			
		||||
      m_style(StyleArc),
 | 
			
		||||
      size(size)
 | 
			
		||||
{
 | 
			
		||||
    QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Fixed);
 | 
			
		||||
    policy.setHeightForWidth(true);
 | 
			
		||||
@ -177,10 +178,10 @@ void BusyIndicator::paintEvent(QPaintEvent *)
 | 
			
		||||
 | 
			
		||||
QSize BusyIndicator::minimumSizeHint() const
 | 
			
		||||
{
 | 
			
		||||
    return QSize(30, 30);
 | 
			
		||||
    return QSize(size, size);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QSize BusyIndicator::sizeHint() const
 | 
			
		||||
{
 | 
			
		||||
    return QSize(30, 30);
 | 
			
		||||
    return QSize(size, size);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -20,7 +20,7 @@ public:
 | 
			
		||||
                          StyleEllipse,
 | 
			
		||||
                          StyleArc };
 | 
			
		||||
 | 
			
		||||
    explicit BusyIndicator(QWidget *parent = 0);
 | 
			
		||||
    explicit BusyIndicator(QWidget *parent = 0, int size = 30);
 | 
			
		||||
 | 
			
		||||
    void paintEvent(QPaintEvent *);
 | 
			
		||||
    QSize minimumSizeHint() const;
 | 
			
		||||
@ -47,6 +47,7 @@ private:
 | 
			
		||||
    IndicatorStyle m_style;
 | 
			
		||||
 | 
			
		||||
    QColor fillColor;
 | 
			
		||||
    int size;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // BUSYINDICATOR_H
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user