From 59ad6b3ffae99c50a092c4d256674b749975686e Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Wed, 23 Mar 2016 18:22:32 +0300 Subject: [PATCH] screenshot window update --- src/file_transfers.py | 6 ++++-- src/mainscreen.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/file_transfers.py b/src/file_transfers.py index a5ddbd9..5088fc6 100644 --- a/src/file_transfers.py +++ b/src/file_transfers.py @@ -47,11 +47,13 @@ class FileTransfer(QtCore.QObject): def cancel(self): self.send_control(TOX_FILE_CONTROL['CANCEL']) - self._file.close() + if hasattr(self, '_file'): + self._file.close() self._state_changed.signal.emit(self.state, self._done / self._size) def cancelled(self): - self._file.close() + if hasattr(self, '_file'): + self._file.close() self._state_changed.signal.emit(TOX_FILE_CONTROL['CANCEL'], self._done / self._size) def send_control(self, control): diff --git a/src/mainscreen.py b/src/mainscreen.py index 444f297..ef46c7f 100644 --- a/src/mainscreen.py +++ b/src/mainscreen.py @@ -379,9 +379,10 @@ class ScreenShotWindow(QtGui.QWidget): super(ScreenShotWindow, self).__init__() self.rubberband = QtGui.QRubberBand(QtGui.QRubberBand.Rectangle, self) self.setMouseTracking(True) - self.setWindowFlags(self.windowFlags() | QtCore.Qt.FramelessWindowHint | QtCore.Qt.FramelessWindowHint) + self.setWindowFlags(self.windowFlags() | QtCore.Qt.FramelessWindowHint | QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint) self.setAttribute(QtCore.Qt.WA_TranslucentBackground) self.showFullScreen() + self.setStyleSheet('QWidget { background-color: rgba(255, 255, 255, 190); }') def mousePressEvent(self, event): self.origin = event.pos()