mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-05 08:16:06 +08:00
Sidebar: set Qt::WA_OpaquePaintEvent attribute (#21782)
old-commit-hash: 8f7fc61e48
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <QMouseEvent>
|
||||
|
||||
#include "selfdrive/ui/qt/qt_window.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
#include "selfdrive/hardware/hw.h"
|
||||
#include "selfdrive/ui/qt/util.h"
|
||||
@@ -41,9 +40,9 @@ Sidebar::Sidebar(QWidget *parent) : QFrame(parent) {
|
||||
|
||||
connect(this, &Sidebar::valueChanged, [=] { update(); });
|
||||
|
||||
setAttribute(Qt::WA_OpaquePaintEvent);
|
||||
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
|
||||
setFixedWidth(300);
|
||||
setMinimumHeight(vwp_h);
|
||||
setStyleSheet("background-color: rgb(57, 57, 57);");
|
||||
}
|
||||
|
||||
void Sidebar::mouseReleaseEvent(QMouseEvent *event) {
|
||||
@@ -103,6 +102,8 @@ void Sidebar::paintEvent(QPaintEvent *event) {
|
||||
p.setPen(Qt::NoPen);
|
||||
p.setRenderHint(QPainter::Antialiasing);
|
||||
|
||||
p.fillRect(rect(), QColor(57, 57, 57));
|
||||
|
||||
// static imgs
|
||||
p.setOpacity(0.65);
|
||||
p.drawImage(settings_btn.x(), settings_btn.y(), settings_img);
|
||||
|
||||
Reference in New Issue
Block a user