add icon to about dialog

This commit is contained in:
2021-10-28 19:57:57 +02:00
parent 999008e46e
commit 74e89ff78b

View File

@@ -1,10 +1,10 @@
from PyQt6.QtCore import Qt from PyQt6.QtCore import Qt
from PyQt6.QtGui import QFont from PyQt6.QtGui import QFont, QPixmap
from PyQt6.QtWidgets import * from PyQt6.QtWidgets import *
class AboutDialog(QDialog): class AboutDialog(QDialog):
"""Dialog for showing info about TortoiseHg""" """Dialog for showing info about RavenLog"""
def __init__(self, parent=None): def __init__(self, parent=None):
super(AboutDialog, self).__init__(parent) super(AboutDialog, self).__init__(parent)
@@ -12,9 +12,21 @@ class AboutDialog(QDialog):
self.setModal(True) self.setModal(True)
self.layout = QVBoxLayout(self) self.layout = QVBoxLayout(self)
heading_app_name = QLabel("RavenLog") heading_app_name = QLabel("RavenLog")
heading_app_name.setAlignment(Qt.AlignmentFlag.AlignLeft)
heading_app_name.setFont(QFont("default", 25)) heading_app_name.setFont(QFont("default", 25))
self.layout.addWidget(heading_app_name) heading_app_name.setTextInteractionFlags(Qt.TextInteractionFlag.TextSelectableByMouse)
app_icon = QLabel()
app_icon.setPixmap(QPixmap("icon6.png"))
heading = QWidget(self)
hbox = QHBoxLayout(heading)
hbox.addWidget(app_icon)
hbox.addWidget(heading_app_name)
hbox.addSpacerItem(QSpacerItem(1, 1, hPolicy=QSizePolicy.Policy.Expanding))
heading.layout = hbox
self.layout.addWidget(heading)
tabs = QTabWidget() tabs = QTabWidget()
tabs.addTab(self._about(), self.tr("About")) tabs.addTab(self._about(), self.tr("About"))
@@ -26,13 +38,13 @@ class AboutDialog(QDialog):
result = QWidget() result = QWidget()
result.layout = QVBoxLayout(result) result.layout = QVBoxLayout(result)
download_url_lbl = QLabel() download_url_lbl = QLabel(result)
download_url_lbl.setMouseTracking(True) download_url_lbl.setMouseTracking(True)
download_url_lbl.setAlignment(Qt.AlignmentFlag.AlignLeft) download_url_lbl.setAlignment(Qt.AlignmentFlag.AlignLeft)
download_url_lbl.setTextInteractionFlags(Qt.TextInteractionFlag.LinksAccessibleByMouse) download_url_lbl.setTextInteractionFlags(Qt.TextInteractionFlag.LinksAccessibleByMouse)
download_url_lbl.setOpenExternalLinks(True) download_url_lbl.setOpenExternalLinks(True)
download_url_lbl.setText('<a href=%s>%s</a>' % download_url_lbl.setText('<a href=%s>%s</a>' %
('https://opentext.com/', ('https://www.opentext.com/',
self.tr("License: GNU Lesser General Public License v3"))) self.tr("License: GNU Lesser General Public License v3")))
result.layout.addWidget(QLabel(self.tr("Log file viewer"))) result.layout.addWidget(QLabel(self.tr("Log file viewer")))
result.layout.addWidget(QLabel(self.tr("(c) 2021 Open Text Corporation"))) result.layout.addWidget(QLabel(self.tr("(c) 2021 Open Text Corporation")))