From a97992a5375613aa19539c46cb0c55821becc011 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Mon, 7 Dec 2015 12:30:20 -0200 Subject: [PATCH] Arch: added button to edit text position in Arch Spaces edit mode - fixes #2339 --- src/Mod/Arch/ArchSpace.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Mod/Arch/ArchSpace.py b/src/Mod/Arch/ArchSpace.py index 15d5efab2..d911768a8 100644 --- a/src/Mod/Arch/ArchSpace.py +++ b/src/Mod/Arch/ArchSpace.py @@ -520,9 +520,28 @@ class _ViewProviderSpace(ArchComponent.ViewProviderComponent): self.text1.justification = coin.SoAsciiText.LEFT self.text2.justification = coin.SoAsciiText.LEFT + def setEdit(self,vobj,mode): + taskd = SpaceTaskPanel() + taskd.obj = self.Object + taskd.update() + FreeCADGui.Control.showDialog(taskd) + return True +class SpaceTaskPanel(ArchComponent.ComponentTaskPanel): + "A modified version of the Arch component task panel" + def __init__(self): + ArchComponent.ComponentTaskPanel.__init__(self) + self.editButton = QtGui.QPushButton(self.form) + self.editButton.setObjectName("editButton") + self.editButton.setIcon(QtGui.QIcon(":/icons/Draft_Edit.svg")) + self.grid.addWidget(self.editButton, 4, 0, 1, 2) + self.editButton.setText(QtGui.QApplication.translate("Arch", "Set text position", None, QtGui.QApplication.UnicodeUTF8)) + QtCore.QObject.connect(self.editButton, QtCore.SIGNAL("clicked()"), self.setTextPos) + + def setTextPos(self): + FreeCADGui.runCommand("Draft_Edit") if FreeCAD.GuiUp: