From c715ef47627d1d7ae69577641667e25aeeb4317c Mon Sep 17 00:00:00 2001 From: Trey Moen <50057480+greatgitsby@users.noreply.github.com> Date: Sun, 13 Sep 2026 16:15:25 -0700 Subject: [PATCH] cabana: flatten signal panel containers (#38904) * cabana: flatten signal panel containers * cabana: keep messages and logs switch border --- openpilot/tools/cabana/ui/widgets/detailwidget.cc | 2 +- openpilot/tools/cabana/ui/widgets/signalview.cc | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/openpilot/tools/cabana/ui/widgets/detailwidget.cc b/openpilot/tools/cabana/ui/widgets/detailwidget.cc index 8f42b63d8..6bfcccf14 100644 --- a/openpilot/tools/cabana/ui/widgets/detailwidget.cc +++ b/openpilot/tools/cabana/ui/widgets/detailwidget.cc @@ -281,7 +281,7 @@ void DetailWidget::drawTabWidget() { void DetailWidget::draw() { tabbar_.draw(); - ImGui::BeginChild("message_content", ImVec2(0, 0), ImGuiChildFlags_Borders, + ImGui::BeginChild("message_content", ImVec2(0, 0), ImGuiChildFlags_AlwaysUseWindowPadding, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse); drawToolBar(); diff --git a/openpilot/tools/cabana/ui/widgets/signalview.cc b/openpilot/tools/cabana/ui/widgets/signalview.cc index 48a74fd11..c8ed72f95 100644 --- a/openpilot/tools/cabana/ui/widgets/signalview.cc +++ b/openpilot/tools/cabana/ui/widgets/signalview.cc @@ -682,12 +682,12 @@ float SignalView::toolBarRightWidth(const std::string &range_label) { } // the width at which the tool bar stops squishing: the signal count and the filter box on the left, the -// sparkline controls on the right, plus the borders and padding of the view's own child window +// sparkline controls on the right. Padding is supplied by the message panel. float SignalView::minimumWidth() { const ImGuiStyle &style = ImGui::GetStyle(); const float left_width = ImGui::CalcTextSize("Signals: 000").x + style.ItemSpacing.x + FILTER_WIDTH; // formatSeconds is mm:ss for every value the range slider allows - return left_width + style.ItemSpacing.x + toolBarRightWidth("00:00") + (style.WindowPadding.x + style.ChildBorderSize) * 2; + return left_width + style.ItemSpacing.x + toolBarRightWidth("00:00") + style.WindowPadding.x * 2; } float SignalView::minimumHeight() { @@ -698,7 +698,7 @@ float SignalView::minimumHeight() { void SignalView::draw() { ImGui::PushStyleColor(ImGuiCol_ChildBg, palette().surface); - if (!ImGui::BeginChild("SignalView", ImVec2(0, 0), ImGuiChildFlags_Borders, + if (!ImGui::BeginChild("SignalView", ImVec2(0, 0), ImGuiChildFlags_None, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse)) { ImGui::EndChild(); ImGui::PopStyleColor(); @@ -885,6 +885,8 @@ void SignalView::drawIndexWidget(SignalModel::Item *item, const ImRect &rect) { const ImVec2 size = indexButtonsSize(iconButtonWidth()); ImGui::SetCursorScreenPos(ImVec2(rect.Max.x - size.x, rect.Min.y + (rect.GetHeight() - size.y) * 0.5f)); + ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f); + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); const auto sig = item->sig; const bool checked = item->chart_opened; if (checked) ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyleColorVec4(ImGuiCol_ButtonActive)); @@ -899,6 +901,8 @@ void SignalView::drawIndexWidget(SignalModel::Item *item, const ImRect &rect) { pending_action_ = [this, sig]() { UndoStack::instance()->push(new RemoveSigCommand(model_.msgId(), sig)); }; } ImGui::SetItemTooltip("Remove signal"); + ImGui::PopStyleColor(); + ImGui::PopStyleVar(); button_size_ = size; }