mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Viewer: Also apply changes to preferences when pressing esc as there are a number of people who do this and then complain that the preferences dont stick, and I have only so much patience
This commit is contained in:
parent
b1ef8dc2fb
commit
a2708e8ea2
@ -421,7 +421,10 @@ class PrefsOverlay: # {{{
|
||||
def show(self, container):
|
||||
self.changes_occurred = False
|
||||
container.style.backgroundColor = get_color('window-background')
|
||||
create_prefs_panel(container, self.overlay.hide_current_panel, def():self.changes_occurred=True;)
|
||||
self.prefs = create_prefs_panel(container, self.overlay.hide_current_panel, def():self.changes_occurred=True;)
|
||||
|
||||
def handle_escape(self):
|
||||
self.prefs.onclose()
|
||||
|
||||
def on_hide(self):
|
||||
if self.changes_occurred:
|
||||
@ -530,7 +533,10 @@ class Overlay:
|
||||
if self.panels.length:
|
||||
p = self.panels[-1]
|
||||
if not p.is_not_escapable:
|
||||
self.hide_current_panel()
|
||||
if p.handle_escape:
|
||||
p.handle_escape()
|
||||
else:
|
||||
self.hide_current_panel()
|
||||
return True
|
||||
return False
|
||||
|
||||
|
@ -140,4 +140,4 @@ class Prefs:
|
||||
|
||||
|
||||
def create_prefs_panel(container, close_func, on_change):
|
||||
Prefs(container, close_func, on_change)
|
||||
return Prefs(container, close_func, on_change)
|
||||
|
Loading…
x
Reference in New Issue
Block a user