Skip to content

Commit

Permalink
app: fix message spacing issues
Browse files Browse the repository at this point in the history
also implemented some minor styling as speced in
zeplin, e.g. all the message bubbles are 556px in width
  • Loading branch information
redshiftzero authored and sssoleileraaa committed Jul 10, 2019
1 parent 1a43d5a commit fa9e636
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions securedrop_client/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1294,14 +1294,14 @@ class SpeechBubble(QWidget):
#speech_bubble {
padding: 8px;
min-height: 32px;
min-width: 556px;
border: 1px solid #999;
border-bottom: 0;
}
#color_bar {
padding: 0px;
background-color: #102781;
min-height: 5px;
max-height: 5px;
border: 0px;
}
'''
Expand All @@ -1314,20 +1314,18 @@ def __init__(self, message_id: str, text: str, update_signal) -> None:
self.setStyleSheet(self.CSS)

layout = QVBoxLayout()
layout.setSpacing(0)
self.setLayout(layout)
self.message = QLabel(html.escape(text, quote=False))
self.message.setObjectName('speech_bubble')
self.message.setWordWrap(True)
self.message.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
self.message.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
layout.addWidget(self.message)
layout.insertStretch(0)

self.color_bar = QWidget()
self.color_bar.setObjectName('color_bar')
self.color_bar.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
self.color_bar.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
layout.addWidget(self.color_bar)
layout.setSpacing(0)

self.setLayout(layout)

update_signal.connect(self._update_text)

Expand Down

0 comments on commit fa9e636

Please sign in to comment.