Fullscreened widget closure saves settings

This commit is contained in:
BasioMeusPuga
2018-03-02 19:03:20 +05:30
parent 11ab2db5ea
commit c2850a9c77
4 changed files with 15 additions and 4 deletions

View File

@@ -207,6 +207,10 @@ class Tab(QtWidgets.QWidget):
self.exit_fs.setContext(QtCore.Qt.ApplicationShortcut)
self.exit_fs.activated.connect(self.exit_fullscreen)
# TODO
# See why Ctrl + Q stop working on a non fullscreened contentView
# widget in case the following is in code
# self.exit_all = QtWidgets.QShortcut(
# QtGui.QKeySequence('Ctrl+Q'), self.contentView)
# self.exit_all.activated.connect(self.sneaky_exit)
@@ -466,6 +470,10 @@ class PliantQGraphicsView(QtWidgets.QGraphicsView):
self.setCursor(QtCore.Qt.ArrowCursor)
self.parent.mouse_hide_timer.start(3000)
def closeEvent(self, *args):
# In case the program is closed when a contentView is fullscreened
self.main_window.closeEvent()
class PliantQTextBrowser(QtWidgets.QTextBrowser):
def __init__(self, main_window, parent=None):
@@ -519,6 +527,9 @@ class PliantQTextBrowser(QtWidgets.QTextBrowser):
else:
self.parent.metadata['position']['last_visible_text'] = visible_text
def closeEvent(self, *args):
self.main_window.closeEvent()
# def mouseMoveEvent(self, event):
# TODO
# This does not work as expected