コード例 #1
0
ファイル: bnbrush.py プロジェクト: Grum999/BuliNotes
    def exportAsText(self):
        """Return synthetised brush information (Text)"""
        returned = []
        returned.append(f'{self.__name.replace("_", " ")}')
        returned.append(f'- Blending mode: {self.__blendingMode}')
        returned.append(f'- Size:          {self.__size:0.2f}px')
        returned.append(f'- Opacity:       {100*self.__opacity:0.2f}%')
        returned.append(f'- Flow:          {100*self.__flow:0.2f}%')

        if stripHtml(self.__comments) != '':
            returned.append(stripHtml(self.__comments))

        return "\n".join(returned)
コード例 #2
0
ファイル: bnlinkedlayer.py プロジェクト: Grum999/BuliNotes
    def exportAsText(self):
        """Return synthetised brush information (Text)"""
        returned = []
        returned.append(f'{self.__name}')
        returned.append(stripHtml(self.__comments))

        return "\n".join(returned)
コード例 #3
0
ファイル: bnlinkedlayer.py プロジェクト: Grum999/BuliNotes
 def setComments(self, value):
     """Set current comment for linked layer"""
     if value != self.__comments:
         if stripHtml(value).strip() != '':
             self.__comments = value
         else:
             self.__comments = ''
         self.__updated('comments')
コード例 #4
0
ファイル: bnwbrushes.py プロジェクト: Grum999/BuliNotes
    def __getTextInformation(self, brush):
        """Return text for information"""
        textDocument=QTextDocument()

        if self.__csize>0:
            textDocument.setHtml(brush.information())
        else:
            text=brush.comments()
            if stripHtml(text)=='':
                textDocument.setHtml(brush.information(False))
            else:
                textDocument.setHtml(text)
                cursor=QTextCursor(textDocument)
                cursor.movePosition(QTextCursor.End, QTextCursor.MoveAnchor)
                cursor.insertHtml(f"<br><span>{brush.information(False)}</span>")

        if self.__isCompact:
            text=textDocument.toHtml()
            text=re.sub(r"font-size\s*:\s*(\d+)pt;", self.__applyCompactFactor, text)
            textDocument.setHtml(text)

        return textDocument
コード例 #5
0
ファイル: bnwlinkedlayers.py プロジェクト: Grum999/BuliNotes
    def __getTextDocument(self, linkedLayer):
        """Return text for information"""
        textDocument = QTextDocument()

        if self.__csize > 0:
            textDocument.setHtml(linkedLayer.name())
        else:
            text = linkedLayer.comments()
            if stripHtml(text) == '':
                textDocument.setHtml(linkedLayer.name())
            else:
                textDocument.setHtml(text)
                cursor = QTextCursor(textDocument)
                cursor.insertHtml(
                    f"<span><i>[{linkedLayer.name()}]</i></span><br>")

        if self.__isCompact:
            text = textDocument.toHtml()
            text = re.sub(r"font-size\s*:\s*(\d+)pt;",
                          self.__applyCompactFactor, text)
            textDocument.setHtml(text)

        return textDocument