Skip to content

Commit

Permalink
Update login screen to latest design.
Browse files Browse the repository at this point in the history
  • Loading branch information
ntoll committed Feb 10, 2020
1 parent 2177f9c commit 520b71f
Show file tree
Hide file tree
Showing 2 changed files with 205 additions and 74 deletions.
9 changes: 8 additions & 1 deletion securedrop_client/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
QPushButton, QVBoxLayout, QLineEdit, QScrollArea, QDialog, QAction, QMenu, QMessageBox, \
QToolButton, QSizePolicy, QPlainTextEdit, QStatusBar, QGraphicsDropShadowEffect

from securedrop_client import __version__ as sd_version
from securedrop_client.db import DraftReply, Source, Message, File, Reply, User
from securedrop_client.storage import source_exists
from securedrop_client.export import ExportStatus, ExportError
Expand Down Expand Up @@ -1397,6 +1398,7 @@ class LoginDialog(QDialog):
border-radius: 0px;
height: 30px;
margin: 0px 0px 0px 0px;
padding-left: 5px;
}
'''

Expand Down Expand Up @@ -1478,6 +1480,10 @@ def __init__(self, parent):
application_version = QWidget()
application_version_layout = QHBoxLayout()
application_version.setLayout(application_version_layout)
application_version_label = QLabel(_("Workstation app v") + sd_version)
application_version_label.setAlignment(Qt.AlignHCenter)
application_version_label.setStyleSheet("QLabel {color: #2A319D;}")
application_version_layout.addWidget(application_version_label)

# Add widgets
layout.addWidget(self.error_bar)
Expand Down Expand Up @@ -1526,6 +1532,7 @@ def error(self, message):
Ensures the passed in message is displayed as an error message.
"""
self.setDisabled(False)
self.submit.setText(_("SIGN IN"))
self.error_bar.set_message(html.escape(message))

def validate(self):
Expand Down Expand Up @@ -1560,7 +1567,7 @@ def validate(self):
self.setDisabled(False)
self.error(_('Please use only numerals for the two-factor code.'))
return

self.submit.setText(_("SIGNING IN"))
self.controller.login(username, password, tfa_token)
else:
self.setDisabled(False)
Expand Down
270 changes: 197 additions & 73 deletions securedrop_client/resources/images/login_bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 520b71f

Please sign in to comment.