Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions qtapputils/widgets/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def __init__(self, icon: QIcon, title: str,
appname: str,
website_url: str,
banner_fpath: str,
system_info: str = None,
license_fpath: str = None,
parent: QWidget = None,
):
Expand All @@ -37,12 +38,18 @@ def __init__(self, icon: QIcon, title: str,
self.setWindowIcon(icon)
self.setWindowTitle(title)

pixmap = QPixmap(banner_fpath)
self.label_pic = QLabel(self)
self.label_pic.setPixmap(
pixmap.scaledToWidth(450, Qt.SmoothTransformation))
self.label_pic.setAlignment(Qt.AlignTop)

# Get current font properties
font = self.font()
font_family = font.family()
font_size = font.pointSize()

self.label = QLabel((
text = (
"""
<div style='font-family: "{font_family}";
font-size: {font_size}pt;
Expand All @@ -54,27 +61,24 @@ def __init__(self, icon: QIcon, title: str,
<a href="{website_url}">{website_url}</a>
</p>
<p>{longdesc}</p>
</div>
""".format(
appname=appname,
website_url=website_url,
font_family=font_family,
font_size=font_size,
copyright_holder=copyright_holder,
longdesc=longdesc
)
))
longdesc=longdesc)
)
if system_info is not None:
text += "<p>" + system_info + "</p>"
text += "</div>"

self.label = QLabel(text)
self.label.setWordWrap(True)
self.label.setAlignment(Qt.AlignTop)
self.label.setOpenExternalLinks(True)
self.label.setTextInteractionFlags(Qt.TextBrowserInteraction)

pixmap = QPixmap(banner_fpath)
self.label_pic = QLabel(self)
self.label_pic.setPixmap(
pixmap.scaledToWidth(450, Qt.SmoothTransformation))
self.label_pic.setAlignment(Qt.AlignTop)

content_frame = QFrame(self)
content_frame.setStyleSheet(
"QFrame {background-color: white}")
Expand Down