Remove unused code

This commit is contained in:
Kovid Goyal 2024-11-24 14:10:16 +05:30
parent c96a330013
commit bb39475132
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 17 deletions

View File

@ -57,10 +57,6 @@ class ReadAloud:
def container(self): def container(self):
return document.getElementById('book-read-aloud-overlay') return document.getElementById('book-read-aloud-overlay')
@property
def supports_css_min_max(self):
return True
@property @property
def bar(self): def bar(self):
return document.getElementById(self.bar_id) return document.getElementById(self.bar_id)
@ -109,7 +105,7 @@ class ReadAloud:
else: else:
bar_container.classList.remove('speaking') bar_container.classList.remove('speaking')
clear(bar_container) clear(bar_container)
bar_container.style.maxWidth = 'min(40rem, 80vw)' if self.supports_css_min_max else '40rem' bar_container.style.maxWidth = 'min(40rem, 80vw)'
bar_container.style.backgroundColor = get_color("window-background") bar_container.style.backgroundColor = get_color("window-background")
for x in [ for x in [
E.div(style='height: 4ex; display: flex; align-items: center; padding: 5px; justify-content: center'), E.div(style='height: 4ex; display: flex; align-items: center; padding: 5px; justify-content: center'),

View File

@ -296,7 +296,7 @@ class SelectionBar:
notes = self.annotations_manager.notes_for_highlight(annot_id) notes = self.annotations_manager.notes_for_highlight(annot_id)
bar_container = self.bar bar_container = self.bar
clear(bar_container) clear(bar_container)
bar_container.style.maxWidth = 'min(50rem, 90vw)' if self.supports_css_min_max else '50rem' bar_container.style.maxWidth = 'min(50rem, 90vw)'
bar_container.style.backgroundColor = get_color("window-background") bar_container.style.backgroundColor = get_color("window-background")
notes_container = E.div() notes_container = E.div()
notes_container.addEventListener('wheel', def(evt): evt.stopPropagation();, {'passive': False}) notes_container.addEventListener('wheel', def(evt): evt.stopPropagation();, {'passive': False})
@ -373,18 +373,11 @@ class SelectionBar:
c = notes_container.lastChild c = notes_container.lastChild
notes_container.style.display = notes_container.previousSibling.style.display = 'block' notes_container.style.display = notes_container.previousSibling.style.display = 'block'
c.style.overflow = 'auto' c.style.overflow = 'auto'
if self.supports_css_min_max:
c.style.maxHeight = 'min(20ex, 40vh)' c.style.maxHeight = 'min(20ex, 40vh)'
else:
c.style.maxHeight = '20ex'
render_notes(notes, c, True) render_notes(notes, c, True)
# }}} # }}}
# accessors {{{ # accessors {{{
@property
def supports_css_min_max(self):
return not runtime.is_standalone_viewer or runtime.QT_VERSION >= 0x050f00
@property @property
def container(self): def container(self):
return document.getElementById('book-selection-bar-overlay') return document.getElementById('book-selection-bar-overlay')