From bc5166d99a5a59a363961b40c392d71ed161cdff Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 10 Nov 2019 08:06:19 +0530 Subject: [PATCH] Improve formatting of preferences button box on small screens. Fixes #1851930 [Large Reset button in the Viewer settings](https://bugs.launchpad.net/calibre/+bug/1851930) --- src/pyj/read_book/prefs/utils.pyj | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/pyj/read_book/prefs/utils.pyj b/src/pyj/read_book/prefs/utils.pyj index 98960a01c9..ea860c6ec5 100644 --- a/src/pyj/read_book/prefs/utils.pyj +++ b/src/pyj/read_book/prefs/utils.pyj @@ -13,13 +13,12 @@ def create_button_box(restore_defaults_func, apply_func, cancel_func): if restore_defaults_func: rbutton = create_button(_('Restore defaults'), action=restore_defaults_func) else: - rbutton = restore_defaults_func or E.div('\xa0') - cbutton.style.marginLeft = '1rem' + rbutton = E.div('\xa0') + obutton = create_button(_('OK'), action=apply_func) + for b in (rbutton, obutton, cbutton): + b.style.marginTop = '1ex' return E.div( - style='margin-top: 1rem; display: flex; justify-content: space-between', + style='margin-top: 1rem; display: flex; justify-content: space-between; align-items: flex-start', rbutton, - E.div( - create_button(_('OK'), action=apply_func), - cbutton - ), + E.div(obutton, E.div('\xa0'), cbutton, style='margin-left: 1rem; display: flex; align-items: flex-start; flex-wrap: wrap'), )