1
0

plugins: coldcard: use RichLabel, org imports

qt/util.py: introduce RichLabel, allows link select and open
This commit is contained in:
Sander van Grieken
2025-05-01 12:06:16 +02:00
parent 83ac15935a
commit 7146e320f0
2 changed files with 18 additions and 10 deletions

View File

@@ -105,12 +105,21 @@ class ThreadedButton(QPushButton):
class WWLabel(QLabel):
def __init__ (self, text="", parent=None):
"""Word-wrapping label"""
def __init__(self, text="", parent=None):
QLabel.__init__(self, text, parent)
self.setWordWrap(True)
self.setTextInteractionFlags(Qt.TextInteractionFlag.TextSelectableByMouse)
class RichLabel(WWLabel):
"""Word-wrapping label with link activation"""
def __init__(self, text='', parent=None):
WWLabel.__init__(self, text, parent)
self.setTextInteractionFlags(Qt.TextInteractionFlag.TextBrowserInteraction)
self.setOpenExternalLinks(True)
class AmountLabel(QLabel):
def __init__(self, *args, **kwargs):
QLabel.__init__(self, *args, **kwargs)