mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 00:13:50 +02:00
Start work on viewer search
This commit is contained in:
parent
a952cdd548
commit
0cf7ab6a2b
2 changed files with 20 additions and 1 deletions
15
src/pyj/read_book/search.pyj
Normal file
15
src/pyj/read_book/search.pyj
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# vim:fileencoding=utf-8
|
||||
# License: GPL v3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
from __python__ import hash_literals, bound_methods
|
||||
|
||||
class SearchOverlay:
|
||||
|
||||
def __init__(self, view):
|
||||
self.view = view
|
||||
|
||||
@property
|
||||
def container(self):
|
||||
return document.getElementById('book-search-overlay')
|
||||
|
||||
def hide(self):
|
||||
self.container.style.display = 'none'
|
||||
|
|
@ -11,6 +11,7 @@
|
|||
from read_book.globals import messenger, iframe_id, current_book, set_current_spine_item
|
||||
from read_book.resources import load_resources
|
||||
from read_book.overlay import Overlay
|
||||
from read_book.search import SearchOverlay
|
||||
from read_book.prefs.colors import resolve_color_scheme
|
||||
from read_book.prefs.font_size import change_font_size_by
|
||||
from read_book.touch import set_left_margin_handler, set_right_margin_handler
|
||||
|
|
@ -67,11 +68,13 @@ def __init__(self, container, ui):
|
|||
E.div(style='height:{}px; width:100%; padding: 0'.format(sd.get('margin_bottom', 20)), id='book-bottom-margin'),
|
||||
),
|
||||
right_margin,
|
||||
E.div(style='position: absolute; top:0; left:0; width: 100%; height: 100%; display:none', id='book-overlay'), # overlay
|
||||
E.div(style='position: absolute; top:0; left:0; width: 100%; display:none', id='book-search-overlay'), # search overlay
|
||||
E.div(style='position: absolute; top:0; left:0; width: 100%; height: 100%; display:none', id='book-overlay'), # main overlay
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
self.search_overlay = SearchOverlay(self)
|
||||
self.overlay = Overlay(self)
|
||||
self.src_doc = None
|
||||
self.iframe_ready = False
|
||||
|
|
@ -121,6 +124,7 @@ def bump_font_size(self, data):
|
|||
change_font_size_by(delta)
|
||||
|
||||
def show_chrome(self):
|
||||
self.search_overlay.hide()
|
||||
self.overlay.show()
|
||||
|
||||
def set_margins(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue