Merge pull request #2815 from AIIX/Fix/SystemTextFrame
Bug Fix - Use the correct delegate, fix layouts, autofit text for System TextFramepull/2823/head
commit
8e51083882
|
@ -5,7 +5,7 @@ import org.kde.kirigami 2.4 as Kirigami
|
||||||
|
|
||||||
import Mycroft 1.0 as Mycroft
|
import Mycroft 1.0 as Mycroft
|
||||||
|
|
||||||
Mycroft.ProportionalDelegate {
|
Mycroft.Delegate {
|
||||||
id: systemTextFrame
|
id: systemTextFrame
|
||||||
skillBackgroundColorOverlay: "#000000"
|
skillBackgroundColorOverlay: "#000000"
|
||||||
property bool hasTitle: sessionData.title.length > 0 ? true : false
|
property bool hasTitle: sessionData.title.length > 0 ? true : false
|
||||||
|
@ -13,27 +13,30 @@ Mycroft.ProportionalDelegate {
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
console.log(hasTitle)
|
console.log(hasTitle)
|
||||||
}
|
}
|
||||||
|
|
||||||
Mycroft.AutoFitLabel {
|
contentItem: ColumnLayout {
|
||||||
id: systemTextFrameTitle
|
Label {
|
||||||
Layout.fillWidth: true
|
id: systemTextFrameTitle
|
||||||
Layout.preferredHeight: proportionalGridUnit * 20
|
Layout.fillWidth: true
|
||||||
wrapMode: Text.Wrap
|
font.pixelSize: Math.min(systemTextFrame.height/4, Math.max(systemTextFrame.height/10, systemTextFrameMainBody.fontInfo.pixelSize * 1.4))
|
||||||
visible: hasTitle
|
wrapMode: Text.Wrap
|
||||||
enabled: hasTitle
|
horizontalAlignment: Text.AlignHCenter
|
||||||
font.family: "Noto Sans"
|
visible: hasTitle
|
||||||
font.weight: Font.Bold
|
enabled: hasTitle
|
||||||
text: sessionData.title
|
font.family: "Noto Sans"
|
||||||
}
|
font.weight: Font.Bold
|
||||||
|
text: sessionData.title
|
||||||
Mycroft.AutoFitLabel {
|
}
|
||||||
id: systemTextFrameMainBody
|
|
||||||
Layout.fillWidth: true
|
Mycroft.AutoFitLabel {
|
||||||
Layout.preferredHeight: proportionalGridUnit * 30
|
id: systemTextFrameMainBody
|
||||||
wrapMode: Text.Wrap
|
Layout.fillWidth: true
|
||||||
font.family: "Noto Sans"
|
Layout.fillHeight: true
|
||||||
font.weight: Font.Bold
|
wrapMode: Text.Wrap
|
||||||
text: sessionData.text
|
font.family: "Noto Sans"
|
||||||
|
font.weight: Font.Bold
|
||||||
|
text: sessionData.text
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue