Fixed regression with pie widget in rdairplay(1)

This commit is contained in:
Patrick Linstruth 2018-11-01 15:04:34 -07:00
parent f9e0e152ba
commit 149531ea69
3 changed files with 7 additions and 8 deletions

View File

@ -69,6 +69,7 @@
#define PIE_FINAL_COLOR Qt::black
#define PIE_FINAL_BG_COLOR Qt::white
#define PIE_ONAIR_COLOR Qt::red
#define PIE_ONAIR_OFF_COLOR Qt::gray
//
// Widget Colors

View File

@ -61,7 +61,6 @@ PieCounter::PieCounter(int count_length,QWidget *parent)
pie_talk_label->setFont(font);
pie_talk_label->setAlignment(Qt::AlignCenter);
pie_talk_label->hide();
onair_off_color=backgroundColor();
pie_logline=NULL;
resetTime();
@ -188,12 +187,12 @@ void PieCounter::setOnairFlag(bool state)
pie_talk_label->setBackgroundColor(PIE_ONAIR_COLOR);
}
else {
setBackgroundColor(onair_off_color);
setBackgroundColor(PIE_ONAIR_OFF_COLOR);
if(!pie_pixmap.isNull()) {
QWidget::setErasePixmap(pie_pixmap);
}
pie_time_label->setBackgroundColor(onair_off_color);
pie_talk_label->setBackgroundColor(onair_off_color);
pie_time_label->setBackgroundColor(PIE_ONAIR_OFF_COLOR);
pie_talk_label->setBackgroundColor(PIE_ONAIR_OFF_COLOR);
}
pie_onair=state;
}
@ -255,7 +254,7 @@ void PieCounter::paintEvent(QPaintEvent *e)
ring_angle = 0;
if(pie_onair||pie_pixmap.isNull()) {
p->fillRect(0,0,PIE_COUNTER_BBOX,PIE_COUNTER_BBOX,backgroundColor());
p->fillRect(0,0,PIE_COUNTER_BBOX,PIE_COUNTER_BBOX,PIE_ONAIR_OFF_COLOR);
}
else {
p->drawPixmap(-PIE_X_PADDING,-PIE_Y_PADDING,pie_pixmap);
@ -299,8 +298,8 @@ void PieCounter::paintEvent(QPaintEvent *e)
if(((pie_time<pie_count_length)&&(pie_time>0))||
((((750+pie_talk_end-pie_pos)/1000)<100)&&
((pie_pos>=pie_talk_start)&&(pie_pos<=pie_talk_end)))) {
p->setBrush(backgroundColor());
p->setPen(backgroundColor());
p->setBrush(PIE_ONAIR_OFF_COLOR);
p->setPen(PIE_ONAIR_OFF_COLOR);
p->drawPie(ring+20,ring+20,PIE_COUNTER_SIZE-40,PIE_COUNTER_SIZE-40,0,5760);
}
}

View File

@ -90,7 +90,6 @@ class PieCounter : public QWidget
RDAirPlayConf::OpMode pie_op_mode;
RDLogLine::TransType pie_trans_type;
int air_line;
QColor onair_off_color;
RDLogLine *pie_logline;
QPixmap pie_pixmap;
bool pie_onair;