瀏覽代碼

Add colors to labels

master
Noëlle Anthony 4 年之前
父節點
當前提交
94ae9d7f7e
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2
    1
      main.py

+ 2
- 1
main.py 查看文件

@@ -11,12 +11,13 @@ class TextLine:
self.username = username
self.color = "#000000" if color == "" else color
self.qcolor = QColor(int(self.color[1:3], 16), int(self.color[3:5], 16), int(self.color[5:7], 16))
self.label = qt.QLabel("&{}:".format(username))
self.label = qt.QLabel("<span style='color: {}'>&{}:</span>".format(self.color, self.username))
self.message = qt.QPlainTextEdit()
self.message.keyPressEvent = self.isItEnter
self.message.setMaximumSize(600, 40)
self.textarea = textarea
self.label.setBuddy(self.message)
self.label
self.timestamp = timestamp
self.logfile = logfile

Loading…
取消
儲存