From 3c94d9d0d991159b93a6a411b42094c282b1bf74 Mon Sep 17 00:00:00 2001 From: Allie Crevier Date: Wed, 25 Nov 2020 12:40:41 -0800 Subject: [PATCH] workaround pyqt5.11.3+dfsg-2 issue --- securedrop_client/gui/widgets.py | 24 +++++-- securedrop_client/resources/css/sdclient.css | 24 +++++++ securedrop_client/resources/css/source.css | 69 ------------------- .../resources/css/source_name.css | 13 ++++ .../resources/css/source_preview.css | 13 ++++ .../resources/css/source_timestamp.css | 13 ++++ 6 files changed, 82 insertions(+), 74 deletions(-) delete mode 100644 securedrop_client/resources/css/source.css create mode 100644 securedrop_client/resources/css/source_name.css create mode 100644 securedrop_client/resources/css/source_preview.css create mode 100644 securedrop_client/resources/css/source_timestamp.css diff --git a/securedrop_client/gui/widgets.py b/securedrop_client/gui/widgets.py index a20641aec..b7d0ea07d 100644 --- a/securedrop_client/gui/widgets.py +++ b/securedrop_client/gui/widgets.py @@ -1004,7 +1004,9 @@ class SourceWidget(QWidget): PREVIEW_WIDTH = 380 PREVIEW_HEIGHT = 60 - SOURCE_CSS = load_css("source.css") + SOURCE_NAME_CSS = load_css("source_name.css") + SOURCE_PREVIEW_CSS = load_css("source_preview.css") + SOURCE_TIMESTAMP_CSS = load_css("source_timestamp.css") def __init__(self, controller: Controller, source: Source, source_selected_signal: pyqtSignal): super().__init__() @@ -1152,17 +1154,29 @@ def delete_source(self, event): def update_styles(self) -> None: if self.seen: - self.setStyleSheet("") + self.name.setStyleSheet("") self.name.setObjectName("SourceWidget_name") + self.name.setStyleSheet(self.SOURCE_NAME_CSS) + + self.timestamp.setStyleSheet("") self.timestamp.setObjectName("SourceWidget_timestamp") + self.timestamp.setStyleSheet(self.SOURCE_TIMESTAMP_CSS) + + self.preview.setStyleSheet("") self.preview.setObjectName("SourceWidget_preview") - self.setStyleSheet(self.SOURCE_CSS) + self.preview.setStyleSheet(self.SOURCE_PREVIEW_CSS) else: - self.setStyleSheet("") + self.name.setStyleSheet("") self.name.setObjectName("SourceWidget_name_unread") + self.name.setStyleSheet(self.SOURCE_NAME_CSS) + + self.timestamp.setStyleSheet("") self.timestamp.setObjectName("SourceWidget_timestamp_unread") + self.timestamp.setStyleSheet(self.SOURCE_TIMESTAMP_CSS) + + self.preview.setStyleSheet("") self.preview.setObjectName("SourceWidget_preview_unread") - self.setStyleSheet(self.SOURCE_CSS) + self.preview.setStyleSheet(self.SOURCE_PREVIEW_CSS) @pyqtSlot(bool) def _on_authentication_changed(self, authenticated: bool) -> None: diff --git a/securedrop_client/resources/css/sdclient.css b/securedrop_client/resources/css/sdclient.css index ade5f1d3f..8fa6d82dc 100644 --- a/securedrop_client/resources/css/sdclient.css +++ b/securedrop_client/resources/css/sdclient.css @@ -194,10 +194,34 @@ QListView#SourceList::item:hover{ border: 500px solid #f9f9f9; } +#SourceWidget_container { + border-bottom: 1px solid #9b9b9b; +} + +#SourceWidget_container QPushButton { + border: none; +} + #StarToggleButton { border: none; } +#SourceWidget_gutter { + min-width: 40px; + max-width: 40px; +} + +#SourceWidget_metadata { + max-width: 60px; +} + +#SourceWidget_source_deleted { + font-family: 'Source Sans Pro'; + font-weight: 400; + font-size: 13px; + color: #ff3366; +} + #SourceConversationWrapper_source_deleted { text-align: left; font-family: 'Montserrat'; diff --git a/securedrop_client/resources/css/source.css b/securedrop_client/resources/css/source.css deleted file mode 100644 index 60defc617..000000000 --- a/securedrop_client/resources/css/source.css +++ /dev/null @@ -1,69 +0,0 @@ -#SourceWidget_container { - border-bottom: 1px solid #9b9b9b; -} - -#SourceWidget_gutter { - min-width: 40px; - max-width: 40px; -} - -#SourceWidget_metadata { - max-width: 60px; -} - -#SourceWidget_preview { - font-family: 'Source Sans Pro'; - font-weight: 400; - font-size: 13px; - color: #383838; -} - -#SourceWidget_preview_unread { - font-family: 'Source Sans Pro'; - font-weight: 600; - font-size: 13px; - color: #000; -} - -#SourceWidget_source_deleted { - font-family: 'Source Sans Pro'; - font-weight: 400; - font-size: 13px; - color: #ff3366; -} - -#SourceWidget_name { - font-family: 'Montserrat'; - font-weight: 500; - font-size: 13px; - color: #383838; -} - -#SourceWidget_name_unread { - font-family: 'Montserrat'; - font-weight: 600; - font-size: 13px; - color: #000; -} - -#SourceWidget_timestamp { - font-family: 'Montserrat'; - font-weight: 500; - font-size: 13px; - color: #383838; -} - -#SourceWidget_timestamp_unread { - font-family: 'Montserrat'; - font-weight: 600; - font-size: 13px; - color: #000; -} - -#SourceWidget_container QPushButton { - border: none; -} - -#StarToggleButton { - border: none; -} \ No newline at end of file diff --git a/securedrop_client/resources/css/source_name.css b/securedrop_client/resources/css/source_name.css new file mode 100644 index 000000000..1a61d13a3 --- /dev/null +++ b/securedrop_client/resources/css/source_name.css @@ -0,0 +1,13 @@ +#SourceWidget_name { + font-family: 'Montserrat'; + font-weight: 500; + font-size: 13px; + color: #383838; +} + +#SourceWidget_name_unread { + font-family: 'Montserrat'; + font-weight: 600; + font-size: 13px; + color: #000; +} \ No newline at end of file diff --git a/securedrop_client/resources/css/source_preview.css b/securedrop_client/resources/css/source_preview.css new file mode 100644 index 000000000..c6429d63b --- /dev/null +++ b/securedrop_client/resources/css/source_preview.css @@ -0,0 +1,13 @@ +#SourceWidget_preview { + font-family: 'Source Sans Pro'; + font-weight: 400; + font-size: 13px; + color: #383838; +} + +#SourceWidget_preview_unread { + font-family: 'Source Sans Pro'; + font-weight: 600; + font-size: 13px; + color: #000; +} diff --git a/securedrop_client/resources/css/source_timestamp.css b/securedrop_client/resources/css/source_timestamp.css new file mode 100644 index 000000000..b958362bf --- /dev/null +++ b/securedrop_client/resources/css/source_timestamp.css @@ -0,0 +1,13 @@ +#SourceWidget_timestamp { + font-family: 'Montserrat'; + font-weight: 500; + font-size: 13px; + color: #383838; +} + +#SourceWidget_timestamp_unread { + font-family: 'Montserrat'; + font-weight: 600; + font-size: 13px; + color: #000; +}