22 lines
614 B
Python
22 lines
614 B
Python
"""Tool Supporting Basic Editor Functions"""
|
|
from typing import cast, Protocol
|
|
from PySide6.QtWidgets import QTextEdit, QVBoxLayout
|
|
|
|
import trovedb.trove as tr
|
|
from .tool import Tool
|
|
|
|
|
|
class ToolBasicEditor(Tool):
|
|
def __init__(self, note, parent=None):
|
|
super().__init__(note, parent)
|
|
|
|
layout = QVBoxLayout(self)
|
|
layout.setContentsMargins(0, 0, 0, 0)
|
|
layout.setSpacing(0)
|
|
|
|
self._text_edit = QTextEdit()
|
|
layout.addWidget(self._text_edit)
|
|
self.refresh()
|
|
|
|
def refresh(self):
|
|
self._text_edit.setPlainText(self.note.read_content().decode("utf-8"))
|