From a307a085917d98f72a519573d02693179bfd2819 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sun, 23 Mar 2025 15:50:21 -0400 Subject: [PATCH] ui: fix offset with `OptionControlSP` for macOS (#705) ui: fix offset with `OptionControlSP` --- selfdrive/ui/sunnypilot/qt/widgets/controls.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/selfdrive/ui/sunnypilot/qt/widgets/controls.h b/selfdrive/ui/sunnypilot/qt/widgets/controls.h index a7c60980f..1578130bb 100644 --- a/selfdrive/ui/sunnypilot/qt/widgets/controls.h +++ b/selfdrive/ui/sunnypilot/qt/widgets/controls.h @@ -520,7 +520,11 @@ protected: } // Draw the rectangle +#ifdef __APPLE__ + QRect rect(0, !_title.isEmpty() ? (h - 16) : 20, w, h); +#else QRect rect(0, !_title.isEmpty() ? (h - 24) : 20, w, h); +#endif p.setBrush(QColor(button_enabled ? "#b24a4a4a" : "#121212")); // Background color p.setPen(QPen(Qt::NoPen)); p.drawRoundedRect(rect, 20, 20);