MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / onFocusChanged

Method onFocusChanged

src/plugins/codeeditor/gui/workspacewidget.cpp:936–957  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

934}
935
936void WorkspaceWidgetPrivate::onFocusChanged(QWidget *old, QWidget *now)
937{
938 Q_UNUSED(old)
939
940 if (!now) {
941 ActionManager::instance()->removeContext({ kTextEditorContext });
942 return;
943 }
944
945 // the `now` is TextEditor
946 auto tabWidget = qobject_cast<TabWidget *>(now->parentWidget());
947 if (!tabWidget) {
948 ActionManager::instance()->removeContext({ kTextEditorContext });
949 return;
950 }
951
952 ActionManager::instance()->addContext({ kTextEditorContext });
953 focusTabWidget = tabWidget;
954 editor.switchedFile(focusTabWidget->currentFile());
955 auto symbolWidget = SymbolWidgetGenerator::instance()->symbolWidget();
956 symbolWidget->setEditor(tabWidget->currentEditor());
957}
958
959void WorkspaceWidgetPrivate::onZoomValueChanged()
960{

Callers

nothing calls this directly

Calls 6

removeContextMethod · 0.80
addContextMethod · 0.80
symbolWidgetMethod · 0.80
currentFileMethod · 0.45
setEditorMethod · 0.45
currentEditorMethod · 0.45

Tested by

no test coverage detected