From 6ae419441bef765df2d35dbae091700451bbeb8a Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Sun, 6 Nov 2016 00:08:01 +0300 Subject: [PATCH] bug fixes --- toxygen/contact.py | 2 +- toxygen/mainscreen.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/toxygen/contact.py b/toxygen/contact.py index 711a6ed..28c6442 100644 --- a/toxygen/contact.py +++ b/toxygen/contact.py @@ -120,7 +120,7 @@ class Contact(basecontact.BaseContact): """ Delete old messages (reduces RAM if messages saving is not enabled) """ - old = filter(lambda x: x.get_type() in (2, 3) and (x.get_status() >= 2 or x.get_status() is None), + old = filter(lambda x: x.get_type() == 2 and (x.get_status() >= 2 or x.get_status() is None), self._corr[:-SAVE_MESSAGES]) old = list(old) l = max(len(self._corr) - SAVE_MESSAGES, 0) - len(old) diff --git a/toxygen/mainscreen.py b/toxygen/mainscreen.py index baa7ae2..8d7f937 100644 --- a/toxygen/mainscreen.py +++ b/toxygen/mainscreen.py @@ -272,6 +272,7 @@ class MainWindow(QtGui.QMainWindow, Singleton): self.friends_list.setVerticalScrollMode(QtGui.QAbstractItemView.ScrollPerPixel) self.friends_list.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) self.friends_list.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) + self.friends_list.verticalScrollBar().setContextMenuPolicy(QtCore.Qt.NoContextMenu) def setup_right_center(self, widget): self.messages = QtGui.QListWidget(widget) @@ -281,6 +282,7 @@ class MainWindow(QtGui.QMainWindow, Singleton): self.messages.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) self.messages.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.messages.focusOutEvent = lambda event: self.messages.clearSelection() + self.messages.verticalScrollBar().setContextMenuPolicy(QtCore.Qt.NoContextMenu) def load(pos): if not pos: @@ -372,8 +374,8 @@ class MainWindow(QtGui.QMainWindow, Singleton): self.close() def resizeEvent(self, *args, **kwargs): - self.messages.setGeometry(0, 0, self.width() - 270, self.height() - 158) - self.friends_list.setGeometry(0, 0, 270, self.height() - 125) + self.messages.setGeometry(0, 0, self.width() - 270, self.height() - 159) + self.friends_list.setGeometry(0, 0, 270, self.height() - 129) self.videocallButton.setGeometry(QtCore.QRect(self.width() - 330, 10, 50, 50)) self.callButton.setGeometry(QtCore.QRect(self.width() - 390, 10, 50, 50))