コード例 #1
0
 def updateDrawingAttributes(self, menu):
     drawingAttributes = settings.drawingAttributes()
     elements = [
         (
             Entries.View_Show_Points,
             ("showGlyphOnCurvePoints", "showGlyphOffCurvePoints"),
         ),
         (
             Entries.View_Show_Metrics,
             (
                 "showGlyphMetrics",
                 "showFontVerticalMetrics",
                 "showFontPostscriptBlues",
             ),
         ),
         (Entries.View_Show_Images, ("showGlyphImage", )),
         (
             Entries.View_Show_Guidelines,
             ("showGlyphGuidelines", "showFontGuidelines"),
         ),
     ]
     for entry, attrs in elements:
         action = menu.fetchAction(entry)
         action.setCheckable(True)
         action.setChecked(drawingAttributes.get(attrs[0], True))
         action.setData(attrs)
         action.triggered.connect(self.setDrawingAttribute)
コード例 #2
0
 def setDrawingAttribute(self):
     sender = self.sender()
     drawingAttributes = settings.drawingAttributes()
     checked = sender.isChecked()
     for attr in sender.data():
         drawingAttributes[attr] = checked
     settings.setDrawingAttributes(drawingAttributes)
     self.postNotification("preferencesChanged")
コード例 #3
0
ファイル: application.py プロジェクト: yalvex/trufont
 def updateDrawingAttributes(self, menu):
     drawingAttributes = settings.drawingAttributes()
     elements = [
         (
             Entries.View_Show_Points,
             ("showGlyphOnCurvePoints", "showGlyphOffCurvePoints"),
             True,
         ),
         (
             Entries.View_Show_Coordinates_When_Selected,
             ("showGlyphCoordinatesWhenSelected",),
             False,
         ),
         (
             Entries.View_Show_Point_Coordinates,
             ("showGlyphPointCoordinates",),
             False,
         ),
         (
             Entries.View_Show_Bezier_Handles_Coordinates,
             ("showGlyphBezierHandlesCoordinates",),
             False,
         ),
         (
             Entries.View_Show_Metrics,
             (
                 "showGlyphMetrics",
                 "showFontVerticalMetrics",
                 "showFontPostscriptBlues",
             ),
             True,
         ),
         (Entries.View_Show_Images, ("showGlyphImage",), True,),
         (
             Entries.View_Show_Guidelines,
             ("showGlyphGuidelines", "showFontGuidelines"),
             True,
         ),
     ]
     for entry, attrs, checked in elements:
         action = menu.fetchAction(entry)
         action.setCheckable(True)
         action.setChecked(drawingAttributes.get(attrs[0], checked))
         action.setData(attrs)
         action.triggered.connect(self.setDrawingAttribute)
コード例 #4
0
 def readSettings(self):
     drawingAttributes = settings.drawingAttributes()
     for attr, value in drawingAttributes.items():
         self.setDefaultDrawingAttribute(attr, value)