mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-05 00:25:40 +08:00
ui: revert onroad round border corners (#203)
This commit is contained in:
@@ -217,10 +217,7 @@ void OnroadWindow::offroadTransition(bool offroad) {
|
||||
|
||||
void OnroadWindow::paintEvent(QPaintEvent *event) {
|
||||
QPainter p(this);
|
||||
|
||||
QPainterPath path;
|
||||
path.addRoundedRect(rect(), 40, 40);
|
||||
p.fillPath(path, QColor(bg.red(), bg.green(), bg.blue(), 255));
|
||||
p.fillRect(rect(), QColor(bg.red(), bg.green(), bg.blue(), 255));
|
||||
}
|
||||
|
||||
// ***** onroad widgets *****
|
||||
@@ -633,11 +630,7 @@ void AnnotatedCameraWidget::drawHud(QPainter &p) {
|
||||
QLinearGradient bg(0, header_h - (header_h / 2.5), 0, header_h);
|
||||
bg.setColorAt(0, QColor::fromRgbF(0, 0, 0, 0.45));
|
||||
bg.setColorAt(1, QColor::fromRgbF(0, 0, 0, 0));
|
||||
|
||||
QRect headerRect(0, 0, width(), header_h);
|
||||
QPainterPath headerPath;
|
||||
headerPath.addRoundedRect(headerRect, 30, 30);
|
||||
p.fillPath(headerPath, bg);
|
||||
p.fillRect(0, 0, width(), header_h, bg);
|
||||
|
||||
QString speedLimitStr = (speedLimit > 1) ? QString::number(std::nearbyint(speedLimit)) : "–";
|
||||
QString speedLimitStrSlc = showSpeedLimit ? QString::number(std::nearbyint(speedLimitSLC)) : "–";
|
||||
@@ -1868,17 +1861,6 @@ void AnnotatedCameraWidget::paintEvent(QPaintEvent *event) {
|
||||
CameraWidget::updateCalibration(DEFAULT_CALIBRATION);
|
||||
}
|
||||
painter.beginNativePainting();
|
||||
|
||||
// Create a QPainterPath with rounded corners
|
||||
QPainterPath path;
|
||||
int radius = 30;
|
||||
int width = CameraWidget::width();
|
||||
int height = CameraWidget::height();
|
||||
path.addRoundedRect(0, 0, width, height, radius, radius);
|
||||
|
||||
// Set the path as the clipping region for the painter
|
||||
painter.setClipPath(path);
|
||||
|
||||
CameraWidget::setFrameId(model.getFrameId());
|
||||
CameraWidget::paintGL();
|
||||
painter.endNativePainting();
|
||||
@@ -1887,8 +1869,6 @@ void AnnotatedCameraWidget::paintEvent(QPaintEvent *event) {
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
painter.setPen(Qt::NoPen);
|
||||
|
||||
setBackgroundColor(bg_colors[s->status]);
|
||||
|
||||
if (s->worldObjectsVisible()) {
|
||||
if (sm.rcv_frame("modelV2") > s->scene.started_frame) {
|
||||
update_model(s, sm["modelV2"].getModelV2(), sm["uiPlan"].getUiPlan());
|
||||
|
||||
Reference in New Issue
Block a user