Skip to content

Commit

Permalink
workaround pyqt5.11.3+dfsg-2 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Allie Crevier committed Nov 25, 2020
1 parent 704879b commit 3c94d9d
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 74 deletions.
24 changes: 19 additions & 5 deletions securedrop_client/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__()
Expand Down Expand Up @@ -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:
Expand Down
24 changes: 24 additions & 0 deletions securedrop_client/resources/css/sdclient.css
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
69 changes: 0 additions & 69 deletions securedrop_client/resources/css/source.css

This file was deleted.

13 changes: 13 additions & 0 deletions securedrop_client/resources/css/source_name.css
Original file line number Diff line number Diff line change
@@ -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;
}
13 changes: 13 additions & 0 deletions securedrop_client/resources/css/source_preview.css
Original file line number Diff line number Diff line change
@@ -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;
}
13 changes: 13 additions & 0 deletions securedrop_client/resources/css/source_timestamp.css
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 3c94d9d

Please sign in to comment.