mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-05 00:05:59 +08:00
@@ -504,7 +504,7 @@ SignalView::SignalView(ChartsWidget *charts, QWidget *parent) : charts(charts),
|
||||
QObject::connect(can, &AbstractStream::msgsReceived, this, &SignalView::updateState);
|
||||
QObject::connect(tree->header(), &QHeaderView::sectionResized, [this](int logicalIndex, int oldSize, int newSize) {
|
||||
if (logicalIndex == 1) {
|
||||
value_column_width = newSize - delegate->button_size.width();
|
||||
value_column_width = newSize;
|
||||
updateState();
|
||||
}
|
||||
});
|
||||
@@ -645,8 +645,9 @@ void SignalView::updateState(const QHash<MessageId, CanData> *msgs) {
|
||||
}
|
||||
|
||||
const static int min_max_width = QFontMetrics(delegate->minmax_font).width("-000.00") + 5;
|
||||
int value_width = std::min<int>(max_value_width + min_max_width, value_column_width / 2);
|
||||
QSize size(value_column_width - value_width,
|
||||
int available_width = value_column_width - delegate->button_size.width();
|
||||
int value_width = std::min<int>(max_value_width + min_max_width, available_width / 2);
|
||||
QSize size(available_width - value_width,
|
||||
delegate->button_size.height() - style()->pixelMetric(QStyle::PM_FocusFrameVMargin) * 2);
|
||||
QFutureSynchronizer<void> synchronizer;
|
||||
for (int i = first_visible_row; i <= last_visible_row; ++i) {
|
||||
|
||||
@@ -140,7 +140,7 @@ QWidget *VideoWidget::createCameraWidget() {
|
||||
stacked->addWidget(alert_label = new InfoLabel(this));
|
||||
l->addLayout(stacked);
|
||||
|
||||
l->addWidget(slider = new Slider(this));
|
||||
l->addWidget(slider = new Slider(w));
|
||||
slider->setSingleStep(0);
|
||||
|
||||
setMaximumTime(can->totalSeconds());
|
||||
@@ -293,9 +293,9 @@ void Slider::mouseMoveEvent(QMouseEvent *e) {
|
||||
double seconds = (minimum() + pos * ((maximum() - minimum()) / (double)width())) / factor;
|
||||
QPixmap thumb = thumbnail(seconds);
|
||||
if (!thumb.isNull()) {
|
||||
int x = std::clamp(pos - thumb.width() / 2, THUMBNAIL_MARGIN, rect().right() - thumb.width() - THUMBNAIL_MARGIN);
|
||||
int y = -thumb.height();
|
||||
thumbnail_label.showPixmap(mapToParent({x, y}), utils::formatSeconds(seconds), thumb, alertInfo(seconds));
|
||||
int x = std::clamp(pos - thumb.width() / 2, THUMBNAIL_MARGIN, width() - thumb.width() - THUMBNAIL_MARGIN + 1);
|
||||
int y = -thumb.height() - THUMBNAIL_MARGIN - 6;
|
||||
thumbnail_label.showPixmap(mapToParent(QPoint(x, y)), utils::formatSeconds(seconds), thumb, alertInfo(seconds));
|
||||
} else {
|
||||
thumbnail_label.hide();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user