From 7a817eb82a0e8eb06afe2bb56ed848fda56f33b9 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Sun, 18 Jun 2017 13:05:26 +0300 Subject: [PATCH] icons fixes --- toxygen/mainscreen.py | 8 +++++--- toxygen/profile.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/toxygen/mainscreen.py b/toxygen/mainscreen.py index 669ec65..834ae32 100644 --- a/toxygen/mainscreen.py +++ b/toxygen/mainscreen.py @@ -567,13 +567,15 @@ class MainWindow(QtWidgets.QMainWindow, Singleton): def call_finished(self): self.update_call_state('call') - def update_call_state(self, fl): + def update_call_state(self, state): os.chdir(curr_directory() + '/images/') - pixmap = QtGui.QPixmap(curr_directory() + '/images/{}.png'.format(fl)) + + pixmap = QtGui.QPixmap(curr_directory() + '/images/{}.png'.format(state)) icon = QtGui.QIcon(pixmap) self.callButton.setIcon(icon) self.callButton.setIconSize(QtCore.QSize(50, 50)) - pixmap = QtGui.QPixmap(curr_directory() + '/images/{}_video.png') + + pixmap = QtGui.QPixmap(curr_directory() + '/images/{}_video.png'.format(state)) icon = QtGui.QIcon(pixmap) self.videocallButton.setIcon(icon) self.videocallButton.setIconSize(QtCore.QSize(35, 35)) diff --git a/toxygen/profile.py b/toxygen/profile.py index b479cb1..32d9abd 100644 --- a/toxygen/profile.py +++ b/toxygen/profile.py @@ -1257,7 +1257,7 @@ class Profile(basecontact.BaseContact, Singleton): if hasattr(self, '_call_widget'): self._call_widget[friend_number].close() del self._call_widget[friend_number] - threading.Timer(3.0, lambda: cv2.destroyWindow(str(friend_number))).start() + threading.Timer(2.0, lambda: cv2.destroyWindow(str(friend_number))).start() friend = self.get_friend_by_number(friend_number) friend.append_message(InfoMessage(text, time.time())) if friend_number == self.get_active_number():