From 6e49c4b5f824350ff8d1cf9229d8600a57ea2e2c Mon Sep 17 00:00:00 2001 From: grendervill Date: Wed, 2 Sep 2026 00:38:01 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81:=20=D0=BA=D0=BE=D0=B4?= =?UTF-8?q?=20=D0=BA=D0=B0=D0=BA=20=D0=B2=D0=B2=D1=91=D0=BB=20+=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B5=D0=B2=D1=8C=D1=8E=20=D1=81=D0=BA=D1=80=D0=BE=D0=BB?= =?UTF-8?q?=D0=BB=20+=20=D1=85=D1=80=D0=B0=D0=BD=D0=B8=D0=BB=D0=B8=D1=89?= =?UTF-8?q?=D0=B5=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=D0=B4=D0=BD=D0=B5=D0=B5?= =?UTF-8?q?=20=D0=B2=D1=8B=D0=B1=D1=80=D0=B0=D0=BD=D0=BD=D0=BE=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CodeBlock: RowLayout для header (copy строго справа), MarkdownView в Column внутри ScrollView (availableWidth) — превью теперь скроллится, показывает все строки, код как ввёл (pre-wrap, tab 4) - Vault: selectVault при выборе в переключателе + windowOpened -> setCurrentVault — запуск с последним выбранным, проверено на /Users/alex/Nextcloud/test и test-vault --- qml/panels/CodeBlock.qml | 21 ++++++++++++--------- qml/panels/EditorPanel.qml | 33 ++++++++++++++++++--------------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/qml/panels/CodeBlock.qml b/qml/panels/CodeBlock.qml index 0cc08b0..799bc98 100644 --- a/qml/panels/CodeBlock.qml +++ b/qml/panels/CodeBlock.qml @@ -1,5 +1,6 @@ import QtQuick import QtQuick.Controls +import QtQuick.Layouts import Flora Rectangle { @@ -32,8 +33,8 @@ Rectangle { anchors.margins: 10 spacing: 6 - // Header with language and copy button - Row { + // Header with language and copy button — строго справа + RowLayout { width: parent.width height: 24 spacing: 8 @@ -44,24 +45,26 @@ Rectangle { font.pixelSize: 10 font.bold: true font.letterSpacing: 0.4 - verticalAlignment: Text.AlignVCenter - height: parent.height + Layout.alignment: Qt.AlignVCenter visible: root.language !== "text" && root.language !== "" } - Item { width: parent.width - languageLabel.width - copyButton.width - 16; height: 1 } + Item { + Layout.fillWidth: true + height: 1 + } Label { id: languageLabel text: root.language visible: false - width: 0 - height: 0 } // Copy button - Telegram style, hover/active feedback Rectangle { id: copyButton - width: copyLabel.implicitWidth + 16 - height: 22 + Layout.preferredWidth: copyLabel.implicitWidth + 16 + Layout.preferredHeight: 22 + implicitWidth: copyLabel.implicitWidth + 16 + implicitHeight: 22 radius: 11 color: copyHover.hovered ? (copyTap.pressed ? Qt.rgba(1,1,1,0.30) : Qt.rgba(1,1,1,0.22)) : Qt.rgba(1,1,1,0.12) border.color: copyHover.hovered ? Qt.rgba(1,1,1,0.28) : Qt.rgba(1,1,1,0.18) diff --git a/qml/panels/EditorPanel.qml b/qml/panels/EditorPanel.qml index ad3835f..ffa605b 100644 --- a/qml/panels/EditorPanel.qml +++ b/qml/panels/EditorPanel.qml @@ -633,22 +633,25 @@ Item { ScrollBar.vertical.policy: ScrollBar.AsNeeded background: Rectangle { color: Theme.editorBg } - MarkdownView { - id: viewArea - visible: viewMode === "preview" - width: viewScroll.width - vaultRoot: fileStore.vault - fileDir: activeFileDir() - onLinkActivated: (href) => handleLink(href) - } + Column { + width: viewScroll.availableWidth + MarkdownView { + id: viewArea + visible: viewMode === "preview" + width: parent.width + vaultRoot: fileStore.vault + fileDir: activeFileDir() + onLinkActivated: (href) => handleLink(href) + } - MarkdownView { - id: livePreview - visible: viewMode === "live" - width: viewScroll.width - vaultRoot: fileStore.vault - fileDir: activeFileDir() - onLinkActivated: (href) => handleLink(href) + MarkdownView { + id: livePreview + visible: viewMode === "live" + width: parent.width + vaultRoot: fileStore.vault + fileDir: activeFileDir() + onLinkActivated: (href) => handleLink(href) + } } } }