From ff8eda36827cf3e6f01bb15872e7a5988a53fce1 Mon Sep 17 00:00:00 2001 From: Palakis Date: Wed, 19 Apr 2017 11:50:49 +0200 Subject: [PATCH] Fixed detection and control behaviour for some functions used by Preview API --- Utils.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Utils.cpp b/Utils.cpp index c3c10c99..aeb8e4a2 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -261,7 +261,7 @@ bool Utils::IsPreviewModeActive() bool buttonToggledOn = GetPreviewModeButtonControl()->isChecked(); // Clue 2 : Preview layout has more than one item - int previewChildCount = GetPreviewLayout()->children().count(); + int previewChildCount = GetPreviewLayout()->count(); blog(LOG_INFO, "preview layout children count : %d", previewChildCount); return buttonToggledOn || (previewChildCount >= 2); @@ -269,17 +269,19 @@ bool Utils::IsPreviewModeActive() void Utils::EnablePreviewMode() { - GetPreviewModeButtonControl()->setChecked(true); + if (!IsPreviewModeActive()) + GetPreviewModeButtonControl()->click(); } void Utils::DisablePreviewMode() { - GetPreviewModeButtonControl()->setChecked(false); + if (IsPreviewModeActive()) + GetPreviewModeButtonControl()->click(); } void Utils::TogglePreviewMode() { - GetPreviewModeButtonControl()->toggle(); + GetPreviewModeButtonControl()->click(); } const char* Utils::GetPreviewSceneName()