Hide selection bar when main chrome or highlights chrome are shown

This commit is contained in:
Kovid Goyal 2020-07-21 23:00:32 +05:30
parent 2f9c735d2f
commit bda006557a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 0 deletions

View File

@ -639,12 +639,14 @@ class CreateAnnotation:
c = self.container c = self.container
c.style.display = 'flex' c.style.display = 'flex'
c.focus() c.focus()
self.view.selection_bar.hide()
def hide(self): def hide(self):
if self.is_visible: if self.is_visible:
self.container.style.display = 'none' self.container.style.display = 'none'
self.view.focus_iframe() self.view.focus_iframe()
self.send_message('set-highlight-style', style=None) self.send_message('set-highlight-style', style=None)
self.view.selection_bar.update_position()
def send_message(self, type, **kw): def send_message(self, type, **kw):
self.view.iframe_wrapper.send_message('annotations', type=type, **kw) self.view.iframe_wrapper.send_message('annotations', type=type, **kw)

View File

@ -420,6 +420,10 @@ class View:
self.iframe_wrapper.send_message('overlay_visibility_changed', visible=visible) self.iframe_wrapper.send_message('overlay_visibility_changed', visible=visible)
if ui_operations.overlay_visibility_changed: if ui_operations.overlay_visibility_changed:
ui_operations.overlay_visibility_changed(visible) ui_operations.overlay_visibility_changed(visible)
if visible:
self.selection_bar.hide()
else:
self.selection_bar.update_position()
def on_handle_shortcut(self, data): def on_handle_shortcut(self, data):
if data.name is 'back': if data.name is 'back':