From 59c244fc7c4c57a450b0685fbd45715ac847507a Mon Sep 17 00:00:00 2001 From: Nate Koenig Date: Wed, 17 Nov 2021 09:01:33 -0800 Subject: [PATCH] Added state awareness to add entity button Signed-off-by: Nate Koenig --- .../component_inspector/ComponentInspector.qml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/gui/plugins/component_inspector/ComponentInspector.qml b/src/gui/plugins/component_inspector/ComponentInspector.qml index 245c057752..4d6d8b41b4 100644 --- a/src/gui/plugins/component_inspector/ComponentInspector.qml +++ b/src/gui/plugins/component_inspector/ComponentInspector.qml @@ -255,7 +255,20 @@ Rectangle { ToolTip.visible: hovered ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval onClicked: { - addLinkMenu.open() + getSimPaused() ? addLinkMenu.open() : pausePopup.open() + } + Popup { + id: pausePopup + modal: true + focus: true + x: parent.width - popupContentText.width + y: parent.height + popupContentText.height + contentItem: Text { + id: popupContentText + padding: 10 + text: "Pause simulation to add an entity" + } + closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent } FileDialog {