提交 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): ...@@ -34,10 +34,11 @@ class LabelDialog(QDialog):
def postProcess(self): def postProcess(self):
self.edit.setText(self.edit.text().trimmed()) self.edit.setText(self.edit.text().trimmed())
def popUp(self, text=''): def popUp(self, text='', move=True):
self.edit.setText(text) self.edit.setText(text)
self.edit.setSelection(0, len(text)) self.edit.setSelection(0, len(text))
self.edit.setFocus(Qt.PopupFocusReason) self.edit.setFocus(Qt.PopupFocusReason)
if move:
self.move(QCursor.pos()) self.move(QCursor.pos())
return self.edit.text() if self.exec_() else None return self.edit.text() if self.exec_() else None
...@@ -347,11 +347,12 @@ class MainWindow(QMainWindow, WindowMixin): ...@@ -347,11 +347,12 @@ class MainWindow(QMainWindow, WindowMixin):
def toggleAdvancedMode(self, value=True): def toggleAdvancedMode(self, value=True):
self._beginner = not value self._beginner = not value
self.canvas.setEditing(True)
self.populateModeActions() self.populateModeActions()
self.editButton.setVisible(not value) self.editButton.setVisible(not value)
if value: if value:
self.actions.createMode.setEnabled(True) self.actions.createMode.setEnabled(True)
self.actions.editMode.setEnabled(True) self.actions.editMode.setEnabled(False)
self.dock.setFeatures(self.dock.features() | self.dockFeatures) self.dock.setFeatures(self.dock.features() | self.dockFeatures)
else: else:
self.dock.setFeatures(self.dock.features() ^ self.dockFeatures) 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.
先完成此消息的编辑!
想要评论请 注册