mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1929177 [[Enhancement - Viewer] Move search bar to the top of the ToC page](https://bugs.launchpad.net/calibre/+bug/1929177)
This commit is contained in:
parent
de4bee60eb
commit
226678e514
@ -479,6 +479,8 @@ class TOCOverlay(SimpleOverlay): # {{{
|
||||
self.title = title or _('Table of Contents')
|
||||
|
||||
def show(self, container):
|
||||
container.appendChild(E.div())
|
||||
container = container.firstChild
|
||||
simple_overlay_title(self.title, self.overlay, container)
|
||||
self.create_func(self.overlay.view.book, container, self.handle_activate)
|
||||
|
||||
|
@ -172,7 +172,7 @@ def create_toc_panel(book, container, onclick):
|
||||
onclick(li.dataset.tocDest, li.dataset.tocFrag)
|
||||
toc_panel = create_toc_tree(book.manifest.toc, handle_click)
|
||||
toc_panel_id = ensure_id(toc_panel)
|
||||
set_css(container, display='flex', flex_direction='column')
|
||||
set_css(container, display='flex', flex_direction='column', height='100%', min_height='100%', overflow='hidden', max_height='100vh', max_width='100vw')
|
||||
set_css(toc_panel, flex_grow='10')
|
||||
container.appendChild(toc_panel)
|
||||
search_button = E.div(class_='simple-link', svgicon('search'))
|
||||
@ -180,6 +180,11 @@ def create_toc_panel(book, container, onclick):
|
||||
search_bar = create_search_bar(do_search.bind(toc_panel_id), 'search-book-toc', button=search_button, placeholder=t)
|
||||
set_css(search_bar, flex_grow='10', margin_right='1em')
|
||||
container.appendChild(E.div(style='margin: 1ex 1em; display: flex; align-items: center', search_bar, search_button))
|
||||
for child in container.childNodes:
|
||||
child.style.flexShrink = '0'
|
||||
toc_panel.style.flexGrow = '100'
|
||||
toc_panel.style.flexShrink = '1'
|
||||
toc_panel.style.overflow = 'auto'
|
||||
|
||||
|
||||
def current_toc_anchor_map(tam, anchor_funcs):
|
||||
|
Loading…
x
Reference in New Issue
Block a user