| 141 | } |
| 142 | |
| 143 | void Widget::changeWidgetSkin(std::string_view _skinName) |
| 144 | { |
| 145 | ResourceSkin* skinInfo = nullptr; |
| 146 | ResourceLayout* templateInfo = nullptr; |
| 147 | |
| 148 | if (LayoutManager::getInstance().isExist(_skinName)) |
| 149 | templateInfo = LayoutManager::getInstance().getByName(_skinName); |
| 150 | else |
| 151 | skinInfo = SkinManager::getInstance().getByName(_skinName); |
| 152 | |
| 153 | shutdownOverride(); |
| 154 | |
| 155 | saveLayerItem(); |
| 156 | |
| 157 | shutdownWidgetSkinBase(); |
| 158 | const WidgetInfo* root = initialiseWidgetSkinBase(skinInfo, templateInfo); |
| 159 | |
| 160 | restoreLayerItem(); |
| 161 | |
| 162 | initialiseOverride(); |
| 163 | |
| 164 | if (skinInfo != nullptr) |
| 165 | setSkinProperty(skinInfo); |
| 166 | |
| 167 | if (root != nullptr) |
| 168 | { |
| 169 | for (const auto& property : root->properties) |
| 170 | { |
| 171 | setProperty(property.first, property.second); |
| 172 | } |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | const WidgetInfo* Widget::initialiseWidgetSkinBase(ResourceSkin* _skinInfo, ResourceLayout* _templateInfo) |
| 177 | { |
no test coverage detected