Fix: EditorPane переписан на anchors (headerBar сверху, contentArea снизу); убрана лишняя } после contentArea; ColumnLayout больше не используется в EditorPane/EditorPanel
This commit is contained in:
+17
-34
@@ -149,13 +149,13 @@ Item {
|
||||
replaceRange(s, e, out.join("\n"))
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 0
|
||||
|
||||
// ---------- Шапка (сверху) ----------
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: 30
|
||||
id: headerBar
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: 30
|
||||
color: "whitesmoke"
|
||||
|
||||
RowLayout {
|
||||
@@ -172,13 +172,11 @@ Item {
|
||||
text: ""
|
||||
}
|
||||
|
||||
// Переключатель режимов
|
||||
ToolButton {
|
||||
text: "✎"
|
||||
checkable: true
|
||||
checked: pane.editMode
|
||||
ToolTip.visible: hovered
|
||||
ToolTip.text: qsTr("Режим редактирования (Ctrl+E)")
|
||||
ToolTip.text: qsTr("Редактирование")
|
||||
onClicked: { pane.editMode = true; editBtn.checked = true; viewBtn.checked = false }
|
||||
}
|
||||
ToolButton {
|
||||
@@ -186,11 +184,9 @@ Item {
|
||||
text: "👁"
|
||||
checkable: true
|
||||
checked: !pane.editMode
|
||||
ToolTip.visible: hovered
|
||||
ToolTip.text: qsTr("Режим просмотра (Ctrl+E)")
|
||||
ToolTip.text: qsTr("Просмотр")
|
||||
onClicked: { pane.editMode = false; editBtn.checked = false; viewBtn.checked = true }
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
id: editBtn
|
||||
visible: false
|
||||
@@ -198,28 +194,28 @@ Item {
|
||||
checked: true
|
||||
onClicked: { pane.editMode = true; viewBtn.checked = false }
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
text: "\u25B8\u25CB\u25C0" // «открыть рядом» (две панели)
|
||||
text: "\u25B8\u25CB\u25C0"
|
||||
visible: pane.canOpenBeside && !documentManager.sideBySide
|
||||
ToolTip.visible: hovered
|
||||
ToolTip.text: qsTr("Открыть рядом (две панели)")
|
||||
ToolTip.text: qsTr("Открыть рядом")
|
||||
onClicked: pane.openBeside()
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
text: "\u2715"
|
||||
visible: pane.closable
|
||||
ToolTip.visible: hovered
|
||||
ToolTip.text: qsTr("Закрыть вторую панель")
|
||||
ToolTip.text: qsTr("Закрыть панель")
|
||||
onClicked: pane.closePane()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- Область контента (под шапкой, заполняет остаток) ----------
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
id: contentArea
|
||||
anchors.top: headerBar.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
color: "white"
|
||||
|
||||
TextArea {
|
||||
@@ -236,18 +232,6 @@ Item {
|
||||
placeholderText: qsTr("Документ не выбран")
|
||||
}
|
||||
|
||||
// Отладочный индикатор (временно)
|
||||
Label {
|
||||
visible: true
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.margins: 4
|
||||
font.pixelSize: 10
|
||||
color: "#999"
|
||||
text: "docIndex=" + pane.docIndex + " editMode=" + pane.editMode
|
||||
+ " contentLen=" + editor.text.length
|
||||
}
|
||||
|
||||
TextArea {
|
||||
id: viewer
|
||||
anchors.fill: parent
|
||||
@@ -262,7 +246,6 @@ Item {
|
||||
placeholderText: qsTr("Документ не выбран")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- Просмотр (режим просмотра) ----------
|
||||
function loadContent() {
|
||||
|
||||
Reference in New Issue
Block a user