mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-19 14:43:30 +02:00
2023-07-10 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression in rdlogmanager(1) to caused the pie chart to fail to be drawn correctly upon first displaying the 'Edit Clock' dialog. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
16fab21457
commit
2f0b8fd7b6
@ -24285,3 +24285,7 @@
|
||||
2023-07-07 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Tweaked 'AUTHORS' to maintain the correct entry sorting
|
||||
(alphabetical by surname).
|
||||
2023-07-10 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a regression in rdlogmanager(1) to caused the pie chart to
|
||||
fail to be drawn correctly upon first displaying the 'Edit Clock'
|
||||
dialog.
|
||||
|
@ -599,59 +599,49 @@ void EditClock::UpdateClock(int line)
|
||||
p->setBrush(Qt::black);
|
||||
p->setFont(*edit_title_font);
|
||||
|
||||
if(line<0) {
|
||||
//
|
||||
// Pie Circle
|
||||
//
|
||||
p->translate(map->width()/2,map->height()/2);
|
||||
p->rotate(-90.0);
|
||||
int size_x=map->width()-2*PIE_X_MARGIN;
|
||||
int size_y=map->height()-2*PIE_X_MARGIN;
|
||||
p->drawArc(-size_x/2,-size_y/2,size_x,size_y,0,5760);
|
||||
}
|
||||
else {
|
||||
//
|
||||
// Title
|
||||
//
|
||||
p->drawText((edit_clock_label->size().width()-
|
||||
edit_title_metrics->width(edit_clocks_model->clockName()))/2,
|
||||
50,edit_clocks_model->clockName());
|
||||
//
|
||||
// Title
|
||||
//
|
||||
p->drawText((edit_clock_label->size().width()-
|
||||
edit_title_metrics->width(edit_clocks_model->clockName()))/2,
|
||||
50,edit_clocks_model->clockName());
|
||||
|
||||
//
|
||||
// Pie Circle
|
||||
//
|
||||
p->translate(edit_clock_label->size().width()/2,
|
||||
edit_clock_label->size().height()/2);
|
||||
p->rotate(-90.0);
|
||||
int size_x=edit_clock_label->size().width()-2*PIE_X_MARGIN;
|
||||
int size_y=edit_clock_label->size().width()-2*PIE_X_MARGIN;
|
||||
p->drawArc(-size_x/2,-size_y/2,size_x,size_y,0,5760);
|
||||
//
|
||||
// Pie Circle
|
||||
//
|
||||
p->translate(map->width()/2,map->height()/2);
|
||||
p->rotate(-90.0);
|
||||
int size_x=map->width()-2*PIE_X_MARGIN;
|
||||
int size_y=map->height()-2*PIE_X_MARGIN;
|
||||
p->drawArc(-size_x/2,-size_y/2,size_x,size_y,0,5760);
|
||||
|
||||
//
|
||||
// Segments
|
||||
//
|
||||
for(int i=0;i<edit_clocks_model->size();i++) {
|
||||
if(i==line) {
|
||||
p->setBrush(edit_clocks_view->palette().
|
||||
color(QPalette::Active,QPalette::Highlight));
|
||||
p->drawPie(-size_x/2,-size_y/2,size_x,size_y,
|
||||
-QTime(0,0,0).secsTo(edit_clocks_model->eventLine(line)->startTime())*5760/3600,
|
||||
-(edit_clocks_model->eventLine(line)->length()/1000)*5760/3600);
|
||||
//
|
||||
// Segments
|
||||
//
|
||||
for(int i=0;i<edit_clocks_model->size();i++) {
|
||||
if(i==line) {
|
||||
p->setBrush(edit_clocks_view->palette().
|
||||
color(QPalette::Active,QPalette::Highlight));
|
||||
p->drawPie(-size_x/2,-size_y/2,size_x,size_y,
|
||||
-QTime(0,0,0).secsTo(edit_clocks_model->eventLine(line)->
|
||||
startTime())*5760/3600,
|
||||
-(edit_clocks_model->eventLine(line)->
|
||||
length()/1000)*5760/3600);
|
||||
}
|
||||
else {
|
||||
if(edit_clocks_model->eventLine(i)->color().isValid()) {
|
||||
p->setBrush(edit_clocks_model->eventLine(i)->color());
|
||||
}
|
||||
else {
|
||||
if(edit_clocks_model->eventLine(i)->color().isValid()) {
|
||||
p->setBrush(edit_clocks_model->eventLine(i)->color());
|
||||
}
|
||||
else {
|
||||
p->setBrush(palette().color(QPalette::Active,QPalette::Base));
|
||||
}
|
||||
p->drawPie(-size_x/2,-size_y/2,size_x,size_y,
|
||||
-QTime(0,0,0).secsTo(edit_clocks_model->eventLine(i)->startTime())*5760/3600,
|
||||
-(edit_clocks_model->eventLine(i)->length()/1000)*5760/3600);
|
||||
p->setBrush(palette().color(QPalette::Active,QPalette::Base));
|
||||
}
|
||||
p->drawPie(-size_x/2,-size_y/2,size_x,size_y,
|
||||
-QTime(0,0,0).secsTo(edit_clocks_model->eventLine(i)->
|
||||
startTime())*5760/3600,
|
||||
-(edit_clocks_model->eventLine(i)->length()/1000)*5760/3600);
|
||||
}
|
||||
p->end();
|
||||
}
|
||||
p->end();
|
||||
delete p;
|
||||
edit_clock_label->setPixmap(*map);
|
||||
delete map;
|
||||
|
Loading…
x
Reference in New Issue
Block a user