Use the correct delegate and fix layouts
@@ -5,7 +5,7 @@ import org.kde.kirigami 2.4 as Kirigami
import Mycroft 1.0 as Mycroft
-Mycroft.ProportionalDelegate {
+Mycroft.Delegate {
id: systemTextFrame
skillBackgroundColorOverlay: "#000000"
property bool hasTitle: sessionData.title.length > 0 ? true : false
@@ -14,11 +14,13 @@ Mycroft.ProportionalDelegate {
console.log(hasTitle)
}
- Mycroft.AutoFitLabel {
+ contentItem: ColumnLayout {
+ Label {
id: systemTextFrameTitle
Layout.fillWidth: true
- Layout.preferredHeight: proportionalGridUnit * 20
+ font.pixelSize: Math.min(systemTextFrame.height/4, Math.max(systemTextFrame.height/10, systemTextFrameMainBody.fontInfo.pixelSize * 1.4))
wrapMode: Text.Wrap
+ horizontalAlignment: Text.AlignHCenter
visible: hasTitle
enabled: hasTitle
font.family: "Noto Sans"
@@ -29,11 +31,12 @@ Mycroft.ProportionalDelegate {
Mycroft.AutoFitLabel {
id: systemTextFrameMainBody
Layout.fillWidth: true
- Layout.preferredHeight: proportionalGridUnit * 30
+ Layout.fillHeight: true
wrapMode: Text.Wrap
font.family: "Noto Sans"
font.weight: Font.Bold
text: sessionData.text
}
}
+}
