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)

This commit is contained in:
Kovid Goyal 2019-11-10 08:06:19 +05:30
parent 263bb0ce88
commit bc5166d99a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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'),
)