mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-04 20:08:01 +01: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
2 changed files with 9 additions and 3 deletions
|
|
@ -421,7 +421,10 @@ def on_container_click(self, evt):
|
|||
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 @@ def handle_escape(self):
|
|||
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 @@ def close_scrolling(self):
|
|||
|
||||
|
||||
def create_prefs_panel(container, close_func, on_change):
|
||||
Prefs(container, close_func, on_change)
|
||||
return Prefs(container, close_func, on_change)
|
||||
|
|
|
|||
Loading…
Reference in a new issue