mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix opening and closing an existing highlight causes notes to be lost
This commit is contained in:
parent
673bcb3b2b
commit
7853364f1a
@ -669,8 +669,10 @@ class CreateAnnotation:
|
|||||||
|
|
||||||
def handle_message(self, msg):
|
def handle_message(self, msg):
|
||||||
if msg.type is 'create-annotation':
|
if msg.type is 'create-annotation':
|
||||||
self.editing_annot_uuid = None
|
self.editing_annot_uuid = msg.existing or None
|
||||||
self.current_notes = ''
|
self.current_notes = ''
|
||||||
|
if self.editing_annot_uuid:
|
||||||
|
self.current_notes = self.annotations_manager.notes_for_highlight(self.editing_annot_uuid) or ''
|
||||||
if not self.is_visible:
|
if not self.is_visible:
|
||||||
self.view.hide_overlays()
|
self.view.hide_overlays()
|
||||||
self.state = WAITING_FOR_CLICK
|
self.state = WAITING_FOR_CLICK
|
||||||
@ -679,7 +681,6 @@ class CreateAnnotation:
|
|||||||
if msg.extents and msg.extents.start.x is not None:
|
if msg.extents and msg.extents.start.x is not None:
|
||||||
self.place_handles(msg.extents)
|
self.place_handles(msg.extents)
|
||||||
self.in_flow_mode = msg.in_flow_mode
|
self.in_flow_mode = msg.in_flow_mode
|
||||||
self.editing_annot_uuid = msg.existing or None
|
|
||||||
self.send_message('set-highlight-style', style=self.current_highlight_style)
|
self.send_message('set-highlight-style', style=self.current_highlight_style)
|
||||||
elif msg.type is 'position-handles':
|
elif msg.type is 'position-handles':
|
||||||
if self.state is WAITING_FOR_CLICK:
|
if self.state is WAITING_FOR_CLICK:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user