Use a home icon instead of close for the book list

This commit is contained in:
Kovid Goyal 2017-02-07 09:41:27 +05:30
parent 97860d01f0
commit 145b39859e
3 changed files with 8 additions and 5 deletions

View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1792" height="1792" viewBox="0 0 1792 1792" version="1.1">
<path d="m 1395,364.99998 -531,531 L 1395,1427 q 19,19 19,45 0,26 -19,45 l -166,166 q -19,19 -45,19 -26,0 -45,-19 L 397,940.99998 q -19,-19 -19,-45 0,-26 19,-45 l 742,-742 q 19,-18.999999 45,-18.999999 26,0 45,18.999999 l 166,166 q 19,19 19,45 0,26 -19,45 z" />
</svg>

After

Width:  |  Height:  |  Size: 377 B

View File

@ -47,9 +47,9 @@ def get_bars(container_id):
container = document.getElementById(container_id) container = document.getElementById(container_id)
return container.getElementsByClassName(CLASS_NAME) return container.getElementsByClassName(CLASS_NAME)
def set_left_data(container_id, title='calibre', icon_name='heart', action=None, tooltip='', run_animation=False, title_action=None, title_tooltip=None): def set_left_data(container_id, title='calibre', icon='heart', action=None, tooltip='', run_animation=False, title_action=None, title_tooltip=None):
bars = get_bars(container_id) bars = get_bars(container_id)
if icon_name is 'heart': if icon is 'heart':
if not tooltip: if not tooltip:
tooltip = _('Donate to support calibre development') tooltip = _('Donate to support calibre development')
@ -57,12 +57,12 @@ def set_left_data(container_id, title='calibre', icon_name='heart', action=None,
left = bar.firstChild left = bar.firstChild
clear(left) clear(left)
title_elem = 'a' if callable(title_action) else 'span' title_elem = 'a' if callable(title_action) else 'span'
left.appendChild(E.a(title=tooltip, svgicon(icon_name))) left.appendChild(E.a(title=tooltip, svgicon(icon)))
left.appendChild(E(title_elem, title, title=title_tooltip, class_='top-bar-title', left.appendChild(E(title_elem, title, title=title_tooltip, class_='top-bar-title',
style='margin-left: {0}; font-weight: bold; padding-top: {1}; padding-bottom: {1}; vertical-align: middle'.format(SPACING, VSPACING))) style='margin-left: {0}; font-weight: bold; padding-top: {1}; padding-bottom: {1}; vertical-align: middle'.format(SPACING, VSPACING)))
if i is 0: if i is 0:
a = left.firstChild a = left.firstChild
if icon_name is 'heart': if icon is 'heart':
set_css(a, set_css(a,
animation_name=THROBBER_NAME, animation_duration='1s', animation_timing_function='ease-in-out', animation_name=THROBBER_NAME, animation_duration='1s', animation_timing_function='ease-in-out',
animation_iteration_count='5', animation_play_state='running' if run_animation else 'paused' animation_iteration_count='5', animation_play_state='running' if run_animation else 'paused'

View File

@ -182,7 +182,7 @@ def init(container_id):
container = document.getElementById(container_id) container = document.getElementById(container_id)
lid = container.dataset.library_id = current_library_id() lid = container.dataset.library_id = current_library_id()
title = interface_data.library_map[lid] title = interface_data.library_map[lid]
create_top_bar(container_id, title=title, action=back, icon='close') create_top_bar(container_id, title=title, action=back, icon='home')
container.appendChild(E.div()) container.appendChild(E.div())
container.lastChild.appendChild(E.div(_('Loading books from the {} calibre library, please wait...').format(title), style='margin: 1ex 1em')) container.lastChild.appendChild(E.div(_('Loading books from the {} calibre library, please wait...').format(title), style='margin: 1ex 1em'))
conditional_timeout(container_id, 5, check_for_books_loaded) conditional_timeout(container_id, 5, check_for_books_loaded)