Fix body editor under the Breeze style
The body editor was a TextArea with a custom background inside a
ScrollView. Under the Breeze QML style that raised "Unable to assign
TextArea to QQuickTextInput" (Breeze's TextArea.qml rejects a custom
background in that nesting).
Switch to the Qt-recommended idiom: a Flickable with
TextArea.flickable: TextArea { background: null }, wrapped in a plain
Rectangle that provides the border/background. Keeps monospace wrapping,
seed-on-open, Ctrl+Enter save and Esc cancel; adds a vertical ScrollBar.
GUI builds clean.
(The separate "startDrag() drag must be active" log was the previous
binary; the a3d2c49 fix removes it — relaunch to clear.)
This commit is contained in:
parent
a3d2c4947e
commit
b2efe6ea27
|
|
@ -1306,25 +1306,37 @@ ListView {
|
||||||
del.editingBody = false
|
del.editingBody = false
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollView {
|
// Bordered scroll frame holding the editor. Uses the
|
||||||
|
// Flickable + TextArea.flickable idiom (not ScrollView),
|
||||||
|
// which the Breeze style accepts; a custom background on a
|
||||||
|
// styled TextArea trips Breeze's TextArea internals.
|
||||||
|
Rectangle {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: Math.min(
|
Layout.preferredHeight: Math.min(
|
||||||
Math.max(bodyEditor.contentHeight + 16, outline.baseFontSize * 6),
|
Math.max(bodyEditor.contentHeight + 16, outline.baseFontSize * 6),
|
||||||
outline.baseFontSize * 20)
|
outline.baseFontSize * 20)
|
||||||
clip: true
|
color: theme.baseColor
|
||||||
|
border.color: theme.midColor
|
||||||
|
border.width: 1
|
||||||
|
radius: 3
|
||||||
|
|
||||||
TextArea {
|
Flickable {
|
||||||
|
id: bodyFlick
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: 4
|
||||||
|
clip: true
|
||||||
|
contentWidth: width
|
||||||
|
contentHeight: bodyEditor.contentHeight
|
||||||
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
|
ScrollBar.vertical: ScrollBar {}
|
||||||
|
|
||||||
|
TextArea.flickable: TextArea {
|
||||||
id: bodyEditor
|
id: bodyEditor
|
||||||
wrapMode: TextArea.Wrap
|
wrapMode: TextArea.Wrap
|
||||||
font.family: "monospace"
|
font.family: "monospace"
|
||||||
font.pointSize: outline.baseFontSize
|
font.pointSize: outline.baseFontSize
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
background: Rectangle {
|
background: null
|
||||||
color: theme.baseColor
|
|
||||||
border.color: theme.midColor
|
|
||||||
border.width: 1
|
|
||||||
radius: 3
|
|
||||||
}
|
|
||||||
// Seed from the raw body when the editor opens.
|
// Seed from the raw body when the editor opens.
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
|
|
@ -1346,6 +1358,7 @@ ListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Editor toolbar.
|
// Editor toolbar.
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue