mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Prevent selection on margin elements
This commit is contained in:
parent
7b1bf9b260
commit
f532b6f598
@ -150,7 +150,7 @@ def margin_elem(sd, which, id, onclick, oncontextmenu):
|
|||||||
fsz = min(max(0, sz - 6), maximum_font_size())
|
fsz = min(max(0, sz - 6), maximum_font_size())
|
||||||
s = '; text-overflow: ellipsis; white-space: nowrap; overflow: hidden'
|
s = '; text-overflow: ellipsis; white-space: nowrap; overflow: hidden'
|
||||||
ans = E.div(
|
ans = E.div(
|
||||||
style=f'height:{sz}px; overflow: hidden; font-size:{fsz}px; width:100%; padding: 0; display: flex; justify-content: space-between; align-items: center',
|
style=f'height:{sz}px; overflow: hidden; font-size:{fsz}px; width:100%; padding: 0; display: flex; justify-content: space-between; align-items: center; user-select: none',
|
||||||
id=id,
|
id=id,
|
||||||
E.div(style='margin-right: 1.5em' + s), E.div(style=s), E.div(style='margin-left: 1.5em' + s)
|
E.div(style='margin-right: 1.5em' + s), E.div(style=s), E.div(style='margin-left: 1.5em' + s)
|
||||||
)
|
)
|
||||||
@ -172,7 +172,7 @@ def side_margin_elem(self, sd, which):
|
|||||||
E.div(class_='arrow', style='order: 3', svgicon(f'caret-{which}', '100%', '100%')),
|
E.div(class_='arrow', style='order: 3', svgicon(f'caret-{which}', '100%', '100%')),
|
||||||
E.div(style='order:1'), E.div(style='order:2', class_='not-arrow'), E.div(style='order:4'),
|
E.div(style='order:1'), E.div(style='order:2', class_='not-arrow'), E.div(style='order:4'),
|
||||||
|
|
||||||
style='width:{}px;'.format(sd.get(f'margin_{which}', 20)),
|
style='width:{}px; user-select: none'.format(sd.get(f'margin_{which}', 20)),
|
||||||
class_='book-side-margin', id=f'book-{which}-margin',
|
class_='book-side-margin', id=f'book-{which}-margin',
|
||||||
onclick=self.side_margin_clicked.bind(None, which),
|
onclick=self.side_margin_clicked.bind(None, which),
|
||||||
oncontextmenu=self.margin_context_menu.bind(None, which),
|
oncontextmenu=self.margin_context_menu.bind(None, which),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user