move highlights to model

makes it easier to manage highlights
This commit is contained in:
2021-10-28 09:52:00 +02:00
parent a0e6c24098
commit dbfe0bebf8
2 changed files with 13 additions and 10 deletions

View File

@@ -2,6 +2,10 @@ import math
import threading
import time
from typing import List
from PyQt6.QtGui import QBrush, QColor
from highlight_regex import HighlightRegex
from line import Line
import os
from settings import Settings
@@ -14,6 +18,14 @@ class LogFileModel:
self._file = os.path.realpath(file)
self._lock = threading.RLock()
self.highlights = [
HighlightRegex(
r"ERROR",
brush=QBrush(QColor(220, 112, 122)),
brush_full_line=QBrush(QColor(255, 112, 122))
)
]
def get_file(self):
return self._file