Ejemplo n.º 1
0
    def on_operation_did_execute(self, changes: OpChanges,
                                 handler: Optional[object]) -> None:
        focused = current_top_level_widget() == self
        self.table.op_executed(changes, handler, focused)
        self.sidebar.op_executed(changes, handler, focused)
        if changes.note or changes.notetype:
            if handler is not self.editor:
                # fixme: this will leave the splitter shown, but with no current
                # note being edited
                note = self.editor.note
                if note:
                    try:
                        note.load()
                    except NotFoundError:
                        self.editor.set_note(None)
                        return
                    self.editor.set_note(note)

            self._renderPreview()
Ejemplo n.º 2
0
 def on_focus_change(self, new: Optional[QWidget],
                     old: Optional[QWidget]) -> None:
     if current_top_level_widget() == self:
         self.setUpdatesEnabled(True)
         self.table.redraw_cells()
         self.sidebar.refresh_if_needed()