Update definitions for compatibility in SunnyPilot UI

The commit introduces several definitions under the SUNNYPILOT flag in different files for compatibility. These changes are meant to make sure controls previously relying on other labels now properly use specifically defined SunnyPilot labels. The update reduces confusion and enhances code clarity.
This commit is contained in:
DevTekVE
2024-07-21 15:16:31 +02:00
parent b7b813c531
commit 8865950499
6 changed files with 5 additions and 9 deletions
+1
View File
@@ -11,6 +11,7 @@
#define ListWidget ListWidgetSP
#define ToggleControl ToggleControlSP
#define LabelControl LabelControlSP
#define ElidedLabel ElidedLabelSP
#else
#include "selfdrive/ui/qt/widgets/controls.h"
#endif
+1
View File
@@ -18,6 +18,7 @@
#include "selfdrive/ui/sunnypilot/qt/widgets/sp_priv_controls.h"
#define ListWidget ListWidgetSP
#define ParamControl ParamControlSP
#define ButtonControl ButtonControlSP
#define ButtonParamControl ButtonParamControlSP
#define ToggleControl ToggleControlSP
#define LabelControl LabelControlSP
@@ -21,6 +21,7 @@
#ifdef SUNNYPILOT
#define ListWidget ListWidgetSP
#define ButtonControl ButtonControlSP
#endif
+1
View File
@@ -23,6 +23,7 @@
#define OffroadHomeImp OffroadHomeSP
#define LayoutWidget LayoutWidgetSP
#define Sidebar SidebarSP
#define ElidedLabel ElidedLabelSP
#else
#include "selfdrive/ui/qt/widgets/controls.h"
#include "selfdrive/ui/qt/onroad/onroad_home.h"
@@ -17,15 +17,6 @@
#include "selfdrive/ui/qt/widgets/input.h"
#include "selfdrive/ui/sunnypilot/qt/widgets/sp_priv_toggle.h"
// This is for compatibility purposes, until we properly do inheritance splitting
// This is because some controls were needing LabelControlSP, but the original code was using LabelControl
// which was modified in-place in the past but since we now have a new file, we will be moving it to LabelControlSP
#define LabelControl LabelControlSP //Not used on SP private code
#define ElidedLabel ElidedLabelSP //Not used on SP private code
#define ButtonControl ButtonControlSP //Not used on SP private code
#define Toggle ToggleSP //Not used on SP private code
#define ToggleControl ToggleControlSP //Not used on SP private code
QFrame *horizontal_line(QWidget *parent = nullptr);
class ElidedLabelSP : public QLabel {
+1
View File
@@ -8,6 +8,7 @@
#ifdef SUNNYPILOT
#include "selfdrive/ui/sunnypilot/qt/widgets/sp_priv_controls.h"
#define ElidedLabel ElidedLabelSP
#else
#include "selfdrive/ui/qt/widgets/controls.h"
#endif