From 5d84cd791347a9bf1cd8af0a076256fc3c8982ff Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 13 Nov 2015 14:55:28 +0530 Subject: [PATCH] Use a spinner when fetching more books --- src/pyj/book_list/views.pyj | 4 ++-- src/pyj/widgets.pyj | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pyj/book_list/views.pyj b/src/pyj/book_list/views.pyj index e1357c3f41..dda7516759 100644 --- a/src/pyj/book_list/views.pyj +++ b/src/pyj/book_list/views.pyj @@ -8,7 +8,7 @@ from gettext import gettext as _ from modals import error_dialog from book_list.globals import get_session_data -from widgets import create_button +from widgets import create_button, create_spinner THUMBNAIL_MAX_WIDTH = 300 THUMBNAIL_MAX_HEIGHT = 400 @@ -47,7 +47,7 @@ class BooksView: set_css(more.firstChild, display='block', margin_left='auto', margin_right='auto') set_css(more, font_size='1.5rem', padding_top='1.5rem', margin_bottom='1.5rem', width='100%', text_align='center') more.appendChild(E.div( - E.i(class_='fa fa-lg fa-cloud-download'), '\xa0' + _('Fetching metadata for more books, please wait') + '…', + create_spinner(), '\xa0' + _('Fetching metadata for more books, please wait') + '…', style='margin-left:auto; margin-right:auto; display:none') ) self.update_fetching_status() diff --git a/src/pyj/widgets.pyj b/src/pyj/widgets.pyj index c6f2e59ef8..29f2e6fae6 100644 --- a/src/pyj/widgets.pyj +++ b/src/pyj/widgets.pyj @@ -26,6 +26,9 @@ create_button.style += build_rule('button.calibre-push-button:active', transform create_button.style += build_rule('button.calibre-push-button:focus', outline='none') create_button.style += build_rule('button.calibre-push-button::-moz-focus-inner', border='0') +def create_spinner(sz='lg'): + return E.i(class_='fa fa-spin fa-spinner fa-' + sz) + def get_widget_css(): ans = create_button.style return ans