mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 22:28:37 +02:00
Merge pull request #14927 from huffman/fix/hide-asset-browser
Case 16349: Fix asset browser being hidden in incorrect way on server switch
This commit is contained in:
commit
b9356e22d8
1 changed files with 6 additions and 4 deletions
|
@ -6988,17 +6988,19 @@ void Application::nodeActivated(SharedNodePointer node) {
|
||||||
|
|
||||||
#if !defined(DISABLE_QML)
|
#if !defined(DISABLE_QML)
|
||||||
auto offscreenUi = getOffscreenUI();
|
auto offscreenUi = getOffscreenUI();
|
||||||
auto assetDialog = offscreenUi ? offscreenUi->getRootItem()->findChild<QQuickItem*>("AssetServer") : nullptr;
|
|
||||||
|
|
||||||
if (assetDialog) {
|
if (offscreenUi) {
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
|
||||||
if (nodeList->getThisNodeCanWriteAssets()) {
|
if (nodeList->getThisNodeCanWriteAssets()) {
|
||||||
// call reload on the shown asset browser dialog to get the mappings (if permissions allow)
|
// call reload on the shown asset browser dialog to get the mappings (if permissions allow)
|
||||||
QMetaObject::invokeMethod(assetDialog, "reload");
|
auto assetDialog = offscreenUi ? offscreenUi->getRootItem()->findChild<QQuickItem*>("AssetServer") : nullptr;
|
||||||
|
if (assetDialog) {
|
||||||
|
QMetaObject::invokeMethod(assetDialog, "reload");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// we switched to an Asset Server that we can't modify, hide the Asset Browser
|
// we switched to an Asset Server that we can't modify, hide the Asset Browser
|
||||||
assetDialog->setVisible(false);
|
offscreenUi->hide("AssetServer");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue