ui: replace "Hotspot" with link icon (#35978)

replace "Hotspot" with link icon
This commit is contained in:
Jimmy
2025-08-11 16:26:07 -07:00
committed by GitHub
parent 455a6a586a
commit 13d4c6a167
3 changed files with 11 additions and 2 deletions

BIN
selfdrive/assets/icons/link.png LFS Normal file

Binary file not shown.

View File

@@ -29,6 +29,7 @@ Sidebar::Sidebar(QWidget *parent) : QFrame(parent), onroad(false), flag_pressed(
flag_img = loadPixmap("../assets/images/button_flag.png", home_btn.size());
settings_img = loadPixmap("../assets/images/button_settings.png", settings_btn.size(), Qt::IgnoreAspectRatio);
mic_img = loadPixmap("../assets/icons/microphone.png", QSize(30, 30));
link_img = loadPixmap("../assets/icons/link.png", QSize(60, 60));
connect(this, &Sidebar::valueChanged, [=] { update(); });
@@ -150,7 +151,12 @@ void Sidebar::paintEvent(QPaintEvent *event) {
p.setFont(InterFont(35));
p.setPen(QColor(0xff, 0xff, 0xff));
const QRect r = QRect(58, 247, width() - 100, 50);
p.drawText(r, Qt::AlignLeft | Qt::AlignVCenter, net_type);
if (net_type == "Hotspot") {
p.drawPixmap(r.x(), r.y() + (r.height() - link_img.height()) / 2, link_img);
} else {
p.drawText(r, Qt::AlignLeft | Qt::AlignVCenter, net_type);
}
// metrics
drawMetric(p, temp_status.first, temp_status.second, 338);

View File

@@ -37,7 +37,7 @@ protected:
void mouseReleaseEvent(QMouseEvent *event) override;
void drawMetric(QPainter &p, const QPair<QString, QString> &label, QColor c, int y);
QPixmap home_img, flag_img, settings_img, mic_img;
QPixmap home_img, flag_img, settings_img, mic_img, link_img;
bool onroad, recording_audio, flag_pressed, settings_pressed, mic_indicator_pressed;
const QMap<cereal::DeviceState::NetworkType, QString> network_type = {
{cereal::DeviceState::NetworkType::NONE, tr("--")},