mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
wrap in box, make markdown
This commit is contained in:
@@ -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
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user