Viewer: Fix disabling the fullscreen help message causing the Esc key to stop working

This commit is contained in:
Kovid Goyal 2012-11-23 15:46:59 +05:30
parent 68c77002af
commit 7fc2c30ed2

View File

@ -510,17 +510,18 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
def show_full_screen_label(self): def show_full_screen_label(self):
f = self.full_screen_label f = self.full_screen_label
self.esc_full_screen_action.setEnabled(True) self.esc_full_screen_action.setEnabled(True)
f.setVisible(True)
height = 200 height = 200
width = int(0.7*self.view.width()) width = int(0.7*self.view.width())
f.resize(width, height) f.resize(width, height)
f.move((self.view.width() - width)//2, (self.view.height()-height)//2) f.move((self.view.width() - width)//2, (self.view.height()-height)//2)
a = self.full_screen_label_anim if self.view.document.show_fullscreen_help:
a.setDuration(500) f.setVisible(True)
a.setStartValue(QSize(width, 0)) a = self.full_screen_label_anim
a.setEndValue(QSize(width, height)) a.setDuration(500)
a.start() a.setStartValue(QSize(width, 0))
QTimer.singleShot(3500, self.full_screen_label.hide) a.setEndValue(QSize(width, height))
a.start()
QTimer.singleShot(3500, self.full_screen_label.hide)
self.view.document.switch_to_fullscreen_mode() self.view.document.switch_to_fullscreen_mode()
if self.view.document.fullscreen_clock: if self.view.document.fullscreen_clock:
self.show_clock() self.show_clock()
@ -591,8 +592,7 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
fs = self.window_mode_changed == 'fullscreen' fs = self.window_mode_changed == 'fullscreen'
self.window_mode_changed = None self.window_mode_changed = None
if fs: if fs:
if self.view.document.show_fullscreen_help: self.show_full_screen_label()
self.show_full_screen_label()
else: else:
self.view.document.switch_to_window_mode() self.view.document.switch_to_window_mode()
self.view.document.page_position.restore() self.view.document.page_position.restore()