parameters: (self)
docstring: sets icon and text on the style button
docstring_summary: sets icon and text on the style button
docstring_tokens: sets icon and text on the style button
function: def setStyleButton(self):
          "sets icon and text on the style button"
          linecolor = QtGui.QColor(Draft.getParam("color",255)>>8)
          facecolor = QtGui.QColor(
              FreeCAD.ParamGet("User parameter:BaseApp/Preferences/View")
              .GetUnsigned( "DefaultShapeColor",4294967295)>>8)
          im = QtGui.QImage(32,32,QtGui.QImage.Format_ARGB32)
          im.fill(QtCore.Qt.transparent)
          pt = QtGui.QPainter(im)
          pt.setPen(QtGui.QPen(QtCore.Qt.black, 1, QtCore.Qt.SolidLine, QtCore.Qt.FlatCap))
          pt.setBrush(QtGui.QBrush(linecolor, QtCore.Qt.SolidPattern))
          pts = [QtCore.QPointF(4.0,4.0), QtCore.QPointF(4.0,26.0), QtCore.QPointF(26.0,4.0)]
          pt.drawPolygon(pts, QtCore.Qt.OddEvenFill)
          pt.setBrush(QtGui.QBrush(facecolor, QtCore.Qt.SolidPattern))
          pts = [QtCore.QPointF(28.0,28.0),QtCore.QPointF(8.0,28.0),QtCore.QPointF(28.0,8.0)]
          pt.drawPolygon(pts,QtCore.Qt.OddEvenFill)
          pt.end()
          icon = QtGui.QIcon(QtGui.QPixmap.fromImage(im))
          linewidth = Draft.getParam("linewidth",2)
          fontsize =  Draft.getParam("textheight",0.20)
          txt = str(linewidth) + "px | "\
              + FreeCAD.Units.Quantity(fontsize,FreeCAD.Units.Length).UserString
          self.styleButton.setIcon(icon)
          self.styleButton.setText(txt)
  
          # FOR BACKWARDS COMPATIBILITY
          self.color = linecolor
          self.facecolor = facecolor
          self.linewidth = linewidth
          self.fontsize = fontsize
function_tokens: def setStyleButton ( self ) : linecolor = QtGui . QColor ( Draft . getParam ( "color" , 255 ) >> 8 ) facecolor = QtGui . QColor ( FreeCAD . ParamGet ( "User parameter:BaseApp/Preferences/View" ) . GetUnsigned ( "DefaultShapeColor" , 4294967295 ) >> 8 ) im = QtGui . QImage ( 32 , 32 , QtGui . QImage . Format_ARGB32 ) im . fill ( QtCore . Qt . transparent ) pt = QtGui . QPainter ( im ) pt . setPen ( QtGui . QPen ( QtCore . Qt . black , 1 , QtCore . Qt . SolidLine , QtCore . Qt . FlatCap ) ) pt . setBrush ( QtGui . QBrush ( linecolor , QtCore . Qt . SolidPattern ) ) pts = [ QtCore . QPointF ( 4.0 , 4.0 ) , QtCore . QPointF ( 4.0 , 26.0 ) , QtCore . QPointF ( 26.0 , 4.0 ) ] pt . drawPolygon ( pts , QtCore . Qt . OddEvenFill ) pt . setBrush ( QtGui . QBrush ( facecolor , QtCore . Qt . SolidPattern ) ) pts = [ QtCore . QPointF ( 28.0 , 28.0 ) , QtCore . QPointF ( 8.0 , 28.0 ) , QtCore . QPointF ( 28.0 , 8.0 ) ] pt . drawPolygon ( pts , QtCore . Qt . OddEvenFill ) pt . end ( ) icon = QtGui . QIcon ( QtGui . QPixmap . fromImage ( im ) ) linewidth = Draft . getParam ( "linewidth" , 2 ) fontsize = Draft . getParam ( "textheight" , 0.20 ) txt = str ( linewidth ) + "px | " + FreeCAD . Units . Quantity ( fontsize , FreeCAD . Units . Length ) . UserString self . styleButton . setIcon ( icon ) self . styleButton . setText ( txt ) # FOR BACKWARDS COMPATIBILITY self . color = linecolor self . facecolor = facecolor self . linewidth = linewidth self . fontsize = fontsize