Fix: TextEdit anchors.top: headerBar/bottom + anchors.bottom: parent.bottom (без Flickable — Flickable получал нулевую высоту); убран debug yellow rectangle

This commit is contained in:
Flora (opencode)
2026-08-17 19:41:26 +03:00
parent 84cbe55d32
commit d709724fed
2 changed files with 13 additions and 46 deletions
+4 -20
View File
@@ -60,28 +60,13 @@ Item {
} }
} }
// Текст файла — TextEdit внутри Flickable // Текст файла — TextEdit напрямую (без Flickable)
Flickable { TextEdit {
id: flickable id: textDisplay
anchors.top: parent.top anchors.top: headerBar.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
contentWidth: textDisplay.paintedWidth
contentHeight: textDisplay.paintedHeight
clip: true
flickableDirection: Flickable.VerticalFlick
// ВРЕМЕННЫЙ красный фон для отладки размеров
Rectangle {
anchors.fill: parent
color: "red"
z: -1
}
TextEdit {
id: textDisplay
width: flickable.width
text: documentManager.activeIndex >= 0 text: documentManager.activeIndex >= 0
? documentManager.contentAt(documentManager.activeIndex) ? documentManager.contentAt(documentManager.activeIndex)
: "" : ""
@@ -92,7 +77,6 @@ Item {
readOnly: true readOnly: true
selectByMouse: true selectByMouse: true
} }
}
// Загрузка контента при смене файла // Загрузка контента при смене файла
function refresh() { function refresh() {
-17
View File
@@ -163,21 +163,4 @@ Item {
const n = documentManager.openTabs.length const n = documentManager.openTabs.length
if (n > 0) documentManager.setActiveIndex((documentManager.activeIndex + 1) % n) if (n > 0) documentManager.setActiveIndex((documentManager.activeIndex + 1) % n)
}} }}
// ОТЛАДКА: видимый текст прямо в EditorPanel (z:1000)
Text {
z: 1000
anchors.top: editorArea.top
anchors.left: editorArea.left
anchors.right: editorArea.right
height: 200
text: documentManager.activeIndex >= 0
? "DEBUG CONTENT: " + documentManager.contentAt(documentManager.activeIndex).substring(0, 500)
: "NO FILE OPENED (activeIndex=" + documentManager.activeIndex + ")"
font.pixelSize: 16
color: "blue"
wrapMode: Text.Wrap
clip: true
Rectangle { anchors.fill: parent; color: "yellow"; z: -1 }
}
} }