This commit is contained in:
Your Name
2024-02-14 01:59:13 -06:00
parent f2559a0f93
commit 483f5c0297
3 changed files with 42 additions and 15 deletions

View File

@@ -29,20 +29,20 @@ static void drawIcon(QPainter &p, const QPoint &center, const QPixmap &img, cons
p.setOpacity(1.0);
}
static void drawIconRotate(QPainter &p, const QPoint &center, const QPixmap &img, const QBrush &bg, float opacity, const int angle) {
p.setRenderHint(QPainter::Antialiasing);
p.setOpacity(1.0); // bg dictates opacity of ellipse
p.setPen(Qt::NoPen);
p.setBrush(bg);
p.drawEllipse(center, btn_size / 2, btn_size / 2);
p.save();
p.translate(center);
p.rotate(-angle);
p.setOpacity(opacity);
p.drawPixmap(-QPoint(img.width() / 2, img.height() / 2), img);
p.setOpacity(1.0);
p.restore();
}
// static void drawIconRotate(QPainter &p, const QPoint &center, const QPixmap &img, const QBrush &bg, float opacity, const int angle) {
// p.setRenderHint(QPainter::Antialiasing);
// p.setOpacity(1.0); // bg dictates opacity of ellipse
// p.setPen(Qt::NoPen);
// p.setBrush(bg);
// p.drawEllipse(center, btn_size / 2, btn_size / 2);
// p.save();
// p.translate(center);
// p.rotate(-angle);
// p.setOpacity(opacity);
// p.drawPixmap(-QPoint(img.width() / 2, img.height() / 2), img);
// p.setOpacity(1.0);
// p.restore();
// }
OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent), scene(uiState()->scene) {
QVBoxLayout *main_layout = new QVBoxLayout(this);