Fix: TextEdit anchors.top: headerBar/bottom + anchors.bottom: parent.bottom (без Flickable — Flickable получал нулевую высоту); убран debug yellow rectangle
This commit is contained in:
+13
-29
@@ -60,38 +60,22 @@ 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
|
text: documentManager.activeIndex >= 0
|
||||||
contentHeight: textDisplay.paintedHeight
|
? documentManager.contentAt(documentManager.activeIndex)
|
||||||
clip: true
|
: ""
|
||||||
flickableDirection: Flickable.VerticalFlick
|
color: "black"
|
||||||
|
font.family: "Menlo, Consolas, 'DejaVu Sans Mono', monospace"
|
||||||
// ВРЕМЕННЫЙ красный фон для отладки размеров
|
font.pixelSize: 14
|
||||||
Rectangle {
|
wrapMode: TextEdit.NoWrap
|
||||||
anchors.fill: parent
|
readOnly: true
|
||||||
color: "red"
|
selectByMouse: true
|
||||||
z: -1
|
|
||||||
}
|
|
||||||
|
|
||||||
TextEdit {
|
|
||||||
id: textDisplay
|
|
||||||
width: flickable.width
|
|
||||||
text: documentManager.activeIndex >= 0
|
|
||||||
? documentManager.contentAt(documentManager.activeIndex)
|
|
||||||
: ""
|
|
||||||
color: "black"
|
|
||||||
font.family: "Menlo, Consolas, 'DejaVu Sans Mono', monospace"
|
|
||||||
font.pixelSize: 14
|
|
||||||
wrapMode: TextEdit.NoWrap
|
|
||||||
readOnly: true
|
|
||||||
selectByMouse: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Загрузка контента при смене файла
|
// Загрузка контента при смене файла
|
||||||
|
|||||||
@@ -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 }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user