提交 92ddbcce 编写于 作者: M Michael Pitidis

Fix bug when switching modes

The state of the buttons was not changed properly
上级 160ff05c
......@@ -34,10 +34,11 @@ class LabelDialog(QDialog):
def postProcess(self):
self.edit.setText(self.edit.text().trimmed())
def popUp(self, text=''):
def popUp(self, text='', move=True):
self.edit.setText(text)
self.edit.setSelection(0, len(text))
self.edit.setFocus(Qt.PopupFocusReason)
self.move(QCursor.pos())
if move:
self.move(QCursor.pos())
return self.edit.text() if self.exec_() else None
......@@ -347,11 +347,12 @@ class MainWindow(QMainWindow, WindowMixin):
def toggleAdvancedMode(self, value=True):
self._beginner = not value
self.canvas.setEditing(True)
self.populateModeActions()
self.editButton.setVisible(not value)
if value:
self.actions.createMode.setEnabled(True)
self.actions.editMode.setEnabled(True)
self.actions.editMode.setEnabled(False)
self.dock.setFeatures(self.dock.features() | self.dockFeatures)
else:
self.dock.setFeatures(self.dock.features() ^ self.dockFeatures)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册