mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
ChangelogPanel: nice formatting for changelogs
AboutTab: update version connection GitHubService: cleanup, move changelog logic to UpdateService UpdateService: use new changelog host
This commit is contained in:
@@ -128,12 +128,6 @@ SmartPanel {
|
||||
width: parent.width
|
||||
spacing: Style.marginM
|
||||
|
||||
NText {
|
||||
text: I18n.tr("changelog.panel.highlight-title")
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Color.mOnSurface
|
||||
}
|
||||
|
||||
NText {
|
||||
visible: UpdateService.fetchError !== ""
|
||||
text: UpdateService.fetchError
|
||||
@@ -153,6 +147,7 @@ SmartPanel {
|
||||
})
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Color.mOnSurface
|
||||
pointSize: Style.fontSizeL
|
||||
}
|
||||
|
||||
NText {
|
||||
@@ -164,30 +159,21 @@ SmartPanel {
|
||||
pointSize: Style.fontSizeXS
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: modelData.entries
|
||||
delegate: RowLayout {
|
||||
width: parent.width
|
||||
spacing: Style.marginS
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: Style.marginXS
|
||||
|
||||
Rectangle {
|
||||
width: Style.marginXL
|
||||
height: Style.marginXL
|
||||
radius: Style.radiusS
|
||||
color: Qt.alpha(Color.mPrimary, 0.12)
|
||||
|
||||
NIcon {
|
||||
anchors.centerIn: parent
|
||||
icon: "check"
|
||||
color: Color.mPrimary
|
||||
pointSize: Style.fontSizeM
|
||||
}
|
||||
}
|
||||
|
||||
NText {
|
||||
text: modelData
|
||||
color: Color.mOnSurface
|
||||
Repeater {
|
||||
model: modelData.entries
|
||||
delegate: NText {
|
||||
readonly property bool isHeading: root.isEmojiHeading(modelData)
|
||||
text: modelData.length === 0 ? "\u00A0" : modelData
|
||||
wrapMode: Text.WordWrap
|
||||
elide: Text.ElideNone
|
||||
textFormat: Text.PlainText
|
||||
color: isHeading ? Color.mPrimary : Color.mOnSurface
|
||||
font.weight: isHeading ? Style.fontWeightBold : Style.fontWeightMedium
|
||||
pointSize: isHeading ? Style.fontSizeXL : Style.fontSizeM
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
@@ -240,9 +226,21 @@ SmartPanel {
|
||||
}
|
||||
}
|
||||
|
||||
function isEmojiHeading(text) {
|
||||
if (!text)
|
||||
return false;
|
||||
const trimmed = text.trim();
|
||||
if (trimmed.length === 0)
|
||||
return false;
|
||||
if (/^##\s*/i.test(trimmed))
|
||||
return false;
|
||||
const emojiHeading = /^[\u2600-\u27BF\u{1F300}-\u{1FAFF}]\s+/u;
|
||||
return emojiHeading.test(trimmed);
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
if (GitHubService && GitHubService.clearReleaseCache) {
|
||||
GitHubService.clearReleaseCache();
|
||||
if (UpdateService && UpdateService.clearReleaseCache) {
|
||||
UpdateService.clearReleaseCache();
|
||||
}
|
||||
if (UpdateService && UpdateService.changelogCurrentVersion) {
|
||||
UpdateService.markChangelogSeen(UpdateService.changelogCurrentVersion);
|
||||
|
||||
@@ -11,7 +11,7 @@ import qs.Widgets
|
||||
ColumnLayout {
|
||||
id: root
|
||||
|
||||
property string latestVersion: GitHubService.latestVersion
|
||||
property string latestVersion: UpdateService.latestVersion
|
||||
property string currentVersion: UpdateService.currentVersion
|
||||
property var contributors: GitHubService.contributors
|
||||
|
||||
|
||||
Reference in New Issue
Block a user