Skip to content

Commit

Permalink
GUI: Add version to header bar
Browse files Browse the repository at this point in the history
Fixes #219
  • Loading branch information
deeplow committed Dec 23, 2022
1 parent cc7ffac commit 5b7244c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dangerzone/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from .. import container, errors
from ..container import convert
from ..document import SAFE_EXTENSION, Document
from ..util import get_resource_path, get_subprocess_startupinfo
from ..util import get_resource_path, get_subprocess_startupinfo, get_version
from .logic import Alert, DangerzoneGui

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -44,11 +44,16 @@ def __init__(self, dangerzone: DangerzoneGui) -> None:
header_label = QtWidgets.QLabel("dangerzone")
header_label.setFont(self.dangerzone.fixed_font)
header_label.setStyleSheet("QLabel { font-weight: bold; font-size: 50px; }")
header_version_label = QtWidgets.QLabel(get_version())
header_version_label.setProperty("class", "version") # type: ignore [arg-type]
header_version_label.setAlignment(QtCore.Qt.AlignBottom)

header_layout = QtWidgets.QHBoxLayout()
header_layout.addStretch()
header_layout.addWidget(logo)
header_layout.addSpacing(10)
header_layout.addWidget(header_label)
header_layout.addWidget(header_version_label)
header_layout.addStretch()

# Waiting widget, replaces content widget while container runtime isn't available
Expand Down
5 changes: 5 additions & 0 deletions share/dangerzone.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ QLabel[style="safe_extension_filename"] {
QLabel.docs-selection {
font-size: 18px;
}

QLabel.version {
font-size: 20px;
padding-bottom: 5px; /* align with 'dangerzone' font */
}

0 comments on commit 5b7244c

Please sign in to comment.