mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Viewer: Add a control to quit the viewer useful on touchscreens. Fixes #1862441 [Feature request: dedicated 'quit' option in viewer menu](https://bugs.launchpad.net/calibre/+bug/1862441)
This commit is contained in:
parent
1e07b48116
commit
a370e028a3
1
imgsrc/srv/window-restore.svg
Normal file
1
imgsrc/srv/window-restore.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="M464 0H144c-26.5 0-48 21.5-48 48v48H48c-26.5 0-48 21.5-48 48v320c0 26.5 21.5 48 48 48h320c26.5 0 48-21.5 48-48v-48h48c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zm-96 464H48V256h320v208zm96-96h-48V144c0-26.5-21.5-48-48-48H144V48h320v320z"/></svg>
|
After Width: | Height: | Size: 344 B |
@ -176,6 +176,7 @@ class EbookViewer(MainWindow):
|
||||
self.web_view.show_error.connect(self.show_error)
|
||||
self.web_view.print_book.connect(self.print_book, type=Qt.QueuedConnection)
|
||||
self.web_view.reset_interface.connect(self.reset_interface, type=Qt.QueuedConnection)
|
||||
self.web_view.quit.connect(self.quit, type=Qt.QueuedConnection)
|
||||
self.web_view.shortcuts_changed.connect(self.shortcuts_changed)
|
||||
self.actions_toolbar.initialize(self.web_view, self.search_dock.toggleViewAction())
|
||||
self.setCentralWidget(self.web_view)
|
||||
|
@ -270,6 +270,7 @@ class ViewerBridge(Bridge):
|
||||
print_book = from_js()
|
||||
clear_history = from_js()
|
||||
reset_interface = from_js()
|
||||
quit = from_js()
|
||||
customize_toolbar = from_js()
|
||||
|
||||
create_view = to_js()
|
||||
@ -440,6 +441,7 @@ class WebView(RestartingWebEngineView):
|
||||
show_error = pyqtSignal(object, object, object)
|
||||
print_book = pyqtSignal()
|
||||
reset_interface = pyqtSignal()
|
||||
quit = pyqtSignal()
|
||||
customize_toolbar = pyqtSignal()
|
||||
shortcuts_changed = pyqtSignal(object)
|
||||
paged_mode_changed = pyqtSignal()
|
||||
@ -487,6 +489,7 @@ class WebView(RestartingWebEngineView):
|
||||
self.bridge.print_book.connect(self.print_book)
|
||||
self.bridge.clear_history.connect(self.clear_history)
|
||||
self.bridge.reset_interface.connect(self.reset_interface)
|
||||
self.bridge.quit.connect(self.quit)
|
||||
self.bridge.customize_toolbar.connect(self.customize_toolbar)
|
||||
self.bridge.export_shortcut_map.connect(self.set_shortcut_map)
|
||||
self.shortcut_map = {}
|
||||
|
@ -339,7 +339,9 @@ class MainOverlay: # {{{
|
||||
ac(_('Inspector'), _('Show the content inspector'),
|
||||
def(): self.overlay.hide(), ui_operations.toggle_inspector();, 'bug'),
|
||||
ac(_('Reset interface'), _('Reset viewer panels, toolbars and scrollbars to defaults'),
|
||||
def(): self.overlay.hide(), ui_operations.reset_interface();, 'remove'),
|
||||
def(): self.overlay.hide(), ui_operations.reset_interface();, 'window-restore'),
|
||||
ac(_('Quit'), _('Close the viewer'),
|
||||
def(): self.overlay.hide(), ui_operations.quit();, 'remove'),
|
||||
))
|
||||
container.appendChild(set_css(E.div(class_=MAIN_OVERLAY_TS_CLASS, # top section
|
||||
onclick=def (evt):evt.stopPropagation();,
|
||||
|
@ -361,6 +361,8 @@ if window is window.top:
|
||||
sd.set('footer', defaults.footer)
|
||||
view.update_header_footer()
|
||||
to_python.reset_interface()
|
||||
ui_operations.quit = def():
|
||||
to_python.quit()
|
||||
ui_operations.toggle_lookup = def():
|
||||
to_python.toggle_lookup()
|
||||
ui_operations.selection_changed = def(selected_text):
|
||||
|
Loading…
x
Reference in New Issue
Block a user