Skip to content

Commit fd2f736

Browse files
committed
[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
1 parent ae85d1e commit fd2f736

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

plugins/warp/ui/plugin.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ void WarpSidebarWidget::notifyViewChanged(ViewFrame* view)
227227
if (view == m_currentFrame)
228228
return;
229229
m_currentFrame = view;
230-
// TODO: We need to set some stuff here prolly.
231230
}
232231

233232
void WarpSidebarWidget::notifyViewLocationChanged(View* view, const ViewLocation& location)
@@ -241,6 +240,12 @@ void WarpSidebarWidget::notifyViewLocationChanged(View* view, const ViewLocation
241240
m_currentFunctionWidget->SetCurrentFunction(function);
242241
}
243242

243+
void WarpSidebarWidget::focus()
244+
{
245+
m_currentFunctionWidget->SetCurrentFunction(m_currentFrame->getViewLocation().getFunction());
246+
SidebarWidget::focus();
247+
}
248+
244249
WarpSidebarWidgetType::WarpSidebarWidgetType() : SidebarWidgetType(QImage(":/icons/images/warp.png"), "WARP") {}
245250

246251

plugins/warp/ui/plugin.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class WarpSidebarWidget : public SidebarWidget
3939
void notifyViewChanged(ViewFrame*) override;
4040

4141
void notifyViewLocationChanged(View*, const ViewLocation&) override;
42+
43+
void focus() override;
4244
};
4345

4446
class WarpSidebarWidgetType : public SidebarWidgetType

0 commit comments

Comments
 (0)