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
24 changes: 13 additions & 11 deletions securedrop_client/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1957,6 +1957,9 @@ def __init__(self, message_uuid: str, text: str, update_signal, index: int) -> N
# Add widget to layout
layout.addWidget(bubble_area)

# Make text selectable
self.message.setTextInteractionFlags(Qt.TextSelectableByMouse)

# Connect signals to slots
update_signal.connect(self._update_text)

Expand Down Expand Up @@ -3031,15 +3034,15 @@ class ConversationView(QWidget):
Renders a conversation.
"""

CSS = '''
#container {
background: #f3f5f9;
}
#scroll {
border: 0;
background: #f3f5f9;
CSS = {
'container': '''
background: #f3f5f9;
''',
'scroll': '''
border: 0;
background: #f3f5f9;
'''
}
'''

conversation_updated = pyqtSignal()

Expand All @@ -3056,9 +3059,6 @@ def __init__(self, source_db_object: Source, controller: Controller):
# To hold currently displayed messages.
self.current_messages = {} # type: Dict[str, QWidget]

# Set styles
self.setStyleSheet(self.CSS)

# Set layout
main_layout = QVBoxLayout()
self.setLayout(main_layout)
Expand All @@ -3074,12 +3074,14 @@ def __init__(self, source_db_object: Source, controller: Controller):
self.conversation_layout.setContentsMargins(self.MARGIN_LEFT, 0, self.MARGIN_RIGHT, 0)
self.conversation_layout.setSpacing(0)
self.container.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
self.container.setStyleSheet(self.CSS['container'])

self.scroll = QScrollArea()
self.scroll.setObjectName('scroll')
self.scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.scroll.setWidget(self.container)
self.scroll.setWidgetResizable(True)
self.scroll.setStyleSheet(self.CSS['scroll'])

# Flag to show if the current user has sent a reply. See issue #61.
self.reply_flag = False
Expand Down