cabana: fix text-overflow for long msg name (#27297)

This commit is contained in:
Dean Lee 2023-02-11 06:50:52 +08:00 committed by GitHub
parent 3d2c156bbd
commit 0fdcf4efc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -32,7 +32,8 @@ DetailWidget::DetailWidget(ChartsWidget *charts, QWidget *parent) : charts(chart
time_label = new QLabel(this);
time_label->setStyleSheet("font-weight:bold");
toolbar->addWidget(time_label);
name_label = new QLabel(this);
name_label = new ElidedLabel(this);
name_label->setContentsMargins(5, 0, 5, 0);
name_label->setStyleSheet("font-weight:bold;");
name_label->setAlignment(Qt::AlignCenter);
name_label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);

View File

@ -5,6 +5,7 @@
#include <QTabWidget>
#include <QToolBar>
#include "selfdrive/ui/qt/widgets/controls.h"
#include "tools/cabana/binaryview.h"
#include "tools/cabana/chartswidget.h"
#include "tools/cabana/historylog.h"
@ -40,7 +41,8 @@ private:
void updateState(const QHash<QString, CanData> * msgs = nullptr);
QString msg_id;
QLabel *name_label, *time_label, *warning_icon, *warning_label;
QLabel *time_label, *warning_icon, *warning_label;
ElidedLabel *name_label;
QWidget *warning_widget;
QTabBar *tabbar;
QTabWidget *tab_widget;