From 4af412f1e4a64db30884b03cb91ee567f0d3bac6 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Wed, 18 Nov 2020 11:41:38 +0100 Subject: [PATCH] Draft: Fixed regression caused by new setstyle button --- src/Mod/Draft/DraftGui.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Mod/Draft/DraftGui.py b/src/Mod/Draft/DraftGui.py index d573da77aa..381339a78c 100644 --- a/src/Mod/Draft/DraftGui.py +++ b/src/Mod/Draft/DraftGui.py @@ -168,12 +168,12 @@ class DraftToolBar: # taskmode = 0 was used by draft toolbar that is now obsolete. # print("taskmode: ",str(self.taskmode)) - # OBSOLETE - TO BE REMOVED - #self.paramcolor = Draft.getParam("color",255)>>8 - #self.color = QtGui.QColor(self.paramcolor) - #self.facecolor = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/View").GetUnsigned("DefaultShapeColor",4294967295)>>8 - #self.linewidth = Draft.getParam("linewidth",2) - #self.fontsize = Draft.getParam("textheight",0.20) + # OBSOLETE BUT STILL USED BY SOME ADDONS AND MACROS + self.paramcolor = Draft.getParam("color",255)>>8 + self.color = QtGui.QColor(self.paramcolor) + self.facecolor = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/View").GetUnsigned("DefaultShapeColor",4294967295)>>8 + self.linewidth = Draft.getParam("linewidth",2) + self.fontsize = Draft.getParam("textheight",0.20) self.paramconstr = Draft.getParam("constructioncolor",746455039)>>8 self.constrMode = False @@ -1790,6 +1790,12 @@ class DraftToolBar: self.styleButton.setIcon(icon) self.styleButton.setText(txt) + # FOR BACKWARDS COMPATIBILITY + self.color = linecolor + self.facecolor = facecolor + self.linewidth = linewidth + self.fontsize = fontsize + def popupMenu(self,llist,ilist=None,pos=None): """pops up a menu filled with the given list""" self.groupmenu = QtGui.QMenu()