Skip to content

Commit

Permalink
Added state awareness to add entity button
Browse files Browse the repository at this point in the history
Signed-off-by: Nate Koenig <nate@openrobotics.org>
  • Loading branch information
Nate Koenig committed Nov 17, 2021
1 parent 8a983d5 commit 59c244f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/gui/plugins/component_inspector/ComponentInspector.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 59c244f

Please sign in to comment.