| 934 | } |
| 935 | |
| 936 | void 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 | |
| 959 | void WorkspaceWidgetPrivate::onZoomValueChanged() |
| 960 | { |
nothing calls this directly
no test coverage detected