wrap in box, make markdown

This commit is contained in:
Kainoa Kanter
2026-01-08 18:07:24 -08:00
parent 06851515dd
commit b323f7aeae
2 changed files with 53 additions and 9 deletions
+44 -8
View File
@@ -1194,14 +1194,50 @@ SmartPanel {
Layout.fillWidth: true
Layout.fillHeight: true
NText {
anchors.centerIn: parent
text: root.results.length > 0 ? root.results[0].name : ""
pointSize: 48
font.weight: Font.Bold
color: Style.textColor
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
NBox {
anchors.fill: parent
color: Color.mSurfaceVariant
Layout.fillWidth: true
Layout.fillHeight: true
ColumnLayout {
anchors.fill: parent
anchors.margins: Style.marginL
Layout.fillWidth: true
Layout.fillHeight: true
Item {
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
NText {
text: root.results.length > 0 ? root.results[0].name : ""
pointSize: Style.fontSizeL
font.weight: Font.Bold
color: Color.mPrimary
}
}
ScrollView {
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
Layout.topMargin: Style.fontSizeL + Style.marginXL
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
contentWidth: availableWidth
NText {
width: parent.width
text: root.results.length > 0 ? root.results[0].description : ""
pointSize: Style.fontSizeM
font.weight: Font.Bold
color: Color.mOnSurface
horizontalAlignment: Text.AlignHLeft
verticalAlignment: Text.AlignTop
wrapMode: Text.Wrap
markdownTextEnabled: true
}
}
}
}
}
}
+9 -1
View File
@@ -7,6 +7,7 @@ Text {
id: root
property bool richTextEnabled: false
property bool markdownTextEnabled: false
property string family: Settings.data.ui.fontDefault
property real pointSize: Style.fontSizeM
property bool applyUiScale: true
@@ -26,5 +27,12 @@ Text {
wrapMode: Text.NoWrap
verticalAlignment: Text.AlignVCenter
textFormat: richTextEnabled ? Text.RichText : Text.PlainText
textFormat: {
if (root.richTextEnabled) {
return Text.RichText;
} else if (root.markdownTextEnabled) {
return Text.MarkdownText;
}
return Text.PlainText;
}
}