Separate LineCount from main.

This commit is contained in:
2025-03-29 20:14:42 -04:00
parent 70e9f79c8a
commit 500a329dea
4 changed files with 109 additions and 112 deletions

View File

@@ -22,7 +22,6 @@ SplitView {
}
}
}
RowLayout {
// We use a flickable to synchronize the position of the editor and
// the line numbers. This is necessary because the line numbers can
@@ -41,14 +40,16 @@ SplitView {
Column {
anchors.fill: parent
topPadding: 6
Repeater {
id: repeatedLineNumbers
// Each line number in the gutter.
delegate: Item {
required property int index
height: Math.ceil(fontMetrics.lineSpacing)
height: 17
width: parent.width
Label {
@@ -71,12 +72,7 @@ SplitView {
width: 1
}
}
model: LineCount {
id: lineCountModel
// This count sets the max line numbers shown in the gutter.
count: areaText.lineCount
}
model: areaText.lineCount
}
}
}
@@ -107,10 +103,6 @@ SplitView {
textFormat: Qt.AutoText
wrapMode: TextArea.Wrap
onTextChanged: {
console.log("Updated line count: " + areaText.lineCount)
}
background: Rectangle {
color: "#2b2b2b"
}