| 73 | // } |
| 74 | |
| 75 | void FontTextureController::notifyChangeScope(std::string_view _scope) |
| 76 | { |
| 77 | if (mControl == nullptr) |
| 78 | return; |
| 79 | |
| 80 | if (_scope == mScopeName) |
| 81 | { |
| 82 | if (!mActivated) |
| 83 | { |
| 84 | mControl->clearAll(); |
| 85 | |
| 86 | DataSelectorManager::getInstance() |
| 87 | .getEvent(mParentTypeName) |
| 88 | ->connect(this, &FontTextureController::notifyChangeDataSelector); |
| 89 | mParentData = DataUtility::getSelectedDataByType(mParentTypeName); |
| 90 | notifyChangeDataSelector(mParentData, false); |
| 91 | |
| 92 | mControl->getRoot()->setUserString("CurrentScopeController", mScopeName); |
| 93 | |
| 94 | mActivated = true; |
| 95 | } |
| 96 | } |
| 97 | else |
| 98 | { |
| 99 | if (mActivated) |
| 100 | { |
| 101 | DataSelectorManager::getInstance().getEvent(mParentTypeName)->disconnect(this); |
| 102 | mParentData = nullptr; |
| 103 | |
| 104 | // мы еще владельцы контрола сбрасываем его |
| 105 | std::string_view value = mControl->getRoot()->getUserString("CurrentScopeController"); |
| 106 | if (value == mScopeName) |
| 107 | { |
| 108 | mControl->getRoot()->setUserString("CurrentScopeController", std::string_view{}); |
| 109 | notifyChangeDataSelector(mParentData, false); |
| 110 | |
| 111 | mControl->clearAll(); |
| 112 | } |
| 113 | |
| 114 | mActivated = false; |
| 115 | } |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | void FontTextureController::updateTexture(std::string_view _value) |
| 120 | { |
nothing calls this directly
no test coverage detected