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) + } } } }