mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix visibility of right top bar icons not being toggled for dummy bar
This commit is contained in:
parent
f4bbbbd859
commit
e3e5cb55bb
@ -103,15 +103,15 @@ class TopBar:
|
|||||||
style="margin-left: " + self.SPACING,
|
style="margin-left: " + self.SPACING,
|
||||||
title=tooltip, svgicon(icon_name),
|
title=tooltip, svgicon(icon_name),
|
||||||
))
|
))
|
||||||
|
right.lastChild.setAttribute('id', ('top' if bar is self.bar else 'dummy') + '-bar-icon-' + icon_name)
|
||||||
if bar is self.bar:
|
if bar is self.bar:
|
||||||
right.lastChild.setAttribute('id', 'top-bar-icon-' + icon_name)
|
|
||||||
if action is not None:
|
if action is not None:
|
||||||
right.lastChild.addEventListener('click', def(event): event.preventDefault(), action();)
|
right.lastChild.addEventListener('click', def(event): event.preventDefault(), action();)
|
||||||
|
|
||||||
def set_button_visibility(self, icon_name, visible):
|
def set_button_visibility(self, icon_name, visible):
|
||||||
for bar in self.bar, self.dummy_bar:
|
for bar in self.bar, self.dummy_bar:
|
||||||
right = bar.firstChild.nextSibling
|
right = bar.firstChild.nextSibling
|
||||||
elem = right.querySelector('#top-bar-icon-' + icon_name)
|
elem = right.querySelector('#{}-bar-icon-{}'.format(('top' if bar is self.bar else 'dummy'), icon_name))
|
||||||
if elem:
|
if elem:
|
||||||
elem.parentNode.style.display = 'inline' if visible else 'none'
|
elem.parentNode.style.display = 'inline' if visible else 'none'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user