From a46e66db5952847afef80002a04837a32377c064 Mon Sep 17 00:00:00 2001 From: Allie Crevier Date: Mon, 30 Mar 2020 17:16:22 -0700 Subject: [PATCH] fix margins, padding, and layouts --- securedrop_client/gui/widgets.py | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/securedrop_client/gui/widgets.py b/securedrop_client/gui/widgets.py index 7680676dd6..eca394918b 100644 --- a/securedrop_client/gui/widgets.py +++ b/securedrop_client/gui/widgets.py @@ -1888,11 +1888,8 @@ class SpeechBubble(QWidget): min-width: 540px; max-width: 540px; background-color: #fff; - padding: 16px; } #message { - min-width: 540px; - max-width: 540px; font-family: 'Source Sans Pro'; font-weight: 400; font-size: 15px; @@ -1904,11 +1901,10 @@ class SpeechBubble(QWidget): max-height: 5px; background-color: #102781; border: 0px; - min-width: 590px; - max-width: 590px; } ''' + TOP_MARGIN = 28 BOTTOM_MARGIN = 10 @@ -1918,7 +1914,6 @@ def __init__(self, message_uuid: str, text: str, update_signal, index: int) -> N self.index = index # Set styles - self.setObjectName('speech_bubble') self.setStyleSheet(self.CSS) self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) @@ -1940,19 +1935,21 @@ def __init__(self, message_uuid: str, text: str, update_signal, index: int) -> N # Speech bubble speech_bubble = QWidget() + speech_bubble.setObjectName('speech_bubble') speech_bubble_layout = QVBoxLayout() speech_bubble.setLayout(speech_bubble_layout) speech_bubble_layout.addWidget(self.message) speech_bubble_layout.addWidget(self.color_bar) + speech_bubble_layout.setContentsMargins(0, 0, 0, 0) speech_bubble_layout.setSpacing(0) # Bubble area includes speech bubble plus error message if there is an error bubble_area = QWidget() bubble_area.setLayoutDirection(Qt.RightToLeft) self.bubble_area_layout = QHBoxLayout() - self.bubble_area_layout.setContentsMargins(0, self.TOP_MARGIN, 0, self.BOTTOM_MARGIN) bubble_area.setLayout(self.bubble_area_layout) self.bubble_area_layout.addWidget(speech_bubble) + self.bubble_area_layout.setContentsMargins(0, self.TOP_MARGIN, 0, self.BOTTOM_MARGIN) # Add widget to layout layout.addWidget(bubble_area) @@ -1985,8 +1982,6 @@ class ReplyWidget(SpeechBubble): """ CSS_MESSAGE_REPLY_FAILED = ''' - min-width: 540px; - max-width: 540px; font-family: 'Source Sans Pro'; font-weight: 400; font-size: 15px; @@ -2010,8 +2005,6 @@ class ReplyWidget(SpeechBubble): ''' CSS_MESSAGE_REPLY_SUCCEEDED = ''' - min-width: 540px; - max-width: 540px; font-family: 'Source Sans Pro'; font-weight: 400; font-size: 15px; @@ -2028,8 +2021,6 @@ class ReplyWidget(SpeechBubble): ''' CSS_MESSAGE_REPLY_PENDING = ''' - min-width: 540px; - max-width: 540px; font-family: 'Source Sans Pro'; font-weight: 400; font-size: 15px; @@ -2123,7 +2114,6 @@ class FileWidget(QWidget): #file_widget { min-width: 540px; max-width: 540px; - padding: 16px; } #file_options { min-width: 137px; @@ -2194,7 +2184,6 @@ class FileWidget(QWidget): } """ - VERTICAL_MARGIN = 10 FILE_FONT_SPACING = 2 FILE_OPTIONS_FONT_SPACING = 1.6 FILENAME_WIDTH_PX = 360 @@ -2232,7 +2221,7 @@ def __init__( self.setLayout(layout) # Set margins and spacing - layout.setContentsMargins(0, self.VERTICAL_MARGIN, 0, self.VERTICAL_MARGIN) + layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(0) # File options: download, export, print