cleanup selfdrive/assets (#35241)

* remove unused assets

* these are icons

* these are images

* fix

* fix

* Revert "remove unused assets"

This reverts commit 95d1a800de.

* move these too
pull/35242/head
Cameron Clough 7 days ago committed by GitHub
parent 60113632b4
commit ec208f2d3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 24
      selfdrive/assets/assets.qrc
  2. 0
      selfdrive/assets/icons/calibration.png
  3. 0
      selfdrive/assets/icons/checkmark.svg
  4. 0
      selfdrive/assets/icons/chevron_right.png
  5. 0
      selfdrive/assets/icons/chffr_wheel.png
  6. 0
      selfdrive/assets/icons/circled_check.svg
  7. 0
      selfdrive/assets/icons/circled_slash.svg
  8. 0
      selfdrive/assets/icons/close2.svg
  9. 0
      selfdrive/assets/icons/couch.svg
  10. 0
      selfdrive/assets/icons/disengage_on_accelerator.svg
  11. 0
      selfdrive/assets/icons/driver_face.png
  12. 0
      selfdrive/assets/icons/experimental.svg
  13. 0
      selfdrive/assets/icons/experimental_grey.svg
  14. 0
      selfdrive/assets/icons/experimental_white.svg
  15. 0
      selfdrive/assets/icons/eye_closed.svg
  16. 0
      selfdrive/assets/icons/eye_open.svg
  17. 0
      selfdrive/assets/icons/lock_closed.svg
  18. 0
      selfdrive/assets/icons/menu.png
  19. 0
      selfdrive/assets/icons/metric.png
  20. 0
      selfdrive/assets/icons/minus.png
  21. 0
      selfdrive/assets/icons/monitoring.png
  22. 0
      selfdrive/assets/icons/network.png
  23. 0
      selfdrive/assets/icons/road.png
  24. 0
      selfdrive/assets/icons/settings.png
  25. 0
      selfdrive/assets/icons/shell.png
  26. 0
      selfdrive/assets/icons/speed_limit.png
  27. 0
      selfdrive/assets/icons/triangle.svg
  28. 0
      selfdrive/assets/icons/warning.png
  29. 0
      selfdrive/assets/icons/wifi_strength_full.svg
  30. 0
      selfdrive/assets/icons/wifi_strength_high.svg
  31. 0
      selfdrive/assets/icons/wifi_strength_low.svg
  32. 0
      selfdrive/assets/icons/wifi_strength_medium.svg
  33. 0
      selfdrive/assets/icons/wifi_uploading.svg
  34. 0
      selfdrive/assets/images/button_continue_triangle.svg
  35. 0
      selfdrive/assets/images/spinner_comma.png
  36. 0
      selfdrive/assets/images/spinner_track.png
  37. 8
      selfdrive/ui/qt/network/networking.cc
  38. 4
      selfdrive/ui/qt/offroad/experimental_mode.cc
  39. 18
      selfdrive/ui/qt/offroad/settings.cc
  40. 4
      selfdrive/ui/qt/onroad/buttons.cc
  41. 2
      selfdrive/ui/qt/onroad/driver_monitoring.cc
  42. 6
      selfdrive/ui/qt/setup/setup.cc
  43. 4
      selfdrive/ui/qt/widgets/input.cc
  44. 4
      system/ui/spinner.py

@ -1,19 +1,19 @@
<!DOCTYPE RCC><RCC version="1.0"> <!DOCTYPE RCC><RCC version="1.0">
<qresource> <qresource>
<file alias="bootstrap-icons.svg">../../third_party/bootstrap/bootstrap-icons.svg</file> <file alias="bootstrap-icons.svg">../../third_party/bootstrap/bootstrap-icons.svg</file>
<file>img_continue_triangle.svg</file> <file>images/button_continue_triangle.svg</file>
<file>img_circled_check.svg</file> <file>icons/circled_check.svg</file>
<file>img_circled_slash.svg</file> <file>icons/circled_slash.svg</file>
<file>img_eye_open.svg</file> <file>icons/eye_open.svg</file>
<file>img_eye_closed.svg</file> <file>icons/eye_closed.svg</file>
<file>icons/close.svg</file> <file>icons/close.svg</file>
<file>offroad/icon_lock_closed.svg</file> <file>icons/lock_closed.svg</file>
<file>offroad/icon_checkmark.svg</file> <file>icons/checkmark.svg</file>
<file>offroad/icon_warning.png</file> <file>icons/warning.png</file>
<file>offroad/icon_wifi_strength_low.svg</file> <file>icons/wifi_strength_low.svg</file>
<file>offroad/icon_wifi_strength_medium.svg</file> <file>icons/wifi_strength_medium.svg</file>
<file>offroad/icon_wifi_strength_high.svg</file> <file>icons/wifi_strength_high.svg</file>
<file>offroad/icon_wifi_strength_full.svg</file> <file>icons/wifi_strength_full.svg</file>
<file alias="languages.json">../ui/translations/languages.json</file> <file alias="languages.json">../ui/translations/languages.json</file>
</qresource> </qresource>

@ -234,12 +234,12 @@ WifiUI::WifiUI(QWidget *parent, WifiManager* wifi) : QWidget(parent), wifi(wifi)
// load imgs // load imgs
for (const auto &s : {"low", "medium", "high", "full"}) { for (const auto &s : {"low", "medium", "high", "full"}) {
QPixmap pix(ASSET_PATH + "/offroad/icon_wifi_strength_" + s + ".svg"); QPixmap pix(ASSET_PATH + "/icons/wifi_strength_" + s + ".svg");
strengths.push_back(pix.scaledToHeight(68, Qt::SmoothTransformation)); strengths.push_back(pix.scaledToHeight(68, Qt::SmoothTransformation));
} }
lock = QPixmap(ASSET_PATH + "offroad/icon_lock_closed.svg").scaledToWidth(ICON_WIDTH, Qt::SmoothTransformation); lock = QPixmap(ASSET_PATH + "icons/lock_closed.svg").scaledToWidth(ICON_WIDTH, Qt::SmoothTransformation);
checkmark = QPixmap(ASSET_PATH + "offroad/icon_checkmark.svg").scaledToWidth(ICON_WIDTH, Qt::SmoothTransformation); checkmark = QPixmap(ASSET_PATH + "icons/checkmark.svg").scaledToWidth(ICON_WIDTH, Qt::SmoothTransformation);
circled_slash = QPixmap(ASSET_PATH + "img_circled_slash.svg").scaledToWidth(ICON_WIDTH, Qt::SmoothTransformation); circled_slash = QPixmap(ASSET_PATH + "icons/circled_slash.svg").scaledToWidth(ICON_WIDTH, Qt::SmoothTransformation);
scanningLabel = new QLabel(tr("Scanning for networks...")); scanningLabel = new QLabel(tr("Scanning for networks..."));
scanningLabel->setStyleSheet("font-size: 65px;"); scanningLabel->setStyleSheet("font-size: 65px;");

@ -9,8 +9,8 @@
#include "selfdrive/ui/ui.h" #include "selfdrive/ui/ui.h"
ExperimentalModeButton::ExperimentalModeButton(QWidget *parent) : QPushButton(parent) { ExperimentalModeButton::ExperimentalModeButton(QWidget *parent) : QPushButton(parent) {
chill_pixmap = QPixmap("../assets/img_couch.svg").scaledToWidth(img_width, Qt::SmoothTransformation); chill_pixmap = QPixmap("../assets/icons/couch.svg").scaledToWidth(img_width, Qt::SmoothTransformation);
experimental_pixmap = QPixmap("../assets/img_experimental_grey.svg").scaledToWidth(img_width, Qt::SmoothTransformation); experimental_pixmap = QPixmap("../assets/icons/experimental_grey.svg").scaledToWidth(img_width, Qt::SmoothTransformation);
// go to toggles and expand experimental mode description // go to toggles and expand experimental mode description
connect(this, &QPushButton::clicked, [=]() { emit openSettings(2, "ExperimentalMode"); }); connect(this, &QPushButton::clicked, [=]() { emit openSettings(2, "ExperimentalMode"); });

@ -23,43 +23,43 @@ TogglesPanel::TogglesPanel(SettingsWindow *parent) : ListWidget(parent) {
"OpenpilotEnabledToggle", "OpenpilotEnabledToggle",
tr("Enable openpilot"), tr("Enable openpilot"),
tr("Use the openpilot system for adaptive cruise control and lane keep driver assistance. Your attention is required at all times to use this feature. Changing this setting takes effect when the car is powered off."), tr("Use the openpilot system for adaptive cruise control and lane keep driver assistance. Your attention is required at all times to use this feature. Changing this setting takes effect when the car is powered off."),
"../assets/img_chffr_wheel.png", "../assets/icons/chffr_wheel.png",
}, },
{ {
"ExperimentalMode", "ExperimentalMode",
tr("Experimental Mode"), tr("Experimental Mode"),
"", "",
"../assets/img_experimental_white.svg", "../assets/icons/experimental_white.svg",
}, },
{ {
"DisengageOnAccelerator", "DisengageOnAccelerator",
tr("Disengage on Accelerator Pedal"), tr("Disengage on Accelerator Pedal"),
tr("When enabled, pressing the accelerator pedal will disengage openpilot."), tr("When enabled, pressing the accelerator pedal will disengage openpilot."),
"../assets/offroad/icon_disengage_on_accelerator.svg", "../assets/icons/disengage_on_accelerator.svg",
}, },
{ {
"IsLdwEnabled", "IsLdwEnabled",
tr("Enable Lane Departure Warnings"), tr("Enable Lane Departure Warnings"),
tr("Receive alerts to steer back into the lane when your vehicle drifts over a detected lane line without a turn signal activated while driving over 31 mph (50 km/h)."), tr("Receive alerts to steer back into the lane when your vehicle drifts over a detected lane line without a turn signal activated while driving over 31 mph (50 km/h)."),
"../assets/offroad/icon_warning.png", "../assets/icons/warning.png",
}, },
{ {
"AlwaysOnDM", "AlwaysOnDM",
tr("Always-On Driver Monitoring"), tr("Always-On Driver Monitoring"),
tr("Enable driver monitoring even when openpilot is not engaged."), tr("Enable driver monitoring even when openpilot is not engaged."),
"../assets/offroad/icon_monitoring.png", "../assets/icons/monitoring.png",
}, },
{ {
"RecordFront", "RecordFront",
tr("Record and Upload Driver Camera"), tr("Record and Upload Driver Camera"),
tr("Upload data from the driver facing camera and help improve the driver monitoring algorithm."), tr("Upload data from the driver facing camera and help improve the driver monitoring algorithm."),
"../assets/offroad/icon_monitoring.png", "../assets/icons/monitoring.png",
}, },
{ {
"IsMetric", "IsMetric",
tr("Use Metric System"), tr("Use Metric System"),
tr("Display speed in km/h instead of mph."), tr("Display speed in km/h instead of mph."),
"../assets/offroad/icon_metric.png", "../assets/icons/metric.png",
}, },
}; };
@ -69,7 +69,7 @@ TogglesPanel::TogglesPanel(SettingsWindow *parent) : ListWidget(parent) {
tr("Standard is recommended. In aggressive mode, openpilot will follow lead cars closer and be more aggressive with the gas and brake. " tr("Standard is recommended. In aggressive mode, openpilot will follow lead cars closer and be more aggressive with the gas and brake. "
"In relaxed mode openpilot will stay further away from lead cars. On supported cars, you can cycle through these personalities with " "In relaxed mode openpilot will stay further away from lead cars. On supported cars, you can cycle through these personalities with "
"your steering wheel distance button."), "your steering wheel distance button."),
"../assets/offroad/icon_speed_limit.png", "../assets/icons/speed_limit.png",
longi_button_texts); longi_button_texts);
// set up uiState update for personality setting // set up uiState update for personality setting
@ -91,7 +91,7 @@ TogglesPanel::TogglesPanel(SettingsWindow *parent) : ListWidget(parent) {
} }
// Toggles with confirmation dialogs // Toggles with confirmation dialogs
toggles["ExperimentalMode"]->setActiveIcon("../assets/img_experimental.svg"); toggles["ExperimentalMode"]->setActiveIcon("../assets/icons/experimental.svg");
toggles["ExperimentalMode"]->setConfirmation(true, true); toggles["ExperimentalMode"]->setConfirmation(true, true);
} }

@ -19,8 +19,8 @@ void drawIcon(QPainter &p, const QPoint &center, const QPixmap &img, const QBrus
ExperimentalButton::ExperimentalButton(QWidget *parent) : experimental_mode(false), engageable(false), QPushButton(parent) { ExperimentalButton::ExperimentalButton(QWidget *parent) : experimental_mode(false), engageable(false), QPushButton(parent) {
setFixedSize(btn_size, btn_size); setFixedSize(btn_size, btn_size);
engage_img = loadPixmap("../assets/img_chffr_wheel.png", {img_size, img_size}); engage_img = loadPixmap("../assets/icons/chffr_wheel.png", {img_size, img_size});
experimental_img = loadPixmap("../assets/img_experimental.svg", {img_size, img_size}); experimental_img = loadPixmap("../assets/icons/experimental.svg", {img_size, img_size});
QObject::connect(this, &QPushButton::clicked, this, &ExperimentalButton::changeMode); QObject::connect(this, &QPushButton::clicked, this, &ExperimentalButton::changeMode);
} }

@ -21,7 +21,7 @@ static const QColor DMON_ENGAGED_COLOR = QColor::fromRgbF(0.1, 0.945, 0.26);
static const QColor DMON_DISENGAGED_COLOR = QColor::fromRgbF(0.545, 0.545, 0.545); static const QColor DMON_DISENGAGED_COLOR = QColor::fromRgbF(0.545, 0.545, 0.545);
DriverMonitorRenderer::DriverMonitorRenderer() : face_kpts_draw(std::size(DEFAULT_FACE_KPTS_3D)) { DriverMonitorRenderer::DriverMonitorRenderer() : face_kpts_draw(std::size(DEFAULT_FACE_KPTS_3D)) {
dm_img = loadPixmap("../assets/img_driver_face.png", {img_size + 5, img_size + 5}); dm_img = loadPixmap("../assets/icons/driver_face.png", {img_size + 5, img_size + 5});
} }
void DriverMonitorRenderer::updateState(const UIState &s) { void DriverMonitorRenderer::updateState(const UIState &s) {

@ -98,7 +98,7 @@ QWidget * Setup::low_voltage() {
main_layout->addLayout(inner_layout); main_layout->addLayout(inner_layout);
QLabel *triangle = new QLabel(); QLabel *triangle = new QLabel();
triangle->setPixmap(QPixmap(ASSET_PATH + "offroad/icon_warning.png")); triangle->setPixmap(QPixmap(ASSET_PATH + "icons/warning.png"));
inner_layout->addWidget(triangle, 0, Qt::AlignTop | Qt::AlignLeft); inner_layout->addWidget(triangle, 0, Qt::AlignTop | Qt::AlignLeft);
inner_layout->addSpacing(80); inner_layout->addSpacing(80);
@ -159,7 +159,7 @@ QWidget * Setup::getting_started() {
vlayout->addStretch(); vlayout->addStretch();
QPushButton *btn = new QPushButton(); QPushButton *btn = new QPushButton();
btn->setIcon(QIcon(":/img_continue_triangle.svg")); btn->setIcon(QIcon(":/images/button_continue_triangle.svg"));
btn->setIconSize(QSize(54, 106)); btn->setIconSize(QSize(54, 106));
btn->setFixedSize(310, 1080); btn->setFixedSize(310, 1080);
btn->setProperty("primary", true); btn->setProperty("primary", true);
@ -251,7 +251,7 @@ QWidget * radio_button(QString title, QButtonGroup *group) {
)"); )");
// checkmark icon // checkmark icon
QPixmap pix(":/img_circled_check.svg"); QPixmap pix(":/icons/circled_check.svg");
btn->setIcon(pix); btn->setIcon(pix);
btn->setIconSize(QSize(0, 0)); btn->setIconSize(QSize(0, 0));
btn->setLayoutDirection(Qt::RightToLeft); btn->setLayoutDirection(Qt::RightToLeft);

@ -120,11 +120,11 @@ InputDialog::InputDialog(const QString &title, QWidget *parent, const QString &s
eye_btn->setFixedSize(150, 120); eye_btn->setFixedSize(150, 120);
QObject::connect(eye_btn, &QPushButton::toggled, [=](bool checked) { QObject::connect(eye_btn, &QPushButton::toggled, [=](bool checked) {
if (checked) { if (checked) {
eye_btn->setIcon(QIcon(ASSET_PATH + "img_eye_closed.svg")); eye_btn->setIcon(QIcon(ASSET_PATH + "icons/eye_closed.svg"));
eye_btn->setIconSize(QSize(81, 54)); eye_btn->setIconSize(QSize(81, 54));
line->setEchoMode(QLineEdit::Password); line->setEchoMode(QLineEdit::Password);
} else { } else {
eye_btn->setIcon(QIcon(ASSET_PATH + "img_eye_open.svg")); eye_btn->setIcon(QIcon(ASSET_PATH + "icons/eye_open.svg"));
eye_btn->setIconSize(QSize(81, 44)); eye_btn->setIconSize(QSize(81, 44));
line->setEchoMode(QLineEdit::Normal); line->setEchoMode(QLineEdit::Normal);
} }

@ -24,8 +24,8 @@ def clamp(value, min_value, max_value):
class SpinnerRenderer: class SpinnerRenderer:
def __init__(self): def __init__(self):
self._comma_texture = gui_app.texture("img_spinner_comma.png", TEXTURE_SIZE, TEXTURE_SIZE) self._comma_texture = gui_app.texture("images/spinner_comma.png", TEXTURE_SIZE, TEXTURE_SIZE)
self._spinner_texture = gui_app.texture("img_spinner_track.png", TEXTURE_SIZE, TEXTURE_SIZE, alpha_premultiply=True) self._spinner_texture = gui_app.texture("images/spinner_track.png", TEXTURE_SIZE, TEXTURE_SIZE, alpha_premultiply=True)
self._rotation = 0.0 self._rotation = 0.0
self._progress: int | None = None self._progress: int | None = None
self._wrapped_lines: list[str] = [] self._wrapped_lines: list[str] = []

Loading…
Cancel
Save