From a165f2576286b360ebc7520f10c6602e832f667d Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Fri, 20 Aug 2021 05:14:34 +0800 Subject: [PATCH] Qt: new global WIDE_UI (#21977) --- selfdrive/ui/qt/offroad/onboarding.h | 4 ++-- selfdrive/ui/qt/qt_window.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/selfdrive/ui/qt/offroad/onboarding.h b/selfdrive/ui/qt/offroad/onboarding.h index c35ce069da..980d450b72 100644 --- a/selfdrive/ui/qt/offroad/onboarding.h +++ b/selfdrive/ui/qt/offroad/onboarding.h @@ -72,8 +72,8 @@ private: QRect(303, 755, 718, 189), }; - const QString IMG_PATH = vwp_w == 2160 ? "../assets/training_wide/" : "../assets/training/"; - const QVector boundingRect = vwp_w == 2160 ? boundingRectWide : boundingRectStandard; + const QString IMG_PATH = WIDE_UI ? "../assets/training_wide/" : "../assets/training/"; + const QVector boundingRect = WIDE_UI ? boundingRectWide : boundingRectStandard; signals: void completedTraining(); diff --git a/selfdrive/ui/qt/qt_window.h b/selfdrive/ui/qt/qt_window.h index 1b7ae0a618..89d0c80618 100644 --- a/selfdrive/ui/qt/qt_window.h +++ b/selfdrive/ui/qt/qt_window.h @@ -19,7 +19,8 @@ const QString ASSET_PATH = ":/"; const QString ASSET_PATH = "../assets/"; #endif -const int vwp_w = (Hardware::TICI() || (getenv("WIDE_UI") != NULL)) ? 2160 : 1920; +const bool WIDE_UI = Hardware::TICI() || getenv("WIDE_UI") != nullptr; +const int vwp_w = WIDE_UI ? 2160 : 1920; const int vwp_h = 1080; inline void setMainWindow(QWidget *w) {