Fix: show text delegate as per autofit label refactor
* fix show text delegate as per autofit label refactor
* Make rectangle containing text transparent
For different background colors, the background on the card should be set.
@@ -5,24 +5,26 @@ import org.kde.kirigami 2.4 as Kirigami
import Mycroft 1.0 as Mycroft
-Mycroft.Delegate {
+Mycroft.CardDelegate {
id: systemTextFrame
skillBackgroundColorOverlay: "#000000"
+ cardBackgroundOverlayColor: "#000000"
+
property bool hasTitle: sessionData.title.length > 0 ? true : false
- Component.onCompleted: {
- console.log(hasTitle)
- }
+ contentItem: Rectangle {
+ color: "transparent"
+
+ ColumnLayout {
+ anchors.fill: parent
- contentItem: ColumnLayout {
- Label {
+ Mycroft.AutoFitLabel {
id: systemTextFrameTitle
- Layout.fillWidth: true
- 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
+ Layout.fillWidth: true
+ Layout.fillHeight: true
font.family: "Noto Sans"
font.weight: Font.Bold
text: sessionData.title
@@ -30,13 +32,14 @@ Mycroft.Delegate {
Mycroft.AutoFitLabel {
id: systemTextFrameMainBody
- Layout.fillWidth: true
- Layout.fillHeight: true
wrapMode: Text.Wrap
font.family: "Noto Sans"
+ Layout.fillWidth: true
+ Layout.fillHeight: true
font.weight: Font.Bold
text: sessionData.text
}
}
}
+}
