prepare filtering
This commit is contained in:
11
bigtext.py
11
bigtext.py
@@ -21,7 +21,7 @@ from settings import Settings
|
||||
|
||||
|
||||
class BigText(QWidget):
|
||||
def __init__(self, model: LogFileModel, settings: Settings):
|
||||
def __init__(self, model: LogFileModel):
|
||||
super(BigText, self).__init__()
|
||||
|
||||
self.model = model
|
||||
@@ -31,7 +31,7 @@ class BigText(QWidget):
|
||||
self.grid.setVerticalSpacing(0)
|
||||
self.setLayout(self.grid)
|
||||
|
||||
big_text = InnerBigText(self, model, settings)
|
||||
big_text = InnerBigText(self, model)
|
||||
big_text.setSizePolicy(QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding))
|
||||
|
||||
self.h_scroll_bar = QScrollBar(Qt.Orientation.Horizontal)
|
||||
@@ -59,10 +59,9 @@ class InnerBigText(QWidget):
|
||||
|
||||
highlights: [Highlight] = []
|
||||
|
||||
def __init__(self, parent: BigText, model: LogFileModel, settings: Settings):
|
||||
def __init__(self, parent: BigText, model: LogFileModel):
|
||||
super(InnerBigText, self).__init__()
|
||||
self.model = model
|
||||
self.settings = settings
|
||||
self.parent = parent
|
||||
self.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
|
||||
self.setFocusPolicy(Qt.FocusPolicy.WheelFocus)
|
||||
@@ -80,7 +79,7 @@ class InnerBigText(QWidget):
|
||||
|
||||
def keyPressEvent(self, e: QKeyEvent) -> None:
|
||||
|
||||
print("%s + %s" % (e.keyCombination().keyboardModifiers(), e.key()))
|
||||
#print("%s + %s" % (e.keyCombination().keyboardModifiers(), e.key()))
|
||||
if e.modifiers() == Qt.KeyboardModifier.NoModifier:
|
||||
lines_to_scroll = math.floor(self.lines_shown()) - 1
|
||||
if e.key() == Qt.Key.Key_PageUp:
|
||||
@@ -185,7 +184,7 @@ class InnerBigText(QWidget):
|
||||
|
||||
def paintEvent(self, event: QPaintEvent) -> None:
|
||||
painter = QPainter(self)
|
||||
painter.setFont(self.settings.font())
|
||||
painter.setFont(self.model.settings.font())
|
||||
painter.setPen(QColor(0, 0, 0))
|
||||
self.update_font_metrics(painter)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user