From ebceadf08905a40f7e019c6b680111ec2ee787ef Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 29 Apr 2021 15:21:40 -0700 Subject: [PATCH] small UI cleanup --- selfdrive/ui/paint.cc | 15 ++------------- selfdrive/ui/qt/onroad.cc | 10 +--------- selfdrive/ui/qt/onroad.hpp | 2 -- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/selfdrive/ui/paint.cc b/selfdrive/ui/paint.cc index 89a2b768e2..bedafa1289 100644 --- a/selfdrive/ui/paint.cc +++ b/selfdrive/ui/paint.cc @@ -529,19 +529,8 @@ void ui_nvg_init(UIState *s) { // init images std::vector> images = { - {"wheel", "../assets/img_chffr_wheel.png"}, - {"trafficSign_turn", "../assets/img_trafficSign_turn.png"}, - {"driver_face", "../assets/img_driver_face.png"}, - {"button_settings", "../assets/images/button_settings.png"}, - {"button_home", "../assets/images/button_home.png"}, - {"battery", "../assets/images/battery.png"}, - {"battery_charging", "../assets/images/battery_charging.png"}, - {"network_0", "../assets/images/network_0.png"}, - {"network_1", "../assets/images/network_1.png"}, - {"network_2", "../assets/images/network_2.png"}, - {"network_3", "../assets/images/network_3.png"}, - {"network_4", "../assets/images/network_4.png"}, - {"network_5", "../assets/images/network_5.png"}, + {"wheel", "../assets/img_chffr_wheel.png"}, + {"driver_face", "../assets/img_driver_face.png"}, }; for (auto [name, file] : images) { s->images[name] = nvgCreateImage(s->vg, file, 1); diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index 07269c56c1..460d75530c 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -18,25 +18,17 @@ void OnroadWindow::initializeGL() { std::cout << "OpenGL renderer: " << glGetString(GL_RENDERER) << std::endl; std::cout << "OpenGL language version: " << glGetString(GL_SHADING_LANGUAGE_VERSION) << std::endl; - enabled = true; ui_nvg_init(&QUIState::ui_state); prev_draw_t = millis_since_boot(); } -void OnroadWindow::setEnabled(bool on) { - enabled = on; -} - void OnroadWindow::update(const UIState &s) { // Connecting to visionIPC requires opengl to be current if (s.vipc_client->connected){ makeCurrent(); } - // TODO: will hide do this? - if(enabled) { - repaint(); - } + repaint(); } void OnroadWindow::paintGL() { diff --git a/selfdrive/ui/qt/onroad.hpp b/selfdrive/ui/qt/onroad.hpp index a4c8872486..5fdb887100 100644 --- a/selfdrive/ui/qt/onroad.hpp +++ b/selfdrive/ui/qt/onroad.hpp @@ -20,10 +20,8 @@ protected: void initializeGL() override; private: - bool enabled; double prev_draw_t = 0; public slots: - void setEnabled(bool on); void update(const UIState &s); };