From f852785e4ae0eb9bd560566221e9f6d70c895b32 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Tue, 3 Mar 2026 09:15:02 -0800 Subject: [WARP] Update the selected sidebar function when refocusing Should fix issue where opening the sidebar for the first time will not show anything in the selected function until the user clicks in the view frame --- plugins/warp/ui/plugin.cpp | 7 ++++++- plugins/warp/ui/plugin.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/warp/ui/plugin.cpp b/plugins/warp/ui/plugin.cpp index 66c80ba3..9421cc02 100644 --- a/plugins/warp/ui/plugin.cpp +++ b/plugins/warp/ui/plugin.cpp @@ -227,7 +227,6 @@ void WarpSidebarWidget::notifyViewChanged(ViewFrame* view) if (view == m_currentFrame) return; m_currentFrame = view; - // TODO: We need to set some stuff here prolly. } void WarpSidebarWidget::notifyViewLocationChanged(View* view, const ViewLocation& location) @@ -241,6 +240,12 @@ void WarpSidebarWidget::notifyViewLocationChanged(View* view, const ViewLocation m_currentFunctionWidget->SetCurrentFunction(function); } +void WarpSidebarWidget::focus() +{ + m_currentFunctionWidget->SetCurrentFunction(m_currentFrame->getViewLocation().getFunction()); + SidebarWidget::focus(); +} + WarpSidebarWidgetType::WarpSidebarWidgetType() : SidebarWidgetType(QImage(":/icons/images/warp.png"), "WARP") {} diff --git a/plugins/warp/ui/plugin.h b/plugins/warp/ui/plugin.h index e70b7afa..0a4c630c 100644 --- a/plugins/warp/ui/plugin.h +++ b/plugins/warp/ui/plugin.h @@ -39,6 +39,8 @@ public: void notifyViewChanged(ViewFrame*) override; void notifyViewLocationChanged(View*, const ViewLocation&) override; + + void focus() override; }; class WarpSidebarWidgetType : public SidebarWidgetType -- cgit v1.3.1