From acf453e094a0f3213f84846c09db6d647ae4ef91 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sat, 27 May 2017 19:53:30 +1000 Subject: [PATCH 1/4] Style a prettier progress bar --- onionshare_gui/downloads.py | 14 ++++++++++++-- onionshare_gui/onionshare_gui.py | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/onionshare_gui/downloads.py b/onionshare_gui/downloads.py index f3ac2cb0..a9d7fb12 100644 --- a/onionshare_gui/downloads.py +++ b/onionshare_gui/downloads.py @@ -32,14 +32,24 @@ class Download(object): self.downloaded_bytes = 0 # make a new progress bar + cssStyleData =""" + QProgressBar { + border: 2px solid grey; + border-radius: 5px; + text-align: center; + } + + QProgressBar::chunk { + background: qlineargradient(x1: 0.5, y1: 0, x2: 0.5, y2: 1, stop: 0 #b366ff, stop: 1 #d9b3ff); + width: 10px; + }""" self.progress_bar = QtWidgets.QProgressBar() self.progress_bar.setTextVisible(True) self.progress_bar.setAlignment(QtCore.Qt.AlignHCenter) self.progress_bar.setMinimum(0) self.progress_bar.setMaximum(total_bytes) self.progress_bar.setValue(0) - self.progress_bar.setStyleSheet( - "QProgressBar::chunk { background-color: #05B8CC; }") + self.progress_bar.setStyleSheet(cssStyleData) self.progress_bar.total_bytes = total_bytes # start at 0 diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 166700e1..a80f4671 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -471,9 +471,18 @@ class ZipProgressBar(QtWidgets.QProgressBar): self.setMinimumWidth(200) self.setValue(0) self.setFormat(strings._('zip_progress_bar_format')) - self.setStyleSheet( - "QProgressBar::chunk { background-color: #05B8CC; } " - ) + cssStyleData =""" + QProgressBar { + border: 2px solid grey; + border-radius: 5px; + text-align: center; + } + + QProgressBar::chunk { + background: qlineargradient(x1: 0.5, y1: 0, x2: 0.5, y2: 1, stop: 0 #b366ff, stop: 1 #d9b3ff); + width: 10px; + }""" + self.setStyleSheet(cssStyleData) self._total_files_size = total_files_size self._processed_size = 0 From 84e167333ec8a947c44ca03c93bb9bd4d7da5db2 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Mon, 29 May 2017 09:14:23 +1000 Subject: [PATCH 2/4] Improve the Zip progressbar style a little bit --- onionshare_gui/onionshare_gui.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index a80f4671..563dc8ce 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -467,18 +467,19 @@ class ZipProgressBar(QtWidgets.QProgressBar): def __init__(self, total_files_size): super(ZipProgressBar, self).__init__() - self.setMaximumHeight(15) + self.setMaximumHeight(20) self.setMinimumWidth(200) self.setValue(0) self.setFormat(strings._('zip_progress_bar_format')) cssStyleData =""" QProgressBar { - border: 2px solid grey; - border-radius: 5px; + background-color: rgba(255, 255, 255, 0.0) !important; + border: 0px; text-align: center; } QProgressBar::chunk { + border: 0px; background: qlineargradient(x1: 0.5, y1: 0, x2: 0.5, y2: 1, stop: 0 #b366ff, stop: 1 #d9b3ff); width: 10px; }""" From 6ad8b888325c7a3d37b903a74e424649258c469e Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Mon, 29 May 2017 15:44:04 +1000 Subject: [PATCH 3/4] Make the tor connection progressBar similarly style as the others --- onionshare_gui/tor_connection_dialog.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/onionshare_gui/tor_connection_dialog.py b/onionshare_gui/tor_connection_dialog.py index 93c03bef..120036fd 100644 --- a/onionshare_gui/tor_connection_dialog.py +++ b/onionshare_gui/tor_connection_dialog.py @@ -43,6 +43,19 @@ class TorConnectionDialog(QtWidgets.QProgressDialog): self.setModal(True) self.setFixedSize(400, 150) + cssStyleData =""" + QProgressBar { + border: 2px solid grey; + border-radius: 5px; + text-align: center; + } + + QProgressBar::chunk { + background: qlineargradient(x1: 0.5, y1: 0, x2: 0.5, y2: 1, stop: 0 #b366ff, stop: 1 #d9b3ff); + width: 10px; + }""" + self.setStyleSheet(cssStyleData) + # Label self.setLabelText(strings._('connecting_to_tor', True)) From 506cb55bc16696dd6dd4a571d883b691b0c38cb2 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Mon, 29 May 2017 15:46:28 +1000 Subject: [PATCH 4/4] Revert "Make the tor connection progressBar similarly style as the others" This reverts commit 6ad8b888325c7a3d37b903a74e424649258c469e. --- onionshare_gui/tor_connection_dialog.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/onionshare_gui/tor_connection_dialog.py b/onionshare_gui/tor_connection_dialog.py index 120036fd..93c03bef 100644 --- a/onionshare_gui/tor_connection_dialog.py +++ b/onionshare_gui/tor_connection_dialog.py @@ -43,19 +43,6 @@ class TorConnectionDialog(QtWidgets.QProgressDialog): self.setModal(True) self.setFixedSize(400, 150) - cssStyleData =""" - QProgressBar { - border: 2px solid grey; - border-radius: 5px; - text-align: center; - } - - QProgressBar::chunk { - background: qlineargradient(x1: 0.5, y1: 0, x2: 0.5, y2: 1, stop: 0 #b366ff, stop: 1 #d9b3ff); - width: 10px; - }""" - self.setStyleSheet(cssStyleData) - # Label self.setLabelText(strings._('connecting_to_tor', True))