Fix the "hideChromeInterface" call (will work as soon as the server wwt dist is updated)

This commit is contained in:
Ylva Selling
2022-03-25 17:11:16 -04:00
parent 0df6261fa0
commit 82ae56ee88
2 changed files with 3 additions and 13 deletions

View File

@@ -97,7 +97,6 @@ private:
ghoul::Dictionary removeImageMessage(const std::string& id);
ghoul::Dictionary setImageOpacityMessage(const std::string& id, double opacity);
ghoul::Dictionary setLayerOrderMessage(const std::string& id, int version);
ghoul::Dictionary hideChromeGuiMessage(bool isHidden); // Requires a newer CEF version
bool _isSyncedWithWwt = false;
bool _borderColorIsDirty = false;

View File

@@ -171,8 +171,9 @@ void WwtCommunicator::setImageOpacity(int i, float opacity) {
}
void WwtCommunicator::hideChromeInterface(bool shouldHide) {
ghoul::Dictionary msg = hideChromeGuiMessage(shouldHide);
sendMessageToWwt(msg);
std::string script = "sendMessageToWWT({event : \"modify_settings\", "
"settings : [[\"hideAllChrome\", true]], target: \"app\"});";
executeJavascript(script);
}
void WwtCommunicator::update() {
@@ -310,14 +311,4 @@ ghoul::Dictionary WwtCommunicator::setLayerOrderMessage(const std::string& id, i
return msg;
}
ghoul::Dictionary WwtCommunicator::hideChromeGuiMessage(bool isHidden) {
using namespace std::string_literals;
ghoul::Dictionary msg;
msg.setValue("event", "modify_settings"s);
msg.setValue("settings", "[[\"hideAllChrome\", true]]"s);
msg.setValue("target", "app"s);
return msg;
}
} // namespace openspace