Shortcuts for adding/removing plots

This commit is contained in:
Jan Käberich 2023-10-24 14:04:31 +02:00
parent 59f3057dd9
commit ccb71f9650
16 changed files with 397 additions and 71 deletions

View file

@ -380,20 +380,19 @@ void TraceSmithChart::draw(QPainter &p) {
}
}
}
if(dropPending) {
if(dropPending && supported(dropTrace)) {
// adjust coords due to shifted restore
p.setOpacity(0.5);
p.setBrush(Qt::white);
p.setPen(Qt::white);
p.drawEllipse(-polarCoordMax, -polarCoordMax, 2*polarCoordMax, 2*polarCoordMax);
p.setOpacity(dropOpacity);
p.setBrush(dropBackgroundColor);
p.setPen(dropForegroundColor);
p.drawRect(getDropRect());
auto font = p.font();
font.setPixelSize(20);
p.setFont(font);
p.setOpacity(1.0);
p.setPen(Qt::white);
p.setPen(dropSection == DropSection::OnPlot ? dropHighlightColor : dropForegroundColor);
auto text = "Drop here to add\n" + dropTrace->name() + "\nto Smith chart";
p.drawText(p.window(), Qt::AlignCenter, text);
} else {
}
}