From a1c78cf5e3f66052ed94447fcc9fcae810b22437 Mon Sep 17 00:00:00 2001 From: "Flora (opencode)" Date: Mon, 17 Aug 2026 19:13:10 +0300 Subject: [PATCH] =?UTF-8?q?Fix:=20TextArea=20=D0=B7=D0=B0=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D0=BD=D1=8F=D0=B5=D1=82=20=D0=92=D0=95=D0=A1=D0=AC=20Edi?= =?UTF-8?q?torPane=20(anchors.fill:=20parent),=20=D1=88=D0=B0=D0=BF=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0=20=E2=80=94=20=D0=BF?= =?UTF-8?q?=D0=BB=D0=B0=D0=B2=D0=B0=D1=8E=D1=89=D0=B8=D0=B9=20=D0=BE=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D0=BB=D0=B5=D0=B9=20(z:10)=20=D1=81=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D1=85=D1=83;=20=D1=83=D0=B1=D1=80=D0=B0=D0=BD=20debug-la?= =?UTF-8?q?bel;=20=D1=83=D0=B1=D1=80=D0=B0=D0=BD=D1=8B=20orphan-=D1=8D?= =?UTF-8?q?=D0=BB=D0=B5=D0=BC=D0=B5=D0=BD=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qml/panels/EditorPane.qml | 75 ++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/qml/panels/EditorPane.qml b/qml/panels/EditorPane.qml index a12dc65..61c6297 100644 --- a/qml/panels/EditorPane.qml +++ b/qml/panels/EditorPane.qml @@ -149,14 +149,45 @@ Item { replaceRange(s, e, out.join("\n")) } - // ---------- Шапка (сверху) ---------- + // ---------- TextArea (заполняет ВСЁ пространство) ---------- + TextArea { + id: editor + anchors.fill: parent + visible: pane.editMode + color: "black" + onTextEdited: documentManager.updateContent(pane.docIndex, text) + selectByMouse: true + font.family: "Menlo, Consolas, 'DejaVu Sans Mono', monospace" + font.pixelSize: 14 + wrapMode: TextEdit.NoWrap + padding: 10 + placeholderText: qsTr("Документ не выбран") + } + + TextArea { + id: viewer + anchors.fill: parent + visible: !pane.editMode + textFormat: TextEdit.RichText + text: "" + readOnly: true + selectByMouse: true + wrapMode: TextEdit.Wrap + padding: 12 + onLinkActivated: (href) => pane.handleViewLink(href) + placeholderText: qsTr("Документ не выбран") + } + + // ---------- Шапка файла (плавающий оверлей сверху) ---------- Rectangle { id: headerBar anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right height: 30 - color: "whitesmoke" + z: 10 + color: "#f0f0f0" + border.color: "#ddd" RowLayout { anchors.fill: parent @@ -209,45 +240,7 @@ Item { } } - // ---------- Область контента (под шапкой, заполняет остаток) ---------- - Rectangle { - id: contentArea - anchors.top: headerBar.bottom - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - color: "white" - - TextArea { - id: editor - anchors.fill: parent - visible: pane.editMode - color: "black" - onTextEdited: documentManager.updateContent(pane.docIndex, text) - selectByMouse: true - font.family: "Menlo, Consolas, 'DejaVu Sans Mono', monospace" - font.pixelSize: 14 - wrapMode: TextEdit.NoWrap - padding: 10 - placeholderText: qsTr("Документ не выбран") - } - - TextArea { - id: viewer - anchors.fill: parent - visible: !pane.editMode - textFormat: TextEdit.RichText - text: "" - readOnly: true - selectByMouse: true - wrapMode: TextEdit.Wrap - padding: 12 - onLinkActivated: (href) => pane.handleViewLink(href) - placeholderText: qsTr("Документ не выбран") - } - } - - // ---------- Просмотр (режим просмотра) ---------- + // ---------- Функции ---------- function loadContent() { if (pane.docIndex >= 0) { const c = documentManager.contentAt(pane.docIndex)