From edbbe9377cac09d1c6063e23a09f68d925fa6acd Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Fri, 28 Sep 2018 13:24:44 -0700 Subject: [PATCH] Add a toggle downloads button to share mode, and add new toggle upload and download images --- onionshare_gui/share_mode/__init__.py | 15 +++++++++++++++ share/images/downloads_toggle.png | Bin 0 -> 380 bytes share/images/downloads_toggle_selected.png | Bin 0 -> 468 bytes share/images/uploads_toggle.png | Bin 0 -> 389 bytes share/images/uploads_toggle_selected.png | Bin 0 -> 473 bytes 5 files changed, 15 insertions(+) create mode 100644 share/images/downloads_toggle.png create mode 100644 share/images/downloads_toggle_selected.png create mode 100644 share/images/uploads_toggle.png create mode 100644 share/images/uploads_toggle_selected.png diff --git a/onionshare_gui/share_mode/__init__.py b/onionshare_gui/share_mode/__init__.py index c097d75a..7e444137 100644 --- a/onionshare_gui/share_mode/__init__.py +++ b/onionshare_gui/share_mode/__init__.py @@ -89,11 +89,20 @@ class ShareMode(Mode): self.update_downloads_completed() self.update_downloads_in_progress() + self.info_toggle_button = QtWidgets.QPushButton() + self.info_toggle_button.setDefault(False) + self.info_toggle_button.setFixedWidth(30) + self.info_toggle_button.setFixedHeight(30) + self.info_toggle_button.setFlat(True) + self.info_toggle_button.setIcon( QtGui.QIcon(self.common.get_resource_path('images/downloads_toggle.png')) ) + self.info_toggle_button.clicked.connect(self.toggle_downloads) + self.info_layout = QtWidgets.QHBoxLayout() self.info_layout.addWidget(self.info_label) self.info_layout.addStretch() self.info_layout.addWidget(self.info_in_progress_downloads_count) self.info_layout.addWidget(self.info_completed_downloads_count) + self.info_layout.addWidget(self.info_toggle_button) self.info_widget = QtWidgets.QWidget() self.info_widget.setLayout(self.info_layout) @@ -353,6 +362,12 @@ class ShareMode(Mode): self.info_in_progress_downloads_count.setText(' {1:d}'.format(image, self.downloads_in_progress)) self.info_in_progress_downloads_count.setToolTip(strings._('info_in_progress_downloads_tooltip', True).format(self.downloads_in_progress)) + def toggle_downloads(self): + """ + Toggle showing and hiding the Downloads widget + """ + pass + @staticmethod def _compute_total_size(filenames): total_size = 0 diff --git a/share/images/downloads_toggle.png b/share/images/downloads_toggle.png new file mode 100644 index 0000000000000000000000000000000000000000..846ececb367e96250c0f48218be55aba4a76b1a1 GIT binary patch literal 380 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPdr;G@g6&%$AH35qVFC(D|_}@I;7oC^gF*}4f}GxzNVDIkBl-}8P}UM9tkP>Ccm={ zp7egs;qUqZ4NE323GCb)BE)Q3@L*2#$9w(7d-4wc`8)r!%rtJc`3L+>IMv zCQrGYDRDJ;$Ghi8irFUlHEvh=cfC1N%VcwV3D@<+$NQq*T@Je(pV4a3{Mm=I_Xlga XzWd9M4j1nN!->Ju)z4*}Q$iB}!flz# literal 0 HcmV?d00001 diff --git a/share/images/downloads_toggle_selected.png b/share/images/downloads_toggle_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..127ce20806c715eaecbfce44f6a5907f5c769abc GIT binary patch literal 468 zcmV;_0W1EAP)!ax{?-(K5mfWe8FsFPvnLZ}hLPatt~Xq(QCCj1c=V)QQnmVwRxU?{|B zNE{548X^G(Bcyj}&p{ywrSx6y%Xi=V*D08|`Z`>#Ma%Yg7 zl4HzXXI;Sr0RV|gVLF#SZ9Fs{6DQFrImUc2_W&SuoGM0{{{d{nzLsQZuzD#1arl?S z_jO~l+pGbAvS|2k{uKy95Qv0%s>Me+p_VVuj4O6IuqBWH0000< KMNUMnLSTX_O~}&# literal 0 HcmV?d00001 diff --git a/share/images/uploads_toggle.png b/share/images/uploads_toggle.png new file mode 100644 index 0000000000000000000000000000000000000000..87303c9ffb4b08be932a0f38109ab8559b8ed668 GIT binary patch literal 389 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPdr;G@%@Twi_92giFg*;sxLo81BPEz!CaTGXS|K7&p zf=X6^-m1WsgGrlyFdj+TZ5Fxl#M0G=I@Jzu`OUzdcG=Z&Tf`Pg(+YV9maRRT_H6%s z@Ave(bAO)CFHhgDpd1>@E?2uVJuP1|J}~$X%bKbe%r`t8#e|L?KcKsT^G`(ur-i`8 zN{)w?+yPgEA28iuh-*xJAYH-u>%hK_5@!y6(S}uVjP3`-3)s&zIQz$2ZQy^?b)t;p zq1*yt*#rh1CShZ1{rI!V!ryuRJu*z-;yL?9?Yq%D>0R5IBxc^6!nQL#gz?EeOXi>7 z%d%_sW;Dm0yRwpTP3p6^OIIa_%3iPRI#I*4XZj~?yK};|Gp1G-@Yeit&sw~8ncSA3 gnx@T1M5VrR%L@9=OnY-s8W>;zopr0Bru3NdN!< literal 0 HcmV?d00001 diff --git a/share/images/uploads_toggle_selected.png b/share/images/uploads_toggle_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..0ba52cffb17cc54bd2870e13b946544be6326818 GIT binary patch literal 473 zcmV;~0Ve*5P)u`GL1Cu-RzAm`=b`fGgw0I|c^3t{Aa^|rbNfcRP^Fp1dWicnVScd6-ffTEC z$K5)1pgZo?S&G$s0%3a&f}2Z2Sq`MY|E@dO?%w9vp#Q%h=jDN%mj_WC;<~^V5y;fz z;s^kUKt8;Mol&O=0I^NLm>GAVa6rNLG}w$D;-1(#kdCE$Zwrz5{C$1^GdYWv3kMYo P00000NkvXXu0mjf=2^q% literal 0 HcmV?d00001