This commit is contained in:
Kovid Goyal 2021-01-26 09:51:52 +05:30
parent da53430e77
commit ce33ebe682
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -110,11 +110,7 @@ def apply_colors(is_content_popup):
border-radius: 50%;\ border-radius: 50%;\
} }
''' '''
hints_box_css = f'''
# reference mode hint box
text += f'''\n\n
.calibre-reference-mode [data-calibre-ref-num]::before {{
content: attr(data-calibre-ref-num) !important;\
display: inline-block !important;\ display: inline-block !important;\
position: absolute !important;\ position: absolute !important;\
text-indent: 0 !important;\ text-indent: 0 !important;\
@ -125,6 +121,13 @@ def apply_colors(is_content_popup):
cursor: default !important;\ cursor: default !important;\
padding: 1px !important;\ padding: 1px !important;\
border: solid 1px {opts.color_scheme.foreground} !important;\ border: solid 1px {opts.color_scheme.foreground} !important;\
'''
# reference mode hint box
text += f'''\n\n
.calibre-reference-mode [data-calibre-ref-num]::before {{
content: attr(data-calibre-ref-num) !important;\
{hints_box_css}
}} }}
''' '''
@ -132,17 +135,7 @@ def apply_colors(is_content_popup):
text += f'''\n\n text += f'''\n\n
.calibre-hint-visible::before {{ .calibre-hint-visible::before {{
content: attr(data-calibre-hint-render) !important;\ content: attr(data-calibre-hint-render) !important;\
display: inline-block !important;\ {hints_box_css}
position: absolute !important;\
text-indent: 0 !important;\
text-decoration: none !important;\
font-weight: bold !important;\
color: {selfg} !important;\
background: {selbg} !important;\
cursor: default !important;\
padding: 1px !important;\
border: solid 1px {opts.color_scheme.foreground} !important;\
}} }}
.calibre-hint-enter::before {{ .calibre-hint-enter::before {{