From 3f65b62e967d7aafc42b5bedd24fb3308d6ec4da Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 22 Sep 2021 10:43:58 +0530 Subject: [PATCH] Fix #1944487 [TOC not aligned properly when screen width not enough](https://bugs.launchpad.net/calibre/+bug/1944487) --- src/pyj/widgets.pyj | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pyj/widgets.pyj b/src/pyj/widgets.pyj index fbf1a45bbe..afe1ab6704 100644 --- a/src/pyj/widgets.pyj +++ b/src/pyj/widgets.pyj @@ -122,6 +122,12 @@ def create_tree(root, populate_data, onclick): li.lastChild.style.display = 'none' change_icon_image(li.firstChild.firstChild, 'caret-right') + def bullet(icon): + ans = svgicon(icon, '2ex', '2ex') + ans.style.minWidth = '2ex' + ans.style.minHeight = '2ex' + return ans + def process_node(node, parent_container, level): if node.children?.length: ul = E.div() @@ -130,7 +136,7 @@ def create_tree(root, populate_data, onclick): icon = 'caret-right' if child.children?.length else None li = E.div(style='display:flex; flex-direction:column; margin: 1ex 1em; margin-left: {}em'.format(level+1), E.div(style='display:flex; align-items: center', - svgicon(icon), + bullet(icon), E.span('\xa0'), E.a( href='javascript: void(0)',